From cee15061c06f0ecfa66d15a7f2c8a75f230cd865 Mon Sep 17 00:00:00 2001 From: Damjan Antevski Date: Fri, 7 Aug 2026 02:52:20 +0200 Subject: [PATCH] feat(theme): Add theme browser /theme --- README.md | 8 +++ theme.js | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 156 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index edbcb21..677b51b 100644 --- a/README.md +++ b/README.md @@ -85,8 +85,16 @@ Type `help` in the SpoTUI command bar to see a list of available commands. | `lyrics` | Toggle lyrics panel | | `search` | Open Spotify's native search | | `clear` | Clear the TUI output | +| `theme` | Browse and apply themes | | `help` | Show the help panel | +## Contributing + +You can add your own theme to the theme browser by visiting [spotui.root.sx](https://spotui.root.sx/). + +**Note**: You can only submit one theme every 24 hours. + + ## Notable forks of my project
diff --git a/theme.js b/theme.js index 6326269..099e839 100644 --- a/theme.js +++ b/theme.js @@ -1,5 +1,7 @@ + (function () { const ANIMATION_KEY = "spotui:ascii-animation"; +const THEME_HOST = "https://spotui.root.sx/"; const style = ` #spotui-tui { @@ -44,6 +46,7 @@ const style = ` body.spotui-lyrics-panel #spotui-logo, body.spotui-playlist-panel #spotui-logo, body.spotui-help-panel #spotui-logo, +body.spotui-theme-panel #spotui-logo, body.spotui-about-panel #spotui-logo { top: 12px; transform: translate(-50%, 0) scale(0.6); @@ -55,6 +58,7 @@ body.spotui-about-panel #spotui-logo { body:has(#spotui-wallpaper) body.spotui-lyrics-panel #spotui-logo, body:has(#spotui-wallpaper) body.spotui-playlist-panel #spotui-logo, body:has(#spotui-wallpaper) body.spotui-help-panel #spotui-logo, +body:has(#spotui-wallpaper) body.spotui-theme-panel #spotui-logo, body:has(#spotui-wallpaper) body.spotui-about-panel #spotui-logo { background-color: #000; } @@ -136,6 +140,7 @@ body.spotui-command-mode #spotui-output, body.spotui-playlist-panel #spotui-output, body.spotui-help-panel #spotui-output, body.spotui-about-panel #spotui-output, +body.spotui-theme-panel #spotui-output, body.spotui-lyrics-panel #spotui-output { display: none !important; } @@ -147,6 +152,7 @@ body.spotui-cli-mode #spotui-output { #spotui-output::-webkit-scrollbar, #spotui-help-panel::-webkit-scrollbar, #spotui-about-panel::-webkit-scrollbar, +#spotui-theme-panel::-webkit-scrollbar, #spotui-playlist-list::-webkit-scrollbar, #spotui-song-list::-webkit-scrollbar, .spotui-lyrics-lines::-webkit-scrollbar { @@ -326,7 +332,7 @@ body.spotui-playlist-panel #spotui-playlist-panel { transition-delay: 0.6s; } -#spotui-help-panel, #spotui-about-panel { +#spotui-help-panel, #spotui-about-panel, #spotui-theme-panel { display: none; flex: 1 1 auto; flex-direction: column; @@ -342,10 +348,51 @@ body.spotui-playlist-panel #spotui-playlist-panel { } body.spotui-help-panel #spotui-help-panel, -body.spotui-about-panel #spotui-about-panel { +body.spotui-about-panel #spotui-about-panel, +body.spotui-theme-panel #spotui-theme-panel { display: flex; } +.theme-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); + gap: 20px; +} + +.theme-card { + border: 1px solid #ff8c42; + border-radius: 4px; + padding: 10px; + background: rgba(0,0,0,0.5); + display: flex; + flex-direction: column; +} + +.theme-card img { + width: 100%; + height: auto; + border-radius: 4px; + object-fit: cover; + aspect-ratio: 16/9; +} + +.theme-card h3 { + margin: 10px 0 5px; + color: #ff8c42; +} + +.theme-card button { + background: #ff8c42; + color: #000; + border: none; + padding: 6px 12px; + font-family: "JetBrains Mono", monospace; + font-size: 13px; + cursor: pointer; + border-radius: 4px; + margin-top: auto; +} + .help-item { padding: 4px 0; display: flex; @@ -438,13 +485,13 @@ body.spotui-about-panel #spotui-about-panel { } body.spotui-tui-hidden #spotui-tui { - display: none !important; - } + display: none !important; + } - body:not(.spotui-tui-hidden) .main-topBar-container, - body:not(.spotui-tui-hidden) header { - display: none !important; - } + body:not(.spotui-tui-hidden) .main-topBar-container, + body:not(.spotui-tui-hidden) header { + display: none !important; + } `; const SPOTUI_ASCII_ART = [ @@ -1081,6 +1128,7 @@ function createTerminal() { +