mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-01 19:17:00 +08:00
fixed layout fluid issies
This commit is contained in:
parent
4fb9d2e1cd
commit
7ac5940cf5
1 changed files with 15 additions and 7 deletions
|
@ -1918,14 +1918,10 @@ function startTest() {
|
|||
wpmHistory.push(wpmAndRaw.wpm);
|
||||
rawHistory.push(wpmAndRaw.raw);
|
||||
|
||||
if (activeFunBox === "layoutfluid") {
|
||||
if (activeFunBox === "layoutfluid" && config.mode === "time") {
|
||||
const layouts = ["qwerty", "dvorak", "colemak"];
|
||||
let index = 0;
|
||||
if (config.mode === "time") {
|
||||
index = Math.floor(time / (config.time / 3));
|
||||
} else if (config.mode === "words") {
|
||||
index = Math.floor(inputHistory.length / (outof / 3));
|
||||
}
|
||||
index = Math.floor(time / (config.time / 3));
|
||||
if (config.layout !== layouts[index] && layouts[index] !== undefined) {
|
||||
showNotification(`--- !!! ${layouts[index]} !!! ---`, 3000);
|
||||
}
|
||||
|
@ -3404,7 +3400,19 @@ $(document).keydown((event) => {
|
|||
currentTestLine++;
|
||||
}
|
||||
}
|
||||
// }
|
||||
if (activeFunBox === "layoutfluid" && config.mode !== "time") {
|
||||
const layouts = ["qwerty", "dvorak", "colemak"];
|
||||
let index = 0;
|
||||
let outof = wordsList.length;
|
||||
index = Math.floor((inputHistory.length + 1) / (outof / 3));
|
||||
if (config.layout !== layouts[index] && layouts[index] !== undefined) {
|
||||
showNotification(`--- !!! ${layouts[index]} !!! ---`, 3000);
|
||||
}
|
||||
changeLayout(layouts[index]);
|
||||
changeKeymapLayout(layouts[index]);
|
||||
updateHighlightedKeymapKey();
|
||||
settingsGroups.layout.updateButton();
|
||||
}
|
||||
if (config.blindMode) $("#words .word.active letter").addClass("correct");
|
||||
// document
|
||||
// .querySelector("#words .word.active")
|
||||
|
|
Loading…
Add table
Reference in a new issue