diff --git a/README.md b/README.md index 11b6cfc9d..d31d20892 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ On the [monkeytype Discord server](https://www.discord.gg/monkeytype), we added # Bug report or Feature request -If you encounter a bug, or have a feature request - [send me a message on Reddit](https://reddit.com/user/miodec), [create an issue](https://github.com/Miodec/monkeytype/issues), [create a discussion thread](https://github.com/Miodec/monkeytype/discussions), or [join the Discord server](https://www.discord.gg/monkeytype). +If you encounter a bug, or have a feature request [send me a message on Reddit](https://reddit.com/user/miodec), [create an issue](https://github.com/Miodec/monkeytype/issues), [create a discussion thread](https://github.com/Miodec/monkeytype/discussions), or [join the Discord server](https://www.discord.gg/monkeytype). # Contribute diff --git a/package-lock.json b/package-lock.json index 6bc340798..c9f712b97 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "chart.js": "^2.9.4", "chartjs-plugin-annotation": "^0.5.7", "chartjs-plugin-trendline": "^0.2.2", + "howler": "^2.2.1", "tinycolor2": "^1.4.2" }, "devDependencies": { @@ -2300,6 +2301,7 @@ "dependencies": { "anymatch": "~3.1.1", "braces": "~3.0.2", + "fsevents": "~2.3.1", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", @@ -4737,6 +4739,7 @@ "anymatch": "^2.0.0", "async-each": "^1.0.1", "braces": "^2.3.2", + "fsevents": "^1.2.7", "glob-parent": "^3.1.0", "inherits": "^2.0.3", "is-binary-path": "^1.0.0", @@ -5496,6 +5499,11 @@ "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, + "node_modules/howler": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/howler/-/howler-2.2.1.tgz", + "integrity": "sha512-0iIXvuBO/81CcrQ/HSSweYmbT50fT2mIc9XMFb+kxIfk2pW/iKzDbX1n3fZmDXMEIpYvyyfrB+gXwPYSDqUxIQ==" + }, "node_modules/htmlescape": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", @@ -15703,6 +15711,11 @@ "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, + "howler": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/howler/-/howler-2.2.1.tgz", + "integrity": "sha512-0iIXvuBO/81CcrQ/HSSweYmbT50fT2mIc9XMFb+kxIfk2pW/iKzDbX1n3fZmDXMEIpYvyyfrB+gXwPYSDqUxIQ==" + }, "htmlescape": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", diff --git a/package.json b/package.json index fd508ca7d..e4c66bfc2 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "chart.js": "^2.9.4", "chartjs-plugin-annotation": "^0.5.7", "chartjs-plugin-trendline": "^0.2.2", + "howler": "^2.2.1", "tinycolor2": "^1.4.2" } } diff --git a/src/js/layouts.js b/src/js/layouts.js index 7cbfb3144..2e20db897 100644 --- a/src/js/layouts.js +++ b/src/js/layouts.js @@ -235,6 +235,16 @@ const layouts = { " " ] }, + handsdown: { + keymapShowTopRow: false, + keys: [ + "`~", "1!", "2@", "3#", "4$", "5%", "6^", "7&", "8*", "9(", "0)", "-_", "=+", + "qQ", "cC", "hH", "pP", "vV", "kK", "yY", "oO", "jJ", "/?", "[{", "]}", "\\|", + "rR", "sS", "nN", "tT", "gG", "wW", "uU", "eE", "iI", "aA", ";:", + "\\|", "xX", "mM", "lL", "dD", "bB", "zZ", "fF", "'\"", ",<", ".>", + " " + ] + }, handsdown_alt: { keymapShowTopRow: false, keys: [ diff --git a/src/js/replay.js b/src/js/replay.js index cc7de1b47..f0d07fe22 100644 --- a/src/js/replay.js +++ b/src/js/replay.js @@ -132,6 +132,8 @@ function loadOldReplay() { startingIndex = i + 1; } }); + const time = Math.floor(replayData[startingIndex].time / 1000); + $("#replayStopwatch").text(time + "s"); return startingIndex; } @@ -170,6 +172,7 @@ function startReplayRecording() { //hide replay display if user left it open toggleReplayDisplay(); } + $("#replayStopwatch").text(0 + "s"); replayData = []; replayStartTime = performance.now(); replayRecording = true; diff --git a/src/js/sound.js b/src/js/sound.js index 1f43d4f80..d1b2115bb 100644 --- a/src/js/sound.js +++ b/src/js/sound.js @@ -1,6 +1,7 @@ import Config from "./config"; +import {Howl, Howler} from 'howler'; -let errorSound = new Audio("../sound/error.wav"); +let errorSound = new Howl({src:["../sound/error.wav"]}); let clickSounds = null; export function init() { @@ -9,22 +10,22 @@ export function init() { 1: [ { sounds: [ - new Audio("../sound/click1/click1_1.wav"), - new Audio("../sound/click1/click1_1.wav"), + new Howl({src:"../sound/click1/click1_1.wav"}), + new Howl({src:"../sound/click1/click1_1.wav"}), ], counter: 0, }, { sounds: [ - new Audio("../sound/click1/click1_2.wav"), - new Audio("../sound/click1/click1_2.wav"), + new Howl({src:"../sound/click1/click1_2.wav"}), + new Howl({src:"../sound/click1/click1_2.wav"}), ], counter: 0, }, { sounds: [ - new Audio("../sound/click1/click1_3.wav"), - new Audio("../sound/click1/click1_3.wav"), + new Howl({src:"../sound/click1/click1_3.wav"}), + new Howl({src:"../sound/click1/click1_3.wav"}), ], counter: 0, }, @@ -32,22 +33,22 @@ export function init() { 2: [ { sounds: [ - new Audio("../sound/click2/click2_1.wav"), - new Audio("../sound/click2/click2_1.wav"), + new Howl({src:"../sound/click2/click2_1.wav"}), + new Howl({src:"../sound/click2/click2_1.wav"}), ], counter: 0, }, { sounds: [ - new Audio("../sound/click2/click2_2.wav"), - new Audio("../sound/click2/click2_2.wav"), + new Howl({src:"../sound/click2/click2_2.wav"}), + new Howl({src:"../sound/click2/click2_2.wav"}), ], counter: 0, }, { sounds: [ - new Audio("../sound/click2/click2_3.wav"), - new Audio("../sound/click2/click2_3.wav"), + new Howl({src:"../sound/click2/click2_3.wav"}), + new Howl({src:"../sound/click2/click2_3.wav"}), ], counter: 0, }, @@ -55,22 +56,22 @@ export function init() { 3: [ { sounds: [ - new Audio("../sound/click3/click3_1.wav"), - new Audio("../sound/click3/click3_1.wav"), + new Howl({src:"../sound/click3/click3_1.wav"}), + new Howl({src:"../sound/click3/click3_1.wav"}), ], counter: 0, }, { sounds: [ - new Audio("../sound/click3/click3_2.wav"), - new Audio("../sound/click3/click3_2.wav"), + new Howl({src:"../sound/click3/click3_2.wav"}), + new Howl({src:"../sound/click3/click3_2.wav"}), ], counter: 0, }, { sounds: [ - new Audio("../sound/click3/click3_3.wav"), - new Audio("../sound/click3/click3_3.wav"), + new Howl({src:"../sound/click3/click3_3.wav"}), + new Howl({src:"../sound/click3/click3_3.wav"}), ], counter: 0, }, @@ -78,43 +79,43 @@ export function init() { 4: [ { sounds: [ - new Audio("../sound/click4/click4_1.wav"), - new Audio("../sound/click4/click4_11.wav"), + new Howl({src:"../sound/click4/click4_1.wav"}), + new Howl({src:"../sound/click4/click4_11.wav"}), ], counter: 0, }, { sounds: [ - new Audio("../sound/click4/click4_2.wav"), - new Audio("../sound/click4/click4_22.wav"), + new Howl({src:"../sound/click4/click4_2.wav"}), + new Howl({src:"../sound/click4/click4_22.wav"}), ], counter: 0, }, { sounds: [ - new Audio("../sound/click4/click4_3.wav"), - new Audio("../sound/click4/click4_33.wav"), + new Howl({src:"../sound/click4/click4_3.wav"}), + new Howl({src:"../sound/click4/click4_33.wav"}), ], counter: 0, }, { sounds: [ - new Audio("../sound/click4/click4_4.wav"), - new Audio("../sound/click4/click4_44.wav"), + new Howl({src:"../sound/click4/click4_4.wav"}), + new Howl({src:"../sound/click4/click4_44.wav"}), ], counter: 0, }, { sounds: [ - new Audio("../sound/click4/click4_5.wav"), - new Audio("../sound/click4/click4_55.wav"), + new Howl({src:"../sound/click4/click4_5.wav"}), + new Howl({src:"../sound/click4/click4_55.wav"}), ], counter: 0, }, { sounds: [ - new Audio("../sound/click4/click4_6.wav"), - new Audio("../sound/click4/click4_66.wav"), + new Howl({src:"../sound/click4/click4_6.wav"}), + new Howl({src:"../sound/click4/click4_66.wav"}), ], counter: 0, }, @@ -132,12 +133,12 @@ export function playClick() { let randomSound = clickSounds[Config.playSoundOnClick][rand]; randomSound.counter++; if (randomSound.counter === 2) randomSound.counter = 0; - randomSound.sounds[randomSound.counter].currentTime = 0; + randomSound.sounds[randomSound.counter].seek(0); randomSound.sounds[randomSound.counter].play(); } export function playError() { if (!Config.playSoundOnError) return; - errorSound.currentTime = 0; + errorSound.seek(0); errorSound.play(); } diff --git a/src/js/test/test-ui.js b/src/js/test/test-ui.js index 0f0a80bb2..ff32aa26e 100644 --- a/src/js/test/test-ui.js +++ b/src/js/test/test-ui.js @@ -185,6 +185,7 @@ export function colorful(tc) { } export function screenshot() { + let revealReplay = false; function revertScreenshot() { $("#notificationCenter").removeClass("hidden"); $("#commandLineMobileButton").removeClass("hidden"); @@ -194,8 +195,8 @@ export function screenshot() { if (firebase.auth().currentUser == null) $(".pageTest .loginTip").removeClass("hidden"); } - let revealReplay = false; - if (!$("#resultReplay").hasClass("hidden")) { + + if (!$("#resultReplay").hasClass('hidden')) { revealReplay = true; Replay.pauseReplay(); } diff --git a/static/index.html b/static/index.html index 098d49761..e2767f127 100644 --- a/static/index.html +++ b/static/index.html @@ -3748,12 +3748,12 @@
- Sign In + Sign in with email
or
- Google Sign In + Sign in with Google
diff --git a/static/themes/_list.json b/static/themes/_list.json index b59e46007..ca1b3c69c 100644 --- a/static/themes/_list.json +++ b/static/themes/_list.json @@ -543,5 +543,15 @@ "name": "midnight", "bgColor": "#0c0e12", "textColor": "#525f7a" + }, + { + "name": "blueberry_light", + "bgColor": "#dae0f5", + "textColor": "#df4576" + }, + { + "name": "blueberry_dark", + "bgColor": "#212b42", + "textColor": "#df4576" } ] diff --git a/static/themes/blueberry_dark.css b/static/themes/blueberry_dark.css new file mode 100644 index 000000000..001ae8e0f --- /dev/null +++ b/static/themes/blueberry_dark.css @@ -0,0 +1,15 @@ +:root { + --bg-color: #212b42; + --main-color: #add7ff; + --caret-color: #962f7e; + --sub-color: #5c7da5; + --text-color: #91b4d5; + --error-color: #df4576; + --error-extra-color: #d996ac; + --colorful-error-color: #df4576; + --colorful-error-extra-color: #d996ac; +} + +#top .logo .bottom { + color: #962f7e; +} diff --git a/static/themes/blueberry_light.css b/static/themes/blueberry_light.css new file mode 100644 index 000000000..4ebe7b500 --- /dev/null +++ b/static/themes/blueberry_light.css @@ -0,0 +1,15 @@ +:root { + --bg-color: #dae0f5; + --main-color: #506477; + --caret-color: #df4576; + --sub-color: #92a4be; + --text-color: #678198; + --error-color: #df4576; + --error-extra-color: #d996ac; + --colorful-error-color: #df4576; + --colorful-error-extra-color: #d996ac; +} + +#top .logo .bottom { + color: #df4576; +}