mini timer style fixes

This commit is contained in:
Jack 2020-08-26 22:24:05 +01:00
parent b55f9ea969
commit eeea57336d
2 changed files with 25 additions and 16 deletions

View file

@ -976,7 +976,7 @@
<div id="wordsTitle">input history</div>
<div id="timerNumber">60</div>
<div id="miniTimerAndLiveWpm">
<div class="time">1:00</div>
<div class="time hidden">1:00</div>
<div class="wpm">60</div>
</div>
<div id="wordsWrapper">

View file

@ -859,15 +859,17 @@ function showTimer() {
250
);
} else if (config.timerStyle === "mini") {
$("#miniTimerAndLiveWpm .time")
.stop(true, true)
.removeClass("hidden")
.animate(
{
opacity: op,
},
250
);
if (op > 0) {
$("#miniTimerAndLiveWpm .time")
.stop(true, true)
.removeClass("hidden")
.animate(
{
opacity: op,
},
250
);
}
}
}
@ -878,12 +880,17 @@ function hideTimer() {
},
125
);
$("#miniTimerAndLiveWpm .time").stop(true, true).animate(
{
opacity: 0,
},
125
);
$("#miniTimerAndLiveWpm .time")
.stop(true, true)
.animate(
{
opacity: 0,
},
125,
() => {
$("#miniTimerAndLiveWpm .time").addClass("hidden");
}
);
$("#timerNumber").stop(true, true).animate(
{
opacity: 0,
@ -2333,6 +2340,8 @@ function restartTest(withSameWordset = false) {
} else {
hideKeymap();
}
document.querySelector("#miniTimerAndLiveWpm .wpm").innerHTML = "0";
document.querySelector("#liveWpm").innerHTML = "0";
if (activeFunBox === "layoutfluid") {
changeLayout("qwerty");