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 952387274..860894fdb 100644 --- a/public/funbox/list.json +++ b/public/funbox/list.json @@ -26,8 +26,13 @@ "name": "rAnDoMcAsE", "type": "script" }, + { + + "name": "layoutfluid", + "type": "script" + }, { "name": "earthquake", "type": "style" } -] \ No newline at end of file +] diff --git a/public/js/script.js b/public/js/script.js index 0ce67461a..c64e0825b 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; } @@ -2019,6 +2028,23 @@ function startTest() { wpmHistory.push(wpmAndRaw.wpm); rawHistory.push(wpmAndRaw.raw); + if (activeFunBox === "layoutfluid") { + 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)); + } + if (config.layout !== layouts[index]) { + showNotification(`--- !!! ${layouts[index]} !!! ---`, 3000); + } + changeLayout(layouts[index]); + changeKeymapLayout(layouts[index]); + updateHighlightedKeymapKey(); + setActiveLayoutButton(); + } + // console.timeEnd("livewpm"); keypressPerSecond.push(currentKeypressCount); currentKeypressCount = 0; @@ -2154,6 +2180,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,