fix(bar timer progress): not animating for the first second of the test

This commit is contained in:
Miodec 2024-05-06 14:04:42 +02:00
parent c1e4fb3722
commit 7fd31dcc72
2 changed files with 15 additions and 8 deletions

View file

@ -17,7 +17,9 @@
<div class="history"></div>
</div>
<div id="barTimerProgress" class="timerMain">
<div class="bar" style="opacity: 0"></div>
<div class="opacityWrapper" style="opacity: 0">
<div class="bar"></div>
</div>
</div>
<div id="popups">
<load src="html/popups.html" />

View file

@ -9,17 +9,22 @@ import * as TestState from "./test-state";
import * as ConfigEvent from "../observables/config-event";
const barEl = $("#barTimerProgress .bar");
const barOpacityEl = $("#barTimerProgress .opacityWrapper");
const textEl = $("#liveStatsTextTop .timerProgress");
const miniEl = $("#liveStatsMini .time");
export function show(): void {
if (Config.mode !== "zen" && Config.timerStyle === "bar") {
barEl.stop(true, true).removeClass("hidden").css("opacity", 0).animate(
{
opacity: 1,
},
125
);
barOpacityEl
.stop(true, true)
.removeClass("hidden")
.css("opacity", 0)
.animate(
{
opacity: 1,
},
125
);
} else if (Config.timerStyle === "text") {
textEl.stop(true, true).removeClass("hidden").css("opacity", 0).animate(
{
@ -56,7 +61,7 @@ export function reset(): void {
}
export function hide(): void {
barEl.stop(true, true).animate(
barOpacityEl.stop(true, true).animate(
{
opacity: 0,
},