diff --git a/README.md b/README.md index 5227b48..2c51a11 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ Type `help` in the SpoTUI command bar to see a list of available commands. | Command | Description | | -----------------------| -------------------------------| +| `tui -l ` | Toggle ASCII logo visibility | | `tui -l -a ` | Toggle ASCII animation | | `tui -wp [-o ]` | Set wallpaper (opacity 0-1) | | `tui -t pull ` | Apply a theme by its ID (you can find the id on our website) | diff --git a/theme.js b/theme.js index ba32cf8..df93f0e 100644 --- a/theme.js +++ b/theme.js @@ -192,6 +192,10 @@ body.spotui-lyrics-panel #spotui-logo { display: flex !important; } +body.logo-off #spotui-logo { + display: none !important; +} + #spotui-lyrics { display: none; flex: 1 1 auto; @@ -1292,7 +1296,36 @@ async function execute(cmd) { const [command, ...args] = cleanedCmd.split(/\s+/); const argText = args.join(" ").trim(); + function toggleLogo(state) { + if (state === "on") { + document.body.classList.remove("logo-off"); + localStorage.setItem("spotui:logo-visible", "on"); + } else if (state === "off") { + document.body.classList.add("logo-off"); + localStorage.setItem("spotui:logo-visible", "off"); + } + } + if (command === "tui") { + if (args.includes("-l") && args.includes("-a")) { + const state = args[args.length - 1]; + if (state === "off") { + asciiEnabled = false; + resetGrid(); + try { localStorage.setItem(ANIMATION_KEY, "off"); } catch(e) {} + } else if (state === "on") { + asciiEnabled = true; + try { localStorage.removeItem(ANIMATION_KEY); } catch(e) {} + } + return; + } + if (args[0] === "-l") { + const state = args[1]; + if (state === "on" || state === "off") { + toggleLogo(state); + } + return; + } if (args.includes("-wp")) { const urlIdx = args.indexOf("-wp") + 1; const url = args[urlIdx]; @@ -1390,18 +1423,6 @@ async function execute(cmd) { applyInputColors(); return; } - if (args.includes("-l") || args.includes("-a")) { - const state = args[args.length - 1]; - if (state === "off") { - asciiEnabled = false; - resetGrid(); - try { localStorage.setItem(ANIMATION_KEY, "off"); } catch(e) {} - } else if (state === "on") { - asciiEnabled = true; - try { localStorage.removeItem(ANIMATION_KEY); } catch(e) {} - } - return; - } return; } @@ -1479,6 +1500,7 @@ let aboutPanelOpen = false; let themePanelOpen = false; const COMMAND_LIST = [ + { cmd: "tui -l <on/off>", desc: "Toggle ASCII logo visibility" }, { cmd: "tui -l -a <on/off>", desc: "Toggle ASCII animation" }, { cmd: "tui -wp <url> [-o <opacity>]", desc: "Set wallpaper (opacity 0-1)" }, { cmd: "tui -wp off", desc: "Remove wallpaper" }, @@ -2209,6 +2231,9 @@ function resetAllSettings() { asciiEnabled = true; try { localStorage.removeItem(ANIMATION_KEY); } catch(e) {} + try { localStorage.removeItem("spotui:logo-visible"); } catch(e) {} + document.body.classList.remove("logo-off"); + localStorage.removeItem(LYRICS_COLOR_ACTIVE); localStorage.removeItem(LYRICS_COLOR_INACTIVE); localStorage.removeItem(LYRICS_COLOR_LIGHT_INACTIVE); @@ -2233,6 +2258,10 @@ function resetAllSettings() { injectStyle(); setTimeout(initLyricsBridge, 1000); +if (localStorage.getItem("spotui:logo-visible") === "off") { + document.body.classList.add("logo-off"); +} + if (Spicetify?.Platform) createTerminal(); else setTimeout(createTerminal, 1500);