diff --git a/public/css/style.scss b/public/css/style.scss index 94ccf01f0..48cf7b4c2 100644 --- a/public/css/style.scss +++ b/public/css/style.scss @@ -1518,6 +1518,16 @@ key { user-select: none; padding-bottom: 1em; + letter{ + border-bottom-style: solid; + border-bottom-width: .05em; + border-bottom-color: transparent; + &.dead{ + border-bottom-width: .05em; + border-bottom-color: var(--sub-color); + } + } + /* a little hack for right-to-left languages */ &.rightToLeftTest { flex-direction: row-reverse; @@ -1540,6 +1550,10 @@ key { .word { color: var(--text-color); + & letter.dead{ + border-bottom-color: var(--sub-color) !important; + } + & letter.correct { color: var(--sub-color); } @@ -1557,6 +1571,11 @@ key { &.colorfulMode { .word { + + & letter.dead{ + border-bottom-color: var(--main-color) !important; + } + & letter.correct { color: var(--main-color); } @@ -1584,6 +1603,10 @@ key { .word { color: var(--main-color); + & letter.dead{ + border-bottom-color: var(--sub-color) !important; + } + & letter.correct { color: var(--sub-color); } diff --git a/public/js/script.js b/public/js/script.js index f1ddc77ec..14fdf8957 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -1362,7 +1362,7 @@ function flashPressedKeymapKey(key, correct) { } try { - if (correct) { + if (correct || config.blindMode) { $(key) .stop(true, true) .css({ @@ -1622,7 +1622,7 @@ function countChars() { } function calculateStats() { - let testSeconds = roundTo2((testEnd - testStart) / 1000); + let testSeconds = (testEnd - testStart) / 1000; // if (config.mode == "words" && config.difficulty == "normal") { // if (inputHistory.length != wordsList.length) return; @@ -3460,6 +3460,15 @@ function updateTestModesNotice() { ); } + if (config.language === "english_1k" || config.language === "english_10k") { + $(".pageTest #testModesNotice").append( + `
${config.language.replace( + "_", + " " + )}
` + ); + } + if (config.difficulty === "expert") { $(".pageTest #testModesNotice").append( `
expert
` @@ -4517,7 +4526,6 @@ $(document).keydown(function (event) { "Meta", "Alt", "AltGraph", - "Dead", "CapsLock", "Backspace", "Enter", @@ -4528,6 +4536,19 @@ $(document).keydown(function (event) { "ArrowLeft", "ArrowRight", "ArrowDown", + "OS", + "Insert", + "Home", + "Undefined", + "Control", + "Fn", + "FnLock", + "Hyper", + "NumLock", + "ScrollLock", + "Symbol", + "SymbolLock", + "Super", undefined, ].includes(event.key) ) @@ -4542,6 +4563,17 @@ $(document).keydown(function (event) { } else { if (!testActive) return; } + + if (event.key === "Dead") { + playClickSound(); + $( + document.querySelector("#words .word.active").querySelectorAll("letter")[ + currentInput.length + ] + ).toggleClass("dead"); + return; + } + let thisCharCorrect; let nextCharInWord = wordsList[currentWordIndex].substring( @@ -4642,6 +4674,13 @@ $(document).keydown(function (event) { } else { activeWordJumped = false; } + + if (activeWordJumped) { + currentInput = currentInput.slice(0, -1); + compareInput(!config.blindMode); + activeWordJumped = false; + } + // console.timeEnd("offcheck2"); if (config.keymapMode === "react") {