Skip to content

Commit 4aa1d3e

Browse files
committed
configure playwright to use reduced motion
1 parent 88dd1d4 commit 4aa1d3e

File tree

13 files changed

+39
-9
lines changed

13 files changed

+39
-9
lines changed

exercises/01.basics/02.problem.running-the-app/app/routes/_marketing+/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function Index() {
3434
<div className="flex max-w-md flex-col items-center text-center xl:order-2 xl:items-start xl:text-left">
3535
<a
3636
href="https://www.epicweb.dev/stack"
37-
className="animate-slide-top xl:animate-slide-left [animation-fill-mode:backwards] xl:[animation-delay:0.5s] xl:[animation-fill-mode:backwards]"
37+
className="motion-safe:animate-slide-top xl:motion-safe:animate-slide-left [animation-fill-mode:backwards] xl:[animation-delay:0.5s] xl:[animation-fill-mode:backwards]"
3838
>
3939
<svg
4040
className="text-foreground size-20 xl:-mt-4"
@@ -50,13 +50,13 @@ export default function Index() {
5050
</a>
5151
<h1
5252
data-heading
53-
className="animate-slide-top text-foreground xl:animate-slide-left mt-8 text-4xl font-medium [animation-delay:0.3s] [animation-fill-mode:backwards] md:text-5xl xl:mt-4 xl:text-6xl xl:[animation-delay:0.8s] xl:[animation-fill-mode:backwards]"
53+
className="motion-safe:animate-slide-top text-foreground xl:motion-safe:animate-slide-left mt-8 text-4xl font-medium [animation-delay:0.3s] [animation-fill-mode:backwards] md:text-5xl xl:mt-4 xl:text-6xl xl:[animation-delay:0.8s] xl:[animation-fill-mode:backwards]"
5454
>
5555
<a href="https://www.epicweb.dev/stack">The Epic Stack</a>
5656
</h1>
5757
<p
5858
data-paragraph
59-
className="animate-slide-top text-muted-foreground xl:animate-slide-left mt-6 text-xl/7 [animation-delay:0.8s] [animation-fill-mode:backwards] xl:mt-8 xl:text-xl/6 xl:leading-10 xl:[animation-delay:1s] xl:[animation-fill-mode:backwards]"
59+
className="motion-safe:animate-slide-top text-muted-foreground xl:motion-safe:animate-slide-left mt-6 text-xl/7 [animation-delay:0.8s] [animation-fill-mode:backwards] xl:mt-8 xl:text-xl/6 xl:leading-10 xl:[animation-delay:1s] xl:[animation-fill-mode:backwards]"
6060
>
6161
Check the{' '}
6262
<a
@@ -76,7 +76,7 @@ export default function Index() {
7676
className={cn(
7777
columnClasses[logo.column],
7878
rowClasses[logo.row],
79-
'animate-roll-reveal [animation-fill-mode:backwards]',
79+
'motion-safe:animate-roll-reveal [animation-fill-mode:backwards]',
8080
)}
8181
style={{ animationDelay: `${i * 0.07}s` }}
8282
>

exercises/01.basics/02.solution.running-the-app/app/routes/_marketing+/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function Index() {
3434
<div className="flex max-w-md flex-col items-center text-center xl:order-2 xl:items-start xl:text-left">
3535
<a
3636
href="https://www.epicweb.dev/stack"
37-
className="animate-slide-top xl:animate-slide-left [animation-fill-mode:backwards] xl:[animation-delay:0.5s] xl:[animation-fill-mode:backwards]"
37+
className="motion-safe:animate-slide-top xl:motion-safe:animate-slide-left [animation-fill-mode:backwards] xl:[animation-delay:0.5s] xl:[animation-fill-mode:backwards]"
3838
>
3939
<svg
4040
className="text-foreground size-20 xl:-mt-4"
@@ -50,13 +50,13 @@ export default function Index() {
5050
</a>
5151
<h1
5252
data-heading
53-
className="animate-slide-top text-foreground xl:animate-slide-left mt-8 text-4xl font-medium [animation-delay:0.3s] [animation-fill-mode:backwards] md:text-5xl xl:mt-4 xl:text-6xl xl:[animation-delay:0.8s] xl:[animation-fill-mode:backwards]"
53+
className="motion-safe:animate-slide-top text-foreground xl:motion-safe:animate-slide-left mt-8 text-4xl font-medium [animation-delay:0.3s] [animation-fill-mode:backwards] md:text-5xl xl:mt-4 xl:text-6xl xl:[animation-delay:0.8s] xl:[animation-fill-mode:backwards]"
5454
>
5555
<a href="https://www.epicweb.dev/stack">The Epic Stack</a>
5656
</h1>
5757
<p
5858
data-paragraph
59-
className="animate-slide-top text-muted-foreground xl:animate-slide-left mt-6 text-xl/7 [animation-delay:0.8s] [animation-fill-mode:backwards] xl:mt-8 xl:text-xl/6 xl:leading-10 xl:[animation-delay:1s] xl:[animation-fill-mode:backwards]"
59+
className="motion-safe:animate-slide-top text-muted-foreground xl:motion-safe:animate-slide-left mt-6 text-xl/7 [animation-delay:0.8s] [animation-fill-mode:backwards] xl:mt-8 xl:text-xl/6 xl:leading-10 xl:[animation-delay:1s] xl:[animation-fill-mode:backwards]"
6060
>
6161
Check the{' '}
6262
<a
@@ -76,7 +76,7 @@ export default function Index() {
7676
className={cn(
7777
columnClasses[logo.column],
7878
rowClasses[logo.row],
79-
'animate-roll-reveal [animation-fill-mode:backwards]',
79+
'motion-safe:animate-roll-reveal [animation-fill-mode:backwards]',
8080
)}
8181
style={{ animationDelay: `${i * 0.07}s` }}
8282
>

exercises/01.basics/02.solution.running-the-app/playwright.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export default defineConfig({
1717
use: {
1818
baseURL: `http://localhost:${PORT}/`,
1919
trace: 'on-first-retry',
20+
contextOptions: {
21+
reducedMotion: 'reduce',
22+
},
2023
},
2124

2225
projects: [

exercises/02.test-setup/01.problem.custom-fixtures/playwright.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export default defineConfig({
1717
use: {
1818
baseURL: `http://localhost:${PORT}/`,
1919
trace: 'on-first-retry',
20+
contextOptions: {
21+
reducedMotion: 'reduce',
22+
},
2023
},
2124

2225
projects: [

exercises/02.test-setup/01.solution.custom-fixtures/playwright.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export default defineConfig({
1717
use: {
1818
baseURL: `http://localhost:${PORT}/`,
1919
trace: 'on-first-retry',
20+
contextOptions: {
21+
reducedMotion: 'reduce',
22+
},
2023
},
2124

2225
projects: [

exercises/02.test-setup/03.problem.authentication/playwright.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export default defineConfig({
1717
use: {
1818
baseURL: `http://localhost:${PORT}/`,
1919
trace: 'on-first-retry',
20+
contextOptions: {
21+
reducedMotion: 'reduce',
22+
},
2023
},
2124

2225
projects: [

exercises/02.test-setup/03.solution.authentication/playwright.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export default defineConfig({
1717
use: {
1818
baseURL: `http://localhost:${PORT}/`,
1919
trace: 'on-first-retry',
20+
contextOptions: {
21+
reducedMotion: 'reduce',
22+
},
2023
},
2124

2225
projects: [

exercises/02.test-setup/04.solution.api-mocking/playwright.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export default defineConfig({
1717
use: {
1818
baseURL: `http://localhost:${PORT}/`,
1919
trace: 'on-first-retry',
20+
contextOptions: {
21+
reducedMotion: 'reduce',
22+
},
2023
},
2124

2225
projects: [

exercises/03.guides/01.problem.recording-interactions/playwright.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export default defineConfig({
1717
use: {
1818
baseURL: `http://localhost:${PORT}/`,
1919
trace: 'on-first-retry',
20+
contextOptions: {
21+
reducedMotion: 'reduce',
22+
},
2023
},
2124

2225
projects: [

exercises/03.guides/01.solution.recording-interactions/playwright.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export default defineConfig({
1717
use: {
1818
baseURL: `http://localhost:${PORT}/`,
1919
trace: 'on-first-retry',
20+
contextOptions: {
21+
reducedMotion: 'reduce',
22+
},
2023
},
2124

2225
projects: [

0 commit comments

Comments
 (0)