From 17a9e0fb3b939fd6b41fa81f58b21af0c02eb2e2 Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 2 Apr 2021 23:42:34 +0100 Subject: [PATCH 01/17] fixed custom theme not persisting --- src/js/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/config.js b/src/js/config.js index b76c1cd59..63653dd0d 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -1355,8 +1355,8 @@ export function apply(configObj) { }); if (configObj && configObj != null && configObj != "null") { setTheme(configObj.theme, true); - setCustomTheme(configObj.customTheme, true); setCustomThemeColors(configObj.customThemeColors, true); + setCustomTheme(configObj.customTheme, true); setQuickTabMode(configObj.quickTab, true); setKeyTips(configObj.showKeyTips, true); setTimeConfig(configObj.time, true); From ee665fdc1f70424c210229793df7d5569daead64 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 4 Apr 2021 00:07:33 +0100 Subject: [PATCH 02/17] fixed date filters not being exclusive --- src/js/account/result-filters.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js/account/result-filters.js b/src/js/account/result-filters.js index d6754557d..ad46511fc 100644 --- a/src/js/account/result-filters.js +++ b/src/js/account/result-filters.js @@ -340,7 +340,8 @@ $( }); filters[group][filter] = true; } else { - filters[group][filter] = !filters[group][filter]; + toggle(group, filter); + // filters[group][filter] = !filters[group][filter]; } } updateActive(); From 6fa13b131f8496b0871a6a4761759b349c294115 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 4 Apr 2021 00:08:25 +0100 Subject: [PATCH 03/17] fixed a white flash while loading --- src/js/config.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/js/config.js b/src/js/config.js index 63653dd0d..76470ada7 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -1146,19 +1146,21 @@ export function setIndicateTypos(it, nosave) { if (!nosave) saveToCookie(); } -export function setCustomTheme(boolean, nosave) { +export function setCustomTheme(boolean, nosave, noThemeChange = false) { if (boolean !== undefined) config.customTheme = boolean; - if (boolean) { - ThemeController.set("custom"); - } else { - ThemeController.set(config.theme); + if (!noThemeChange) { + if (boolean) { + ThemeController.set("custom"); + } else { + ThemeController.set(config.theme); + } } if (!nosave) saveToCookie(); } export function setTheme(name, nosave) { config.theme = name; - setCustomTheme(false, true); + setCustomTheme(false, true, true); ThemeController.set(config.theme); if (!nosave) saveToCookie(); } From 95d7624babc93e4fd70a38cae800c629a3e7fe9a Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 4 Apr 2021 00:16:32 +0100 Subject: [PATCH 04/17] fixed pb reset and email update not showing --- src/js/settings.js | 8 ++++++++ static/index.html | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/js/settings.js b/src/js/settings.js index 726865f12..c312b83f1 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -727,3 +727,11 @@ $(".pageSettings .sectionGroupTitle").click((e) => { ); } }); + +$(".pageSettings #resetPersonalBestsButton").on("click", (e) => { + SimplePopups.list.resetPersonalBests.show(); +}); + +$(".pageSettings #updateAccountEmail").on("click", (e) => { + SimplePopups.list.updateEmail.show(); +}); diff --git a/static/index.html b/static/index.html index 2611cc4fb..731ef8d9d 100644 --- a/static/index.html +++ b/static/index.html @@ -3225,7 +3225,7 @@ class="button off danger" id="resetPersonalBestsButton" tabindex="0" - onclick="this.blur();simplePopups.resetPersonalBests.show();" + onclick="this.blur();" > reset personal bests @@ -3241,7 +3241,7 @@ class="button off danger" id="updateAccountEmail" tabindex="0" - onclick="this.blur();simplePopups.updateEmail.show();" + onclick="this.blur();" > update email From ed8eab4c6680a50a3e618fbdb5466bdfd55b9ee4 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 4 Apr 2021 00:25:18 +0100 Subject: [PATCH 05/17] actually fixed white flashing --- src/js/config.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/js/config.js b/src/js/config.js index 76470ada7..03ddf6456 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -1146,14 +1146,12 @@ export function setIndicateTypos(it, nosave) { if (!nosave) saveToCookie(); } -export function setCustomTheme(boolean, nosave, noThemeChange = false) { +export function setCustomTheme(boolean, nosave) { if (boolean !== undefined) config.customTheme = boolean; - if (!noThemeChange) { - if (boolean) { - ThemeController.set("custom"); - } else { - ThemeController.set(config.theme); - } + if (boolean) { + ThemeController.set("custom"); + } else if (!boolean && !nosave) { + ThemeController.set(config.theme); } if (!nosave) saveToCookie(); } @@ -1358,7 +1356,7 @@ export function apply(configObj) { if (configObj && configObj != null && configObj != "null") { setTheme(configObj.theme, true); setCustomThemeColors(configObj.customThemeColors, true); - setCustomTheme(configObj.customTheme, true); + setCustomTheme(configObj.customTheme, true, true); setQuickTabMode(configObj.quickTab, true); setKeyTips(configObj.showKeyTips, true); setTimeConfig(configObj.time, true); From 643ecf6a004201e30994edea5209705149198670 Mon Sep 17 00:00:00 2001 From: Smithster Date: Sun, 4 Apr 2021 17:29:50 +0100 Subject: [PATCH 06/17] Added functionality to add background image and background size --- src/js/config.js | 22 ++++++++++++++++++++++ src/js/theme-controller.js | 20 ++++++++++++++++++++ src/sass/style.scss | 2 +- 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/src/js/config.js b/src/js/config.js index 03ddf6456..b670b9008 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -113,6 +113,8 @@ let defaultConfig = { monkey: false, repeatQuotes: "off", oppositeShiftMode: "off", + customBackground: "https://i.imgur.com/OWbWz6i.jpg", + customBackgroundSize: "cover", }; function isConfigKeyValid(name) { @@ -1343,6 +1345,24 @@ export function setFontSize(fontSize, nosave) { if (!nosave) saveToCookie(); } +export function setCustomBackground(value, nosave) { + if (value == null || value == undefined) { + value = ""; + } + config.customBackground = value; + ThemeController.applyCustomBackground(); + if (!nosave) saveToCookie(); +} + +export function setCustomBackgroundSize(value, nosave) { + if (value != "cover" && value != "contain"){ + value = "cover"; + } + config.customBackgroundSize = value; + ThemeController.applyCustomBackgroundSize(); + if (!nosave) saveToCookie(); +} + export function apply(configObj) { if (configObj == null || configObj == undefined) { Notifications.add("Could not apply config", -1, 3); @@ -1357,6 +1377,8 @@ export function apply(configObj) { setTheme(configObj.theme, true); setCustomThemeColors(configObj.customThemeColors, true); setCustomTheme(configObj.customTheme, true, true); + setCustomBackground(configObj.customBackground, true); + setCustomBackgroundSize(configObj.customBackgroundSize, true); setQuickTabMode(configObj.quickTab, true); setKeyTips(configObj.showKeyTips, true); setTimeConfig(configObj.time, true); diff --git a/src/js/theme-controller.js b/src/js/theme-controller.js index e556135da..79ad46253 100644 --- a/src/js/theme-controller.js +++ b/src/js/theme-controller.js @@ -4,6 +4,7 @@ import * as Misc from "./misc"; import * as Notifications from "./notifications"; import Config from "./config"; import * as UI from "./ui"; +import config from "./config"; let isPreviewingTheme = false; let randomTheme = null; @@ -149,3 +150,22 @@ export function randomiseTheme() { export function clearRandom() { randomTheme = null; } + +export function applyCustomBackground(){ + if (Config.customBackground != ""){ + $("body").css({ + backgroundImage: `url(${Config.customBackground})`, + backgroundRepeat: "no-repeat", + backgroundPosition: "center center", + backgroundAttachment: "fixed", + }) + } +} + +export function applyCustomBackgroundSize(){ + if (Config.customBackgroundSize != ""){ + $("body").css({ + backgroundSize: Config.customBackgroundSize, + }) + } +} \ No newline at end of file diff --git a/src/sass/style.scss b/src/sass/style.scss index bc45debe6..69d0e3cb9 100644 --- a/src/sass/style.scss +++ b/src/sass/style.scss @@ -107,10 +107,10 @@ body { margin: 0; padding: 0; min-height: 100vh; - background: var(--bg-color); font-family: var(--font); color: var(--main-color); overflow-x: hidden; + background: var(--bg-color); } html { From e3db19050e33c87b6d1ea305917d15f14ca5309c Mon Sep 17 00:00:00 2001 From: Smithster Date: Sun, 4 Apr 2021 18:43:34 +0100 Subject: [PATCH 07/17] added custom background options in settings page --- src/js/settings.js | 12 ++++++++++++ src/sass/style.scss | 34 ++++++++++++++++++++++++++++++++++ static/index.html | 22 ++++++++++++++++++++++ 3 files changed, 68 insertions(+) diff --git a/src/js/settings.js b/src/js/settings.js index c312b83f1..53ef33e8b 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -735,3 +735,15 @@ $(".pageSettings #resetPersonalBestsButton").on("click", (e) => { $(".pageSettings #updateAccountEmail").on("click", (e) => { SimplePopups.list.updateEmail.show(); }); + +$(".pageSettings .section.customBackground .inputAndButton .save").on("click", (e) => { + UpdateConfig.setCustomBackground($(".pageSettings .section.customBackground .inputAndButton input").val()) +}); + +$(".pageSettings .section.customBackground .inputAndButton .cover").on("click", (e) => { + UpdateConfig.setCustomBackgroundSize("cover"); +}); + +$(".pageSettings .section.customBackground .inputAndButton .contain").on("click", (e) => { + UpdateConfig.setCustomBackgroundSize("contain"); +}); \ No newline at end of file diff --git a/src/sass/style.scss b/src/sass/style.scss index 69d0e3cb9..4fc869970 100644 --- a/src/sass/style.scss +++ b/src/sass/style.scss @@ -2714,6 +2714,40 @@ key { } } + &.customBackground{ + .inputAndButton{ + display:grid; + grid-template-columns: 2fr 1fr 1fr; + grid-template-rows: 1fr 1fr; + gap: 0.5rem; + input{ + grid-column: 1/3; + grid-row: 1/2; + } + + .save{ + grid-column:3/4; + grid-row:1/2; + height: auto; + + .fas{ + margin-right: 0rem; + vertical-align: sub; + } + } + + .cover{ + grid-column:1/2; + grid-row:2/3; + } + + .contain{ + grid-column:2/4; + grid-row:2/3; + } + } + } + &.customTheme { grid-template-columns: 1fr 1fr 1fr 1fr; justify-items: stretch; diff --git a/static/index.html b/static/index.html index 731ef8d9d..8e3ae7975 100644 --- a/static/index.html +++ b/static/index.html @@ -2920,6 +2920,28 @@ +
+

custom background

+
+ Set an image url to be a custom background image. Cover fits the image to cover the screen. + Contain fits the image to be fully visible. +
+
+ +
+ +
+
cover
+
contain
+
+

theme

From bdfab7caeff8d0c3a9e249c981268470ccf3cb1c Mon Sep 17 00:00:00 2001 From: Smithster Date: Sun, 4 Apr 2021 19:33:59 +0100 Subject: [PATCH 08/17] -Now able to clear background images -removed default image -can now use enter to save background image -removed pointless test --- src/js/config.js | 12 ++++++++---- src/js/settings.js | 6 ++++++ src/js/theme-controller.js | 14 ++++++-------- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/js/config.js b/src/js/config.js index b670b9008..1c9fb98eb 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -113,7 +113,7 @@ let defaultConfig = { monkey: false, repeatQuotes: "off", oppositeShiftMode: "off", - customBackground: "https://i.imgur.com/OWbWz6i.jpg", + customBackground: "", customBackgroundSize: "cover", }; @@ -1349,9 +1349,13 @@ export function setCustomBackground(value, nosave) { if (value == null || value == undefined) { value = ""; } - config.customBackground = value; - ThemeController.applyCustomBackground(); - if (!nosave) saveToCookie(); + if( /(https|http):\/\/(www\.|).+\..+\/.+(\.png|\.gif|\.jpeg|\.jpg)/gi.test(value) || value == ""){ + config.customBackground = value; + ThemeController.applyCustomBackground(); + if (!nosave) saveToCookie(); + } else { + Notifications.add("Invalid custom background URL", 0); + } } export function setCustomBackgroundSize(value, nosave) { diff --git a/src/js/settings.js b/src/js/settings.js index 53ef33e8b..eeeb65fa2 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -746,4 +746,10 @@ $(".pageSettings .section.customBackground .inputAndButton .cover").on("click", $(".pageSettings .section.customBackground .inputAndButton .contain").on("click", (e) => { UpdateConfig.setCustomBackgroundSize("contain"); +}); + +$(".pageSettings .section.customBackground .inputAndButton input").keypress( (e) => { + if(e.keyCode == 13){ + UpdateConfig.setCustomBackground($(".pageSettings .section.customBackground .inputAndButton input").val()) + } }); \ No newline at end of file diff --git a/src/js/theme-controller.js b/src/js/theme-controller.js index 79ad46253..c91bc9a52 100644 --- a/src/js/theme-controller.js +++ b/src/js/theme-controller.js @@ -152,14 +152,12 @@ export function clearRandom() { } export function applyCustomBackground(){ - if (Config.customBackground != ""){ - $("body").css({ - backgroundImage: `url(${Config.customBackground})`, - backgroundRepeat: "no-repeat", - backgroundPosition: "center center", - backgroundAttachment: "fixed", - }) - } + $("body").css({ + backgroundImage: `url(${Config.customBackground})`, + backgroundRepeat: "no-repeat", + backgroundPosition: "center center", + backgroundAttachment: "fixed", + }) } export function applyCustomBackgroundSize(){ From 803fc9689cb83edd60a5a14886178059f959e1b0 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 4 Apr 2021 19:53:22 +0100 Subject: [PATCH 09/17] fixed config not saving --- functions/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/functions/index.js b/functions/index.js index 842c9872e..5088be804 100644 --- a/functions/index.js +++ b/functions/index.js @@ -1782,6 +1782,7 @@ exports.saveConfig = functions.https.onCall((request, response) => { } if (err) return; if (key === "resultFilters") return; + if (key === "customBackground") return; let val = obj[key]; if (Array.isArray(val)) { val.forEach((valarr) => { From 137367e396187696186653428192fdda6df640d1 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 4 Apr 2021 19:54:01 +0100 Subject: [PATCH 10/17] changed the structure a bit, showing active background size --- src/js/settings.js | 59 +++++++++++++++++++++++++++++++++------------ src/sass/style.scss | 30 +++++++---------------- static/index.html | 53 ++++++++++++++++++++++++++++------------ 3 files changed, 89 insertions(+), 53 deletions(-) diff --git a/src/js/settings.js b/src/js/settings.js index eeeb65fa2..62597b727 100644 --- a/src/js/settings.js +++ b/src/js/settings.js @@ -267,6 +267,10 @@ async function initGroups() { "alwaysShowCPM", UpdateConfig.setAlwaysShowCPM ); + groups.customBackgroundSize = new SettingsGroup( + "customBackgroundSize", + UpdateConfig.setCustomBackgroundSize + ); } async function fillSettingsPage() { @@ -369,6 +373,10 @@ async function fillSettingsPage() { }) .appendTo(fontsEl); }); + + $(".pageSettings .section.customBackgroundSize input").val( + Config.customBackground + ); } export let settingsFillPromise = fillSettingsPage(); @@ -736,20 +744,39 @@ $(".pageSettings #updateAccountEmail").on("click", (e) => { SimplePopups.list.updateEmail.show(); }); -$(".pageSettings .section.customBackground .inputAndButton .save").on("click", (e) => { - UpdateConfig.setCustomBackground($(".pageSettings .section.customBackground .inputAndButton input").val()) -}); - -$(".pageSettings .section.customBackground .inputAndButton .cover").on("click", (e) => { - UpdateConfig.setCustomBackgroundSize("cover"); -}); - -$(".pageSettings .section.customBackground .inputAndButton .contain").on("click", (e) => { - UpdateConfig.setCustomBackgroundSize("contain"); -}); - -$(".pageSettings .section.customBackground .inputAndButton input").keypress( (e) => { - if(e.keyCode == 13){ - UpdateConfig.setCustomBackground($(".pageSettings .section.customBackground .inputAndButton input").val()) +$(".pageSettings .section.customBackgroundSize .inputAndButton .save").on( + "click", + (e) => { + UpdateConfig.setCustomBackground( + $( + ".pageSettings .section.customBackgroundSize .inputAndButton input" + ).val() + ); } -}); \ No newline at end of file +); + +$(".pageSettings .section.customBackgroundSize .inputAndButton .cover").on( + "click", + (e) => { + UpdateConfig.setCustomBackgroundSize("cover"); + } +); + +$(".pageSettings .section.customBackgroundSize .inputAndButton .contain").on( + "click", + (e) => { + UpdateConfig.setCustomBackgroundSize("contain"); + } +); + +$(".pageSettings .section.customBackgroundSize .inputAndButton input").keypress( + (e) => { + if (e.keyCode == 13) { + UpdateConfig.setCustomBackground( + $( + ".pageSettings .section.customBackgroundSize .inputAndButton input" + ).val() + ); + } + } +); diff --git a/src/sass/style.scss b/src/sass/style.scss index 4fc869970..d1b6d557d 100644 --- a/src/sass/style.scss +++ b/src/sass/style.scss @@ -2714,37 +2714,25 @@ key { } } - &.customBackground{ - .inputAndButton{ - display:grid; - grid-template-columns: 2fr 1fr 1fr; - grid-template-rows: 1fr 1fr; + &.customBackgroundSize { + .inputAndButton { + display: grid; + grid-template-columns: 2fr 1fr; gap: 0.5rem; - input{ + margin-bottom: 0.5rem; + input { grid-column: 1/3; - grid-row: 1/2; } - .save{ - grid-column:3/4; - grid-row:1/2; + .save { + grid-column: 3/4; height: auto; - .fas{ + .fas { margin-right: 0rem; vertical-align: sub; } } - - .cover{ - grid-column:1/2; - grid-row:2/3; - } - - .contain{ - grid-column:2/4; - grid-row:2/3; - } } } diff --git a/static/index.html b/static/index.html index 8e3ae7975..70db6c2a4 100644 --- a/static/index.html +++ b/static/index.html @@ -2920,26 +2920,47 @@
-
+

custom background

- Set an image url to be a custom background image. Cover fits the image to cover the screen. - Contain fits the image to be fully visible. + Set an image url to be a custom background image. Cover fits + the image to cover the screen. Contain fits the image to be + fully visible.
-
- -
- +
+
+ +
+ +
+
+
+
+ cover +
+
+ contain +
-
cover
-
contain
From c7f120294430a9e8d1b3a7a55a440be30beac5d4 Mon Sep 17 00:00:00 2001 From: Smithster Date: Sun, 4 Apr 2021 20:34:56 +0100 Subject: [PATCH 11/17] -added change custom background to command line -trimmed url input to reduce errors --- src/js/commandline-lists.js | 8 ++++++++ src/js/config.js | 1 + 2 files changed, 9 insertions(+) diff --git a/src/js/commandline-lists.js b/src/js/commandline-lists.js index bd8edf35a..fb6b67231 100644 --- a/src/js/commandline-lists.js +++ b/src/js/commandline-lists.js @@ -1596,6 +1596,14 @@ export let defaultCommands = { Commandline.show(); }, }, + { + id: "changeCustomBackground", + display: "Change custom background...", + input: true, + exec: (input) => { + UpdateConfig.setCustomBackground(input); + }, + }, { id: "changeTheme", display: "Change theme...", diff --git a/src/js/config.js b/src/js/config.js index 1c9fb98eb..639a0214c 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -1349,6 +1349,7 @@ export function setCustomBackground(value, nosave) { if (value == null || value == undefined) { value = ""; } + value = value.trim(); if( /(https|http):\/\/(www\.|).+\..+\/.+(\.png|\.gif|\.jpeg|\.jpg)/gi.test(value) || value == ""){ config.customBackground = value; ThemeController.applyCustomBackground(); From 9425e7bc15e300eb1b31c997d03baccff3f092c7 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 4 Apr 2021 20:35:00 +0100 Subject: [PATCH 12/17] disabled pace caret pb when not logged in --- src/js/config.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/js/config.js b/src/js/config.js index 1c9fb98eb..23edbef90 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -474,6 +474,10 @@ export function setPaceCaret(val, nosave) { if (val == undefined) { val = "off"; } + if (val == "pb" && firebase.auth().currentUser === null) { + Notifications.add("PB pace caret is unavailable without an account", 0); + return; + } // if (config.mode === "zen" && val != "off") { // Notifications.add(`Can't use pace caret with zen mode.`, 0); // val = "off"; @@ -1349,7 +1353,12 @@ export function setCustomBackground(value, nosave) { if (value == null || value == undefined) { value = ""; } - if( /(https|http):\/\/(www\.|).+\..+\/.+(\.png|\.gif|\.jpeg|\.jpg)/gi.test(value) || value == ""){ + if ( + /(https|http):\/\/(www\.|).+\..+\/.+(\.png|\.gif|\.jpeg|\.jpg)/gi.test( + value + ) || + value == "" + ) { config.customBackground = value; ThemeController.applyCustomBackground(); if (!nosave) saveToCookie(); @@ -1359,7 +1368,7 @@ export function setCustomBackground(value, nosave) { } export function setCustomBackgroundSize(value, nosave) { - if (value != "cover" && value != "contain"){ + if (value != "cover" && value != "contain") { value = "cover"; } config.customBackgroundSize = value; From 024def64a3996dbefa4a11cfee04e75bf40213fd Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 4 Apr 2021 20:36:53 +0100 Subject: [PATCH 13/17] removed error border if custom background is used --- src/js/theme-controller.js | 17 +++++++++++------ src/sass/style.scss | 5 +++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/js/theme-controller.js b/src/js/theme-controller.js index c91bc9a52..5f739befc 100644 --- a/src/js/theme-controller.js +++ b/src/js/theme-controller.js @@ -151,19 +151,24 @@ export function clearRandom() { randomTheme = null; } -export function applyCustomBackground(){ +export function applyCustomBackground() { $("body").css({ backgroundImage: `url(${Config.customBackground})`, backgroundRepeat: "no-repeat", backgroundPosition: "center center", backgroundAttachment: "fixed", - }) + }); + if (Config.customBackground === "") { + $("#words").removeClass("noErrorBorder"); + } else { + $("#words").addClass("noErrorBorder"); + } } -export function applyCustomBackgroundSize(){ - if (Config.customBackgroundSize != ""){ +export function applyCustomBackgroundSize() { + if (Config.customBackgroundSize != "") { $("body").css({ backgroundSize: Config.customBackgroundSize, - }) + }); } -} \ No newline at end of file +} diff --git a/src/sass/style.scss b/src/sass/style.scss index d1b6d557d..5573ba9b7 100644 --- a/src/sass/style.scss +++ b/src/sass/style.scss @@ -2465,6 +2465,11 @@ key { 1px 1px 0px var(--bg-color), -1px 1px 0px var(--bg-color); } +#words.noErrorBorder { + .word.error { + text-shadow: none; + } +} // .word letter { // transition: .1s; // height: 1rem; From f0604c539cd42d1fd9afe86f42f0c801aaafa152 Mon Sep 17 00:00:00 2001 From: Smithster Date: Sun, 4 Apr 2021 20:38:12 +0100 Subject: [PATCH 14/17] selects url text when clicked --- static/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/static/index.html b/static/index.html index 8e3ae7975..e8d0c8451 100644 --- a/static/index.html +++ b/static/index.html @@ -2930,6 +2930,7 @@
Date: Sun, 4 Apr 2021 20:47:55 +0100 Subject: [PATCH 15/17] removed this for now as its showing up while loading the page --- src/js/config.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/js/config.js b/src/js/config.js index 86d84d0e5..1c3cd2d07 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -474,10 +474,10 @@ export function setPaceCaret(val, nosave) { if (val == undefined) { val = "off"; } - if (val == "pb" && firebase.auth().currentUser === null) { - Notifications.add("PB pace caret is unavailable without an account", 0); - return; - } + // if (val == "pb" && firebase.auth().currentUser === null) { + // Notifications.add("PB pace caret is unavailable without an account", 0); + // return; + // } // if (config.mode === "zen" && val != "off") { // Notifications.add(`Can't use pace caret with zen mode.`, 0); // val = "off"; From f17e25a9f7d92948399affd0661c916355f5f712 Mon Sep 17 00:00:00 2001 From: Smithster Date: Sun, 4 Apr 2021 22:07:16 +0100 Subject: [PATCH 16/17] Changed command line input to auto fill with current url for changing custom background. --- src/js/commandline-lists.js | 1 + src/js/commandline.js | 9 ++++++--- src/js/config.js | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/js/commandline-lists.js b/src/js/commandline-lists.js index fb6b67231..ed2da742a 100644 --- a/src/js/commandline-lists.js +++ b/src/js/commandline-lists.js @@ -1599,6 +1599,7 @@ export let defaultCommands = { { id: "changeCustomBackground", display: "Change custom background...", + defaultValue: "", input: true, exec: (input) => { UpdateConfig.setCustomBackground(input); diff --git a/src/js/commandline.js b/src/js/commandline.js index cef4c12d9..6a414bb80 100644 --- a/src/js/commandline.js +++ b/src/js/commandline.js @@ -7,15 +7,18 @@ import * as TestUI from "./test-ui"; let commandLineMouseMode = false; -function showInput(command, placeholder) { +function showInput(command, placeholder, defaultValue = "") { $("#commandLineWrapper").removeClass("hidden"); $("#commandLine").addClass("hidden"); $("#commandInput").removeClass("hidden"); $("#commandInput input").attr("placeholder", placeholder); - $("#commandInput input").val(""); + $("#commandInput input").val(defaultValue); $("#commandInput input").focus(); $("#commandInput input").attr("command", ""); $("#commandInput input").attr("command", command); + if (defaultValue != ""){ + $("#commandInput input").select(); + } } function showFound() { @@ -142,7 +145,7 @@ function trigger(command) { if (obj.id == command) { if (obj.input) { input = true; - showInput(obj.id, obj.display); + showInput(obj.id, obj.display, obj.defaultValue); } else { obj.exec(); if (obj.subgroup !== null && obj.subgroup !== undefined) { diff --git a/src/js/config.js b/src/js/config.js index 639a0214c..67de6b958 100644 --- a/src/js/config.js +++ b/src/js/config.js @@ -15,6 +15,7 @@ import * as LanguagePicker from "./language-picker"; import * as TestLogic from "./test-logic"; import * as PaceCaret from "./pace-caret"; import * as UI from "./ui"; +import * as CommandlineLists from "./commandline-lists"; export let cookieConfig = null; export let dbConfigLoaded = false; @@ -1352,6 +1353,9 @@ export function setCustomBackground(value, nosave) { value = value.trim(); if( /(https|http):\/\/(www\.|).+\..+\/.+(\.png|\.gif|\.jpeg|\.jpg)/gi.test(value) || value == ""){ config.customBackground = value; + CommandlineLists.defaultCommands.list.filter( (command) => + command.id == "changeCustomBackground" + )[0].defaultValue = value; ThemeController.applyCustomBackground(); if (!nosave) saveToCookie(); } else { From fe76caa37c1a5a53428e47e9dc7fde383cf46aa9 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 5 Apr 2021 00:06:53 +0100 Subject: [PATCH 17/17] inverted the hard caret flash animation to make it show up as soon as words input is focused --- src/sass/style.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sass/style.scss b/src/sass/style.scss index 5573ba9b7..cdaba3f74 100644 --- a/src/sass/style.scss +++ b/src/sass/style.scss @@ -1496,12 +1496,12 @@ a:hover { @keyframes caretFlashHard { 0%, 50% { - opacity: 0; + opacity: 1; } 51%, 100% { - opacity: 1; + opacity: 0; } }