diff --git a/.firebaserc_example b/.firebaserc_example deleted file mode 100644 index b254e4c1f..000000000 --- a/.firebaserc_example +++ /dev/null @@ -1,5 +0,0 @@ -{ - "projects": { - "default": "project-id" - } -} diff --git a/public/css/style.scss b/public/css/style.scss index 21b2428a4..ccb6f15e9 100644 --- a/public/css/style.scss +++ b/public/css/style.scss @@ -2369,4 +2369,4 @@ key { .r5 { display: grid; grid-template-columns: 4fr 7.5fr 4fr; -} \ No newline at end of file +} diff --git a/public/funbox/list.json b/public/funbox/list.json index 3e99d5758..ab749e3af 100644 --- a/public/funbox/list.json +++ b/public/funbox/list.json @@ -25,5 +25,9 @@ { "name": "rAnDoMcAsE", "type": "script" + }, + { + "name": "layoutfluid", + "type": "script" } -] \ No newline at end of file +] diff --git a/public/js/script.js b/public/js/script.js index 0ce67461a..c003489fe 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -239,6 +239,15 @@ function activateFunbox(funbox, mode) { config.keymapMode = "off"; setActiveKeymapModeButton(); restartTest(); + } else if (funbox === "layoutfluid") { + config.keymapMode = "on"; + changeKeymapMode("next"); + setActiveKeymapModeButton(); + changeLayout("qwerty"); + setActiveLayoutButton(); + changeKeymapLayout("qwerty"); + setActiveKeymapLayoutButton(); + restartTest(); } activeFunBox = funbox; } @@ -954,6 +963,16 @@ function updateTimer() { } $("#timerNumber").html(displayTime); // $("#timerNumber").html(config.time - time); + + if (activeFunBox === "layoutfluid") { + const layouts = ["qwerty", "dvorak", "colemak"]; + let index = Math.floor(time / (config.time / 3)); + changeLayout(layouts[index]); + changeKeymapLayout(layouts[index]); + updateHighlightedKeymapKey(); + setActiveLayoutButton(); + } + } } else if ( config.mode === "words" || @@ -993,8 +1012,19 @@ function updateTimer() { outof = customText.length; } } + $("#timerNumber").html(`${inputHistory.length}/${outof}`); // $("#timerNumber").html(config.time - time); + + if (activeFunBox === "layoutfluid") { + const layouts = ["qwerty", "dvorak", "colemak"]; + let index = Math.floor(inputHistory.length / (outof / 3)); + changeLayout(layouts[index]); + changeKeymapLayout(layouts[index]); + updateHighlightedKeymapKey(); + setActiveLayoutButton(); + } + } } } @@ -2154,6 +2184,15 @@ function restartTest(withSameWordset = false) { if (config.keymapMode !== "off") { showKeymap(); } + + if(activeFunBox === "layoutfluid") { + changeLayout("qwerty"); + setActiveLayoutButton(); + changeKeymapLayout("qwerty"); + setActiveKeymapLayoutButton(); + updateHighlightedKeymapKey(); + } + $("#result").addClass("hidden"); $("#testModesNotice").removeClass("hidden").css({ opacity: 1, @@ -3448,6 +3487,7 @@ $(document).keydown((event) => { } } currentWordElementIndex -= toHide.length; + if (config.smoothLineScroll) { let word = $(document.querySelector(".word")); $("#words").prepend(