added the ability to see how many seconds were afk after the test

This commit is contained in:
Jack 2020-08-02 22:07:45 +01:00
parent d8dab10085
commit fccb59a51d
2 changed files with 5 additions and 1 deletions

View file

@ -717,7 +717,7 @@
</div>
<div class="group time">
<div class="top">time</div>
<div class="bottom">-</div>
<div class="bottom" aria-label="" data-balloon-pos="up">-</div>
</div>
<!-- </div> -->

View file

@ -1382,7 +1382,11 @@ function showResult(difficultyFailed = false) {
$("#result .stats .key .bottom").text(
stats.correctChars + stats.correctSpaces + "/" + stats.incorrectChars
);
let afkseconds = keypressPerSecond.filter((x) => x == 0).length;
$("#result .stats .time .bottom").text(testtime + "s");
$("#result .stats .time .bottom").attr("aria-label", `${afkseconds}s afk`);
setTimeout(function () {
$("#resultExtraButtons").removeClass("hidden").css("opacity", 0).animate(