mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-29 10:17:30 +08:00
added an indicator of corrected extra chars
This commit is contained in:
parent
50225c00d7
commit
0ac06f3ffc
2 changed files with 24 additions and 5 deletions
|
|
@ -1331,6 +1331,10 @@ key {
|
|||
color: var(--sub-color);
|
||||
border-bottom: 2px dotted var(--sub-color);
|
||||
}
|
||||
|
||||
& letter.extraCorrected {
|
||||
border-right: 2px dotted var(--sub-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1345,6 +1349,10 @@ key {
|
|||
border-bottom: 2px dotted var(--main-color);
|
||||
}
|
||||
|
||||
& letter.extraCorrected {
|
||||
border-right: 2px dotted var(--main-color);
|
||||
}
|
||||
|
||||
& letter.incorrect {
|
||||
color: var(--colorful-error-color);
|
||||
}
|
||||
|
|
@ -1368,6 +1376,10 @@ key {
|
|||
border-bottom: 2px dotted var(--sub-color);
|
||||
}
|
||||
|
||||
& letter.extraCorrected {
|
||||
border-right: 2px dotted var(--sub-color);
|
||||
}
|
||||
|
||||
& letter.incorrect {
|
||||
color: var(--colorful-error-color);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1892,7 +1892,7 @@ function showResult(difficultyFailed = false) {
|
|||
|
||||
function startTest() {
|
||||
if (!dbConfigLoaded) {
|
||||
console.log('config changed before db loaded!');
|
||||
console.log("config changed before db loaded!");
|
||||
configChangedBeforeDb = true;
|
||||
}
|
||||
try {
|
||||
|
|
@ -2562,21 +2562,28 @@ async function loadWordsHistory() {
|
|||
} catch (e) {
|
||||
correctedChar = undefined;
|
||||
}
|
||||
let extraCorrected = "";
|
||||
if (c + 1 === loop && correctedHistory[index].length > input.length) {
|
||||
extraCorrected = "extraCorrected";
|
||||
}
|
||||
if (wordsList[index][c] !== undefined) {
|
||||
if (input[c] === wordsList[index][c]) {
|
||||
if (correctedChar === input[c] || correctedChar === undefined) {
|
||||
wordEl +=
|
||||
'<letter class="correct">' + wordsList[index][c] + "</letter>";
|
||||
wordEl += `<letter class="correct ${extraCorrected}">${wordsList[index][c]}</letter>`;
|
||||
} else {
|
||||
wordEl +=
|
||||
'<letter class="corrected">' + wordsList[index][c] + "</letter>";
|
||||
`<letter class="corrected ${extraCorrected}">` +
|
||||
wordsList[index][c] +
|
||||
"</letter>";
|
||||
}
|
||||
} else {
|
||||
if (input[c] === currentInput || input[c] === undefined) {
|
||||
wordEl += "<letter>" + wordsList[index][c] + "</letter>";
|
||||
} else {
|
||||
wordEl +=
|
||||
'<letter class="incorrect">' + wordsList[index][c] + "</letter>";
|
||||
`<letter class="incorrect ${extraCorrected}">` +
|
||||
wordsList[index][c] +
|
||||
"</letter>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue