From 5f33661387280b26dac36bc085edb069f6e96ec6 Mon Sep 17 00:00:00 2001 From: Raymon Zhang Date: Mon, 10 May 2021 19:20:53 -0700 Subject: [PATCH 01/15] Created blueberry light and dark theme --- static/themes/blueberry_dark.css | 11 +++++++++++ static/themes/blueberry_light.css | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 static/themes/blueberry_dark.css create mode 100644 static/themes/blueberry_light.css diff --git a/static/themes/blueberry_dark.css b/static/themes/blueberry_dark.css new file mode 100644 index 000000000..7e1c8c5c9 --- /dev/null +++ b/static/themes/blueberry_dark.css @@ -0,0 +1,11 @@ +:root { + --bg-color: #242939; + --main-color: #27e8a7; + --caret-color: #27e8a7; + --sub-color: #506477; + --text-color: #add7ff; + --error-color: #df4577; + --error-extra-color: #df4577; + --colorful-error-color: #df4577; + --colorful-error-extra-color: #df4577; +} diff --git a/static/themes/blueberry_light.css b/static/themes/blueberry_light.css new file mode 100644 index 000000000..154e9acff --- /dev/null +++ b/static/themes/blueberry_light.css @@ -0,0 +1,11 @@ +:root { + --bg-color: #c1daf3; + --main-color: #27e8a7; + --caret-color: #27e8a7; + --sub-color: #7290aa; + --text-color: #516377; + --error-color: #df4577; + --error-extra-color: #df4577; + --colorful-error-color: #df4577; + --colorful-error-extra-color: #df4577; +} From 4dec02afbda16c79a2eec712ccb923b834c09efd Mon Sep 17 00:00:00 2001 From: Raymon Zhang Date: Mon, 10 May 2021 19:24:28 -0700 Subject: [PATCH 02/15] Update themes list --- static/themes/_list.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/static/themes/_list.json b/static/themes/_list.json index b59e46007..294330ee6 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": "#c1daf3", + "textColor": "#516377" + }, + { + "name": "blueberry_dark", + "bgColor": "#242939", + "textColor": "#add7ff" } ] From 76f434bab8173d333fc84a4e8e7308bc73a31b91 Mon Sep 17 00:00:00 2001 From: Raymon Zhang Date: Tue, 11 May 2021 09:50:25 -0700 Subject: [PATCH 03/15] Changed error extra color --- static/themes/blueberry_dark.css | 6 +++--- static/themes/blueberry_light.css | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/static/themes/blueberry_dark.css b/static/themes/blueberry_dark.css index 7e1c8c5c9..9bc1a2573 100644 --- a/static/themes/blueberry_dark.css +++ b/static/themes/blueberry_dark.css @@ -5,7 +5,7 @@ --sub-color: #506477; --text-color: #add7ff; --error-color: #df4577; - --error-extra-color: #df4577; - --colorful-error-color: #df4577; - --colorful-error-extra-color: #df4577; + --error-extra-color: #d996ac; + --colorful-error-color: #d996ac; + --colorful-error-extra-color: #d996ac; } diff --git a/static/themes/blueberry_light.css b/static/themes/blueberry_light.css index 154e9acff..e11c60cf4 100644 --- a/static/themes/blueberry_light.css +++ b/static/themes/blueberry_light.css @@ -5,7 +5,7 @@ --sub-color: #7290aa; --text-color: #516377; --error-color: #df4577; - --error-extra-color: #df4577; - --colorful-error-color: #df4577; - --colorful-error-extra-color: #df4577; + --error-extra-color: #d996ac; + --colorful-error-color: #d996ac; + --colorful-error-extra-color: #d996ac; } From 158d1c70aedac8d1a1a9939f817efc55269a141e Mon Sep 17 00:00:00 2001 From: Raymon Zhang Date: Tue, 11 May 2021 10:58:53 -0700 Subject: [PATCH 04/15] Updated blueberry themes --- static/themes/_list.json | 6 +++--- static/themes/blueberry_dark.css | 20 +++++++++++++++----- static/themes/blueberry_light.css | 22 ++++++++++++++++------ 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/static/themes/_list.json b/static/themes/_list.json index 294330ee6..1220a184f 100644 --- a/static/themes/_list.json +++ b/static/themes/_list.json @@ -547,11 +547,11 @@ { "name": "blueberry_light", "bgColor": "#c1daf3", - "textColor": "#516377" + "textColor": "#7390aa" }, { "name": "blueberry_dark", - "bgColor": "#242939", - "textColor": "#add7ff" + "bgColor": "#2e3446", + "textColor": "#91b4d5" } ] diff --git a/static/themes/blueberry_dark.css b/static/themes/blueberry_dark.css index 9bc1a2573..c85f36347 100644 --- a/static/themes/blueberry_dark.css +++ b/static/themes/blueberry_dark.css @@ -1,11 +1,21 @@ :root { - --bg-color: #242939; - --main-color: #27e8a7; + --bg-color: #2e3446; + --main-color: #add7ff; --caret-color: #27e8a7; --sub-color: #506477; - --text-color: #add7ff; - --error-color: #df4577; + --text-color: #91b4d5; + --error-color: #df4576; --error-extra-color: #d996ac; - --colorful-error-color: #d996ac; + --colorful-error-color: #df4576; --colorful-error-extra-color: #d996ac; } + +#menu .icon-button:nth-child(1), +#menu .icon-button:nth-child(2), +#menu .icon-button:nth-child(3), +#menu .icon-button:nth-child(4), +#menu .icon-button:nth-child(5), +#menu .icon-button:nth-child(6), +#menu .icon-button:nth-child(7) { + color: #27e8a7; +} diff --git a/static/themes/blueberry_light.css b/static/themes/blueberry_light.css index e11c60cf4..a7afc2d3b 100644 --- a/static/themes/blueberry_light.css +++ b/static/themes/blueberry_light.css @@ -1,11 +1,21 @@ :root { --bg-color: #c1daf3; - --main-color: #27e8a7; - --caret-color: #27e8a7; - --sub-color: #7290aa; - --text-color: #516377; - --error-color: #df4577; + --main-color: #506477; + --caret-color: #0fdb97; + --sub-color: #91b4d5; + --text-color: #7390aa; + --error-color: #df4576; --error-extra-color: #d996ac; - --colorful-error-color: #d996ac; + --colorful-error-color: #df4576; --colorful-error-extra-color: #d996ac; } + +#menu .icon-button:nth-child(1), +#menu .icon-button:nth-child(2), +#menu .icon-button:nth-child(3), +#menu .icon-button:nth-child(4), +#menu .icon-button:nth-child(5), +#menu .icon-button:nth-child(6), +#menu .icon-button:nth-child(7) { + color: #0fdb97; +} From 3c2de9314a64f51756cd8a0f332f03e63e011c55 Mon Sep 17 00:00:00 2001 From: Raymon Zhang Date: Wed, 12 May 2021 19:50:22 -0700 Subject: [PATCH 05/15] Updated blueberry themes --- static/themes/_list.json | 6 +++--- static/themes/blueberry_dark.css | 16 +++++----------- static/themes/blueberry_light.css | 18 ++++++------------ 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/static/themes/_list.json b/static/themes/_list.json index 1220a184f..dad190542 100644 --- a/static/themes/_list.json +++ b/static/themes/_list.json @@ -546,12 +546,12 @@ }, { "name": "blueberry_light", - "bgColor": "#c1daf3", - "textColor": "#7390aa" + "bgColor": "#dae0f5", + "textColor": "#678198" }, { "name": "blueberry_dark", - "bgColor": "#2e3446", + "bgColor": "#212b42", "textColor": "#91b4d5" } ] diff --git a/static/themes/blueberry_dark.css b/static/themes/blueberry_dark.css index c85f36347..5c883bee0 100644 --- a/static/themes/blueberry_dark.css +++ b/static/themes/blueberry_dark.css @@ -1,8 +1,8 @@ :root { - --bg-color: #2e3446; + --bg-color: #212b42; --main-color: #add7ff; - --caret-color: #27e8a7; - --sub-color: #506477; + --caret-color: #11d964; + --sub-color: #5c7da5; --text-color: #91b4d5; --error-color: #df4576; --error-extra-color: #d996ac; @@ -10,12 +10,6 @@ --colorful-error-extra-color: #d996ac; } -#menu .icon-button:nth-child(1), -#menu .icon-button:nth-child(2), -#menu .icon-button:nth-child(3), -#menu .icon-button:nth-child(4), -#menu .icon-button:nth-child(5), -#menu .icon-button:nth-child(6), -#menu .icon-button:nth-child(7) { - color: #27e8a7; +#top .logo .bottom { + color: #962f7e; } diff --git a/static/themes/blueberry_light.css b/static/themes/blueberry_light.css index a7afc2d3b..8b13ec51f 100644 --- a/static/themes/blueberry_light.css +++ b/static/themes/blueberry_light.css @@ -1,21 +1,15 @@ :root { - --bg-color: #c1daf3; + --bg-color: #dae0f5; --main-color: #506477; - --caret-color: #0fdb97; - --sub-color: #91b4d5; - --text-color: #7390aa; + --caret-color: #06bd80; + --sub-color: #92a4be; + --text-color: #678198; --error-color: #df4576; --error-extra-color: #d996ac; --colorful-error-color: #df4576; --colorful-error-extra-color: #d996ac; } -#menu .icon-button:nth-child(1), -#menu .icon-button:nth-child(2), -#menu .icon-button:nth-child(3), -#menu .icon-button:nth-child(4), -#menu .icon-button:nth-child(5), -#menu .icon-button:nth-child(6), -#menu .icon-button:nth-child(7) { - color: #0fdb97; +#top .logo .bottom { + color: #df4576; } From 291c2998cde395c7c349f47ba50c206c3b855583 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Fri, 14 May 2021 12:57:56 -0400 Subject: [PATCH 06/15] Update replay.js --- src/js/replay.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/js/replay.js b/src/js/replay.js index cc7de1b47..46cbc77d7 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; } From c26b36ad5e4a9ba92cf031db236b95042f2b6b03 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Fri, 14 May 2021 12:58:23 -0400 Subject: [PATCH 07/15] Update test-ui.js --- src/js/test/test-ui.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/test/test-ui.js b/src/js/test/test-ui.js index d940e80a1..54cfccaa8 100644 --- a/src/js/test/test-ui.js +++ b/src/js/test/test-ui.js @@ -186,6 +186,7 @@ export function colorful(tc) { export function screenshot() { + let revealReplay = false; function revertScreenshot() { $("#notificationCenter").removeClass("hidden"); $("#commandLineMobileButton").removeClass("hidden"); @@ -195,7 +196,6 @@ export function screenshot() { if (firebase.auth().currentUser == null) $(".pageTest .loginTip").removeClass("hidden"); } - let revealReplay = false; if (!$("#resultReplay").hasClass('hidden')) { revealReplay = true; Replay.pauseReplay() From cda804ca103fa84639730d0b575e288a5affab99 Mon Sep 17 00:00:00 2001 From: Luke Weiler Date: Fri, 14 May 2021 13:12:58 -0400 Subject: [PATCH 08/15] Replay timer resets to 0 after new test --- src/js/replay.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/js/replay.js b/src/js/replay.js index 46cbc77d7..f0d07fe22 100644 --- a/src/js/replay.js +++ b/src/js/replay.js @@ -172,6 +172,7 @@ function startReplayRecording() { //hide replay display if user left it open toggleReplayDisplay(); } + $("#replayStopwatch").text(0 + "s"); replayData = []; replayStartTime = performance.now(); replayRecording = true; From 8e299fb7f3996bb0ecddf3cb081c80dbbf951e41 Mon Sep 17 00:00:00 2001 From: UnrealApex <79121360+UnrealApex@users.noreply.github.com> Date: Fri, 14 May 2021 14:19:15 -0700 Subject: [PATCH 09/15] Removed unnecessary hyphen --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 389f0631831a4a2052fda55d60a687107e0c78e1 Mon Sep 17 00:00:00 2001 From: UnrealApex <79121360+UnrealApex@users.noreply.github.com> Date: Fri, 14 May 2021 16:40:58 -0700 Subject: [PATCH 10/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d31d20892..11b6cfc9d 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 From bdb7e4545391586af5dbedd9c9e421843f8145fb Mon Sep 17 00:00:00 2001 From: UnrealApex <79121360+UnrealApex@users.noreply.github.com> Date: Fri, 14 May 2021 16:41:34 -0700 Subject: [PATCH 11/15] Removed unnecessary hyphen --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 3652234101967a1dc239b504d965c3ea45a4bc81 Mon Sep 17 00:00:00 2001 From: UnrealApex Date: Sat, 15 May 2021 18:57:14 +0000 Subject: [PATCH 12/15] Made sign in --- static/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 @@
or
- Google Sign In + Sign in with Google
From dcb3206a4c05f61c54cb412e77e4487aa3d5c215 Mon Sep 17 00:00:00 2001 From: Evan Callicoat Date: Sat, 15 May 2021 14:25:46 -0500 Subject: [PATCH 13/15] Add handsdown reference layout --- src/js/layouts.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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: [ From 8a7655bb990fe908620c8849a14d6584afe065c7 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sat, 15 May 2021 23:51:04 +0100 Subject: [PATCH 14/15] updated blueberry colors a bit --- static/themes/_list.json | 4 ++-- static/themes/blueberry_dark.css | 2 +- static/themes/blueberry_light.css | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/static/themes/_list.json b/static/themes/_list.json index dad190542..ca1b3c69c 100644 --- a/static/themes/_list.json +++ b/static/themes/_list.json @@ -547,11 +547,11 @@ { "name": "blueberry_light", "bgColor": "#dae0f5", - "textColor": "#678198" + "textColor": "#df4576" }, { "name": "blueberry_dark", "bgColor": "#212b42", - "textColor": "#91b4d5" + "textColor": "#df4576" } ] diff --git a/static/themes/blueberry_dark.css b/static/themes/blueberry_dark.css index 5c883bee0..001ae8e0f 100644 --- a/static/themes/blueberry_dark.css +++ b/static/themes/blueberry_dark.css @@ -1,7 +1,7 @@ :root { --bg-color: #212b42; --main-color: #add7ff; - --caret-color: #11d964; + --caret-color: #962f7e; --sub-color: #5c7da5; --text-color: #91b4d5; --error-color: #df4576; diff --git a/static/themes/blueberry_light.css b/static/themes/blueberry_light.css index 8b13ec51f..4ebe7b500 100644 --- a/static/themes/blueberry_light.css +++ b/static/themes/blueberry_light.css @@ -1,7 +1,7 @@ :root { --bg-color: #dae0f5; --main-color: #506477; - --caret-color: #06bd80; + --caret-color: #df4576; --sub-color: #92a4be; --text-color: #678198; --error-color: #df4576; From d890307f9989ff73d6291afbdb926ed1c17acd00 Mon Sep 17 00:00:00 2001 From: Miodec Date: Sun, 16 May 2021 00:29:21 +0100 Subject: [PATCH 15/15] switched sounds to howler, should fix safari problems --- package-lock.json | 13 +++++++++ package.json | 1 + src/js/sound.js | 67 ++++++++++++++++++++++++----------------------- 3 files changed, 48 insertions(+), 33 deletions(-) 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/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(); }