From a848b11548e8ae7793de265fe5be322f13a64aa3 Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 19 May 2020 10:45:35 +0100 Subject: [PATCH] - fixed a bug where on higher font sizes the words would get cut off - removed wpm limit --- public/js/script.js | 5 +++-- public/js/userconfig.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/js/script.js b/public/js/script.js index 7ca926910..cbd6e2f7f 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -207,7 +207,6 @@ function showWords() { $("#words").append(w); } } else if (config.mode == "time") { - $("#words").css("height", "78px").css("overflow", "hidden"); for (let i = 0; i < wordsList.length; i++) { let w = "
"; for (let c = 0; c < wordsList[i].length; c++) { @@ -216,6 +215,8 @@ function showWords() { w += "
"; $("#words").append(w); } + const wordHeight = $($(".word")[0]).outerHeight(); + $("#words").css("height", wordHeight * 3 + 'px').css("overflow", "hidden"); } updateActiveElement(); updateCaretPosition(); @@ -460,7 +461,7 @@ function showResult() { }; console.log(restartCount); restartCount = 0; - if (stats.wpm > 0 && stats.wpm < 250 && stats.acc > 50 && stats.acc <= 100) { + if (stats.wpm > 0 && stats.wpm < 600 && stats.acc > 50 && stats.acc <= 100) { if (firebase.auth().currentUser != null) { db_getUserHighestWpm(config.mode, mode2).then(data => { // console.log(`highest wpm for this mode is ${data}, current is ${stats.wpm}`); diff --git a/public/js/userconfig.js b/public/js/userconfig.js index 9e912ab27..8857f5843 100644 --- a/public/js/userconfig.js +++ b/public/js/userconfig.js @@ -187,6 +187,6 @@ function changeFontSize(fontSize) { $("#words").addClass('size2'); $("#caret").addClass('size2'); } - updateCaretPosition(); saveConfigToCookie(); + restartTest(); } \ No newline at end of file