mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-19 20:16:04 +08:00
text timer/progress now works in words mode
This commit is contained in:
parent
d8eeaf6c81
commit
26b5a6c433
1 changed files with 22 additions and 12 deletions
|
@ -760,20 +760,30 @@ function updateTimer() {
|
|||
// $("#timerNumber").html(config.time - time);
|
||||
}
|
||||
} else if (
|
||||
(config.mode === "words" ||
|
||||
config.mode === "custom" ||
|
||||
config.mode === "quote") &&
|
||||
config.timerStyle === "bar"
|
||||
config.mode === "words" ||
|
||||
config.mode === "custom" ||
|
||||
config.mode === "quote"
|
||||
) {
|
||||
let percent = Math.floor(((currentWordIndex + 1) / wordsList.length) * 100);
|
||||
$("#timer")
|
||||
.stop(true, true)
|
||||
.animate(
|
||||
{
|
||||
width: percent + "vw",
|
||||
},
|
||||
250
|
||||
if (config.timerStyle === "bar") {
|
||||
let percent = Math.floor(
|
||||
((currentWordIndex + 1) / wordsList.length) * 100
|
||||
);
|
||||
$("#timer")
|
||||
.stop(true, true)
|
||||
.animate(
|
||||
{
|
||||
width: percent + "vw",
|
||||
},
|
||||
250
|
||||
);
|
||||
} else if (config.timerStyle === "text") {
|
||||
let outof = wordsList.length;
|
||||
if (config.mode === "words") {
|
||||
outof = config.words;
|
||||
}
|
||||
$("#timerNumber").html(`${inputHistory.length}/${outof}`);
|
||||
// $("#timerNumber").html(config.time - time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue