mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-27 17:27:32 +08:00
added the ability to toggle between custom and preset theme from the command line
This commit is contained in:
parent
fb5e748ac6
commit
8ada84d4bb
2 changed files with 32 additions and 0 deletions
|
|
@ -153,6 +153,13 @@ let commands = {
|
|||
toggleRandomTheme();
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "togglePresetCustomTheme",
|
||||
display: "Toggle preset/custom theme",
|
||||
exec: () => {
|
||||
togglePresetCustomTheme();
|
||||
},
|
||||
},
|
||||
{
|
||||
id: "changeDifficulty",
|
||||
display: "Change difficulty...",
|
||||
|
|
|
|||
|
|
@ -609,6 +609,31 @@ function applyCustomThemeColors() {
|
|||
}, 500);
|
||||
}
|
||||
|
||||
function togglePresetCustomTheme() {
|
||||
if (config.customTheme) {
|
||||
setCustomTheme(false);
|
||||
applyCustomThemeColors();
|
||||
// $('[tabContent="custom"]').removeClass("reveal");
|
||||
// $('[tabContent="preset"]').addClass("reveal");
|
||||
swapElements(
|
||||
$('.pageSettings [tabContent="custom"]'),
|
||||
$('.pageSettings [tabContent="preset"]'),
|
||||
250
|
||||
);
|
||||
} else {
|
||||
setCustomTheme(true);
|
||||
applyCustomThemeColors();
|
||||
swapElements(
|
||||
$('.pageSettings [tabContent="preset"]'),
|
||||
$('.pageSettings [tabContent="custom"]'),
|
||||
250
|
||||
);
|
||||
|
||||
// $('[tabContent="preset"]').removeClass("reveal");
|
||||
// $('[tabContent="custom"]').addClass("reveal");
|
||||
}
|
||||
}
|
||||
|
||||
function updateFavicon(size, curveSize) {
|
||||
let maincolor, bgcolor;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue