Skip to content

Commit d77169a

Browse files
committed
impr: apply reduced motion to live stats
1 parent 7f8e205 commit d77169a

File tree

4 files changed

+22
-18
lines changed

4 files changed

+22
-18
lines changed

frontend/src/ts/test/live-acc.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Config from "../config";
22
import * as TestState from "../test/test-state";
33
import * as ConfigEvent from "../observables/config-event";
4+
import { applyReducedMotion } from "../utils/misc";
45

56
const textEl = document.querySelector(
67
"#liveStatsTextBottom .liveAcc"
@@ -32,14 +33,14 @@ export function show(): void {
3233
{
3334
opacity: 1,
3435
},
35-
125
36+
applyReducedMotion(125)
3637
);
3738
} else {
3839
$(textEl).stop(true, false).removeClass("hidden").css("opacity", 0).animate(
3940
{
4041
opacity: 1,
4142
},
42-
125
43+
applyReducedMotion(125)
4344
);
4445
}
4546
state = true;
@@ -53,7 +54,7 @@ export function hide(): void {
5354
{
5455
opacity: 0,
5556
},
56-
125,
57+
applyReducedMotion(125),
5758
() => {
5859
$(textEl).addClass("hidden");
5960
}
@@ -64,7 +65,7 @@ export function hide(): void {
6465
{
6566
opacity: 0,
6667
},
67-
125,
68+
applyReducedMotion(125),
6869
() => {
6970
$(miniEl).addClass("hidden");
7071
}

frontend/src/ts/test/live-burst.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Config from "../config";
22
import * as TestState from "../test/test-state";
33
import * as ConfigEvent from "../observables/config-event";
44
import Format from "../utils/format";
5+
import { applyReducedMotion } from "../utils/misc";
56

67
const textEl = document.querySelector(
78
"#liveStatsTextBottom .liveBurst"
@@ -30,14 +31,14 @@ export function show(): void {
3031
{
3132
opacity: 1,
3233
},
33-
125
34+
applyReducedMotion(125)
3435
);
3536
} else {
3637
$(textEl).stop(true, false).removeClass("hidden").css("opacity", 0).animate(
3738
{
3839
opacity: 1,
3940
},
40-
125
41+
applyReducedMotion(125)
4142
);
4243
}
4344
state = true;
@@ -51,7 +52,7 @@ export function hide(): void {
5152
{
5253
opacity: 0,
5354
},
54-
125,
55+
applyReducedMotion(125),
5556
() => {
5657
$(textEl).addClass("hidden");
5758
}
@@ -62,7 +63,7 @@ export function hide(): void {
6263
{
6364
opacity: 0,
6465
},
65-
125,
66+
applyReducedMotion(125),
6667
() => {
6768
$(miniEl).addClass("hidden");
6869
}

frontend/src/ts/test/live-speed.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Config from "../config";
22
import * as TestState from "./test-state";
33
import * as ConfigEvent from "../observables/config-event";
44
import Format from "../utils/format";
5+
import { applyReducedMotion } from "../utils/misc";
56

67
const textElement = document.querySelector(
78
"#liveStatsTextBottom .liveSpeed"
@@ -38,7 +39,7 @@ export function show(): void {
3839
{
3940
opacity: 1,
4041
},
41-
125
42+
applyReducedMotion(125)
4243
);
4344
} else {
4445
$(textElement)
@@ -49,7 +50,7 @@ export function show(): void {
4950
{
5051
opacity: 1,
5152
},
52-
125
53+
applyReducedMotion(125)
5354
);
5455
}
5556
state = true;
@@ -63,7 +64,7 @@ export function hide(): void {
6364
{
6465
opacity: 0,
6566
},
66-
125,
67+
applyReducedMotion(125),
6768
() => {
6869
textElement.classList.add("hidden");
6970
}
@@ -74,7 +75,7 @@ export function hide(): void {
7475
{
7576
opacity: 0,
7677
},
77-
125,
78+
applyReducedMotion(125),
7879
() => {
7980
miniElement.classList.add("hidden");
8081
}

frontend/src/ts/test/timer-progress.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as Time from "../states/time";
77
import * as SlowTimer from "../states/slow-timer";
88
import * as TestState from "./test-state";
99
import * as ConfigEvent from "../observables/config-event";
10+
import { applyReducedMotion } from "../utils/misc";
1011

1112
const barEl = $("#barTimerProgress .bar");
1213
const barOpacityEl = $("#barTimerProgress .opacityWrapper");
@@ -23,21 +24,21 @@ export function show(): void {
2324
{
2425
opacity: 1,
2526
},
26-
125
27+
applyReducedMotion(125)
2728
);
2829
} else if (Config.timerStyle === "text") {
2930
textEl.stop(true, true).removeClass("hidden").css("opacity", 0).animate(
3031
{
3132
opacity: 1,
3233
},
33-
125
34+
applyReducedMotion(125)
3435
);
3536
} else if (Config.mode === "zen" || Config.timerStyle === "mini") {
3637
miniEl.stop(true, true).removeClass("hidden").css("opacity", 0).animate(
3738
{
3839
opacity: 1,
3940
},
40-
125
41+
applyReducedMotion(125)
4142
);
4243
}
4344
}
@@ -65,13 +66,13 @@ export function hide(): void {
6566
{
6667
opacity: 0,
6768
},
68-
125
69+
applyReducedMotion(125)
6970
);
7071
miniEl.stop(true, true).animate(
7172
{
7273
opacity: 0,
7374
},
74-
125,
75+
applyReducedMotion(125),
7576
() => {
7677
miniEl.addClass("hidden");
7778
}
@@ -80,7 +81,7 @@ export function hide(): void {
8081
{
8182
opacity: 0,
8283
},
83-
125
84+
applyReducedMotion(125)
8485
);
8586
}
8687

0 commit comments

Comments
 (0)