Skip to content

Commit 989a336

Browse files
committed
feat: respect user's reduced motion preference and update homepage content.
1 parent 6d0abec commit 989a336

2 files changed

Lines changed: 13 additions & 15 deletions

File tree

src/pages/index.astro

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,19 @@ const posts = Object.values(postsGlob)
5353
<div
5454
class="md:sticky md:top-0 md:h-screen flex flex-col justify-center py-12"
5555
>
56-
<section class="flex flex-col gap-6">
56+
<section class="flex flex-col gap-6 mt-40 md:mt-0">
5757
<h1
5858
class="text-[clamp(2.5rem,5vw,4rem)] leading-tight font-medium tracking-tight motion-preset-slide-up motion-preset-fade-lg"
5959
>
6060
Hi, I'm Yonatan.
6161
</h1>
6262
<h2
63-
class="text-lg font-light text-pretty leading-relaxed text-neutral-300 motion-preset-slide-up motion-preset-fade-lg motion-delay-300"
63+
class="text-lg font-light text-pretty leading-relaxed text-neutral-300 motion-preset-slide-up motion-preset-fade-lg motion-reduce:motion-delay-0 motion-delay-300"
6464
>
65-
JavaScript Enthusiast, Software Engineer, and Occasional Post Writer. <br
66-
/>
67-
Read my latest post <a
68-
class="underline text-neutral-200"
69-
href={posts.at(0).url}
70-
title={posts.at(0).title}>here</a
71-
>.
65+
JavaScript Enthusiast, Software Engineer, and Occasional Post Writer.
7266
</h2>
7367
<div
74-
class="flex motion-preset-slide-up motion-preset-fade-lg motion-delay-500"
68+
class="flex motion-preset-slide-up motion-preset-fade-lg motion-reduce:motion-delay-0 motion-delay-500"
7569
>
7670
<Tilt>
7771
<div class="flex gap-4">
@@ -80,7 +74,7 @@ const posts = Object.values(postsGlob)
8074
</Tilt>
8175
</div>
8276
<span
83-
class="text-sm font-light text-pretty leading-relaxed text-neutral-400 motion-preset-slide-up motion-preset-fade-lg motion-delay-700"
77+
class="text-sm font-light text-pretty leading-relaxed text-neutral-400 motion-preset-slide-up motion-preset-fade-lg motion-reduce:motion-delay-0 motion-delay-700"
8478
>Follow me on <a
8579
class="underline hover:text-white transition-colors"
8680
href="https://github.com/paripsky"
@@ -112,7 +106,9 @@ const posts = Object.values(postsGlob)
112106
</section>
113107
</div>
114108

115-
<div class="flex flex-col gap-20 py-12">
109+
<div
110+
class="flex flex-col gap-20 py-12"
111+
>
116112
<section id="posts" class="flex flex-col gap-6">
117113
<Pill><Icon name="mdi:post" class="size-4" /> Posts</Pill>
118114
<ul class="flex flex-col gap-4">

src/styles/global.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
@plugin "@tailwindcss/typography";
33
@plugin "tailwindcss-motion";
44

5-
html {
6-
scroll-behavior: smooth;
7-
scroll-padding-top: 3rem;
5+
@media (prefers-reduced-motion: no-preference) {
6+
html {
7+
scroll-behavior: smooth;
8+
scroll-padding-top: 3rem;
9+
}
810
}

0 commit comments

Comments
 (0)