From 06b7a08bfab82ceefc9150bfc6eefc0207d37fa4 Mon Sep 17 00:00:00 2001 From: XShine555 Date: Mon, 20 Jul 2026 14:35:45 +0200 Subject: [PATCH] refactor(web-player): centralise styles and drop dead code Styles: adds the scrim and on-art tokens so the black overlays and the white marks drawn over artwork stop being raw tailwind colours, and routes every component through the semantic layer instead of reaching into the --mf-* palette. Renames --mf-accent-60, which was actually an 80% mix, to --mf-accent-soft, and removes the unused --mf-radius and the --color-neutral-950 override. Dead code: the root +layout.server.ts already redirects everything except /login, so the anonymous branches in the home and explore loads and the needsAuth empty state could never run. Deletes the unused accentSoft helper, and stops exporting helpers nobody imports. fmtTime and fmtDate move out of theme/color.ts into $lib/format.ts; they are not colour concerns. The accent animation now cancels its pending frame on teardown. --- web-player/src/lib/components/Sidebar.svelte | 7 ++----- .../src/lib/components/player/SeekBar.svelte | 6 +++--- .../components/player/VolumeControl.svelte | 6 +++--- .../src/lib/components/ui/Button.svelte | 2 +- web-player/src/lib/components/ui/Modal.svelte | 2 +- .../src/lib/components/ui/NowPlaying.svelte | 4 ++-- web-player/src/lib/format.ts | 12 +++++++++++ web-player/src/lib/player/player.svelte.ts | 2 +- web-player/src/lib/server/youtube.ts | 4 ++-- web-player/src/lib/theme/color.ts | 17 --------------- web-player/src/lib/theme/theme.css | 7 +++++-- web-player/src/lib/tracks.ts | 2 +- .../src/routes/(app)/explore/+page.server.ts | 21 ++++++++----------- .../src/routes/(app)/explore/+page.svelte | 11 ++-------- .../src/routes/(app)/library/+page.svelte | 3 ++- .../[id]/components/PlaylistTrackTable.svelte | 3 ++- .../[id]/components/SuggestionsTable.svelte | 3 ++- web-player/src/routes/+layout.svelte | 5 +++-- web-player/src/routes/+page.server.ts | 19 ++++++++--------- web-player/src/routes/+page.svelte | 2 +- web-player/src/routes/layout.css | 7 ++++--- web-player/src/routes/login/+page.svelte | 2 +- 22 files changed, 68 insertions(+), 79 deletions(-) create mode 100644 web-player/src/lib/format.ts diff --git a/web-player/src/lib/components/Sidebar.svelte b/web-player/src/lib/components/Sidebar.svelte index f5db60e..ac94d01 100644 --- a/web-player/src/lib/components/Sidebar.svelte +++ b/web-player/src/lib/components/Sidebar.svelte @@ -69,7 +69,7 @@ ? 'text-fg' : 'text-fg-3 hover:bg-hover hover:text-fg'}" > - + {link.label} {/snippet} @@ -87,10 +87,7 @@ : ''}" style="top:{pillTop}px; height:{pillHeight}px; opacity:{pillVisible ? 1 : 0}" > - +