Skip to content

Commit

Permalink
rename forceAnimation to ignoreReducedMotion
Browse files Browse the repository at this point in the history
  • Loading branch information
fehmer committed Dec 27, 2024
1 parent 40a0aab commit 9eb7324
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion frontend/src/styles/media-queries.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,8 @@ body {
}

@media (prefers-reduced-motion) {
body:not(.force-animation) *:not(.fa-spin, #backgroundLoader, .preloader) {
body:not(.ignore-reduced-motion)
*:not(.fa-spin, #backgroundLoader, .preloader) {
animation: none !important;
transition: none !important;

Expand Down
6 changes: 4 additions & 2 deletions frontend/src/ts/test/funbox/funbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,11 @@ async function setFunboxBodyClasses(): Promise<boolean> {
const currentClasses = $body?.attr("class")?.split(/\s+/) ?? [];

if (
getActiveFunboxes().some((it) => it.properties?.includes("forceAnimation"))
getActiveFunboxes().some((it) =>
it.properties?.includes("ignoreReducedMotion")
)
) {
currentClasses.push("force-animation");
currentClasses.push("ignore-reduced-motion");
}

$body.attr(
Expand Down
10 changes: 5 additions & 5 deletions packages/funbox/src/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ const list: Record<FunboxName, FunboxMetadata> = {
description: "I think I'm gonna be sick.",
canGetPb: true,
difficultyLevel: 2,
properties: ["hasCssFile", "forceAnimation"],
properties: ["hasCssFile", "ignoreReducedMotion"],
},
round_round_baby: {
name: "round_round_baby",
description:
"...right round, like a record baby. Right, round round round.",
canGetPb: true,
difficultyLevel: 3,
properties: ["hasCssFile", "forceAnimation"],
properties: ["hasCssFile", "ignoreReducedMotion"],
},
simon_says: {
name: "simon_says",
Expand Down Expand Up @@ -77,7 +77,7 @@ const list: Record<FunboxName, FunboxMetadata> = {
"hasCssFile",
"noLigatures",
"conflictsWithSymmetricChars",
"forceAnimation",
"ignoreReducedMotion",
],
name: "choo_choo",
description: "All the letters are spinning!",
Expand Down Expand Up @@ -143,14 +143,14 @@ const list: Record<FunboxName, FunboxMetadata> = {
description: "Everybody get down! The words are shaking!",
canGetPb: true,
difficultyLevel: 1,
properties: ["hasCssFile", "noLigatures", "forceAnimation"],
properties: ["hasCssFile", "noLigatures", "ignoreReducedMotion"],
name: "earthquake",
},
space_balls: {
description: "In a galaxy far far away.",
canGetPb: true,
difficultyLevel: 0,
properties: ["hasCssFile", "forceAnimation"],
properties: ["hasCssFile", "ignoreReducedMotion"],
name: "space_balls",
},
gibberish: {
Expand Down
2 changes: 1 addition & 1 deletion packages/funbox/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export type FunboxProperty =
| "noLigatures"
| `toPush:${number}`
| "wordOrder:reverse"
| "forceAnimation";
| "ignoreReducedMotion";

export type FunboxMetadata = {
name: FunboxName;
Expand Down

0 comments on commit 9eb7324

Please sign in to comment.