Skip to content

Commit 16edddd

Browse files
committed
- fixed a bug where on higher font sizes the words would get cut off
- removed wpm limit
1 parent 9114b8b commit 16edddd

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

public/js/script.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ function showWords() {
207207
$("#words").append(w);
208208
}
209209
} else if (config.mode == "time") {
210-
$("#words").css("height", "78px").css("overflow", "hidden");
211210
for (let i = 0; i < wordsList.length; i++) {
212211
let w = "<div class='word'>";
213212
for (let c = 0; c < wordsList[i].length; c++) {
@@ -216,6 +215,8 @@ function showWords() {
216215
w += "</div>";
217216
$("#words").append(w);
218217
}
218+
const wordHeight = $($(".word")[0]).outerHeight();
219+
$("#words").css("height", wordHeight * 3 + 'px').css("overflow", "hidden");
219220
}
220221
updateActiveElement();
221222
updateCaretPosition();
@@ -460,7 +461,7 @@ function showResult() {
460461
};
461462
console.log(restartCount);
462463
restartCount = 0;
463-
if (stats.wpm > 0 && stats.wpm < 250 && stats.acc > 50 && stats.acc <= 100) {
464+
if (stats.wpm > 0 && stats.wpm < 600 && stats.acc > 50 && stats.acc <= 100) {
464465
if (firebase.auth().currentUser != null) {
465466
db_getUserHighestWpm(config.mode, mode2).then(data => {
466467
// console.log(`highest wpm for this mode is ${data}, current is ${stats.wpm}`);

public/js/userconfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,6 @@ function changeFontSize(fontSize) {
187187
$("#words").addClass('size2');
188188
$("#caret").addClass('size2');
189189
}
190-
updateCaretPosition();
191190
saveConfigToCookie();
191+
restartTest();
192192
}

0 commit comments

Comments
 (0)