mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-28 17:56:09 +08:00
fix(bar timer progress): not animating for the first second of the test
This commit is contained in:
parent
c1e4fb3722
commit
7fd31dcc72
2 changed files with 15 additions and 8 deletions
|
|
@ -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" />
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue