Skip to content

Commit b9ec572

Browse files
committed
use actual seconds remaining in test to dictate what textEl shows
as opposed to displayTime which could be in m:ss format and therefore will not play nicely with parseInt
1 parent 9b91a94 commit b9ec572

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ export function show(): void {
3636
textEl.classList.remove("hidden");
3737
},
3838
});
39+
} else if (Config.timerStyle === "flash") {
40+
animate(textEl, {
41+
opacity: [0, 1],
42+
duration: applyReducedMotion(125),
43+
onBegin: () => {
44+
textEl.classList.remove("hidden");
45+
},
46+
});
3947
} else if (Config.mode === "zen" || Config.timerStyle === "mini") {
4048
animate(miniEl, {
4149
opacity: [0, 1],
@@ -132,7 +140,7 @@ export function update(): void {
132140
if (textEl !== null) {
133141
textEl.innerHTML =
134142
"<div>" +
135-
`${parseInt(displayTime) % 15 !== 0 ? "" : displayTime}` +
143+
`${(maxtime - time) % 15 !== 0 ? "" : displayTime}` +
136144
"</div>";
137145
}
138146
} else if (Config.timerStyle === "mini") {

0 commit comments

Comments
 (0)