From 2660c124d53968a837b4232f9522c60f95b696a0 Mon Sep 17 00:00:00 2001 From: XShine555 Date: Wed, 23 Sep 2026 01:33:25 +0200 Subject: [PATCH] Simplify design --- web-player/.prettierignore | 2 + web-player/.prettierrc | 1 + web-player/CLAUDE.md | 8 ++ web-player/docs/paginas.md | 10 +-- .../src/lib/components/layout/Sidebar.svelte | 11 ++- .../src/lib/components/layout/TopBar.svelte | 6 +- .../lib/components/player/PlayerBar.svelte | 6 +- .../lib/components/player/PlayerDock.svelte | 6 -- .../src/lib/components/player/Queue.svelte | 17 ++-- .../lib/components/player/TrackInfo.svelte | 2 +- .../player/TransportControls.svelte | 6 +- .../lib/components/ui/forms/CoverForm.svelte | 2 +- .../components/ui/forms/ImageDropzone.svelte | 2 +- .../components/ui/forms/PlaylistForm.svelte | 2 +- .../ui/layout/SectionHeading.svelte | 6 +- .../lib/components/ui/media/Artwork.svelte | 2 +- .../components/ui/media/ExplicitBadge.svelte | 2 +- .../lib/components/ui/media/ListRow.svelte | 2 +- .../lib/components/ui/media/MediaCard.svelte | 6 +- .../components/ui/media/MediaIdentity.svelte | 2 +- .../lib/components/ui/media/PlayButton.svelte | 4 +- .../lib/components/ui/media/TrackList.svelte | 14 +-- .../ui/overlay/ConfirmDialog.svelte | 12 ++- .../components/ui/overlay/ContextMenu.svelte | 4 +- .../lib/components/ui/overlay/Dialog.svelte | 40 +++++++++ .../components/ui/overlay/DialogHost.svelte | 34 +++++++ .../components/ui/overlay/GlassMenu.svelte | 4 +- .../lib/components/ui/overlay/Modal.svelte | 20 ++++- .../components/ui/primitives/BackLink.svelte | 2 +- .../components/ui/primitives/Button.svelte | 12 +-- .../lib/components/ui/primitives/Chip.svelte | 6 +- .../lib/components/ui/primitives/Field.svelte | 2 +- .../ui/primitives/IconButton.svelte | 2 +- .../ui/primitives/InfiniteScroll.svelte | 2 +- .../lib/components/ui/primitives/Input.svelte | 2 +- .../ui/primitives/SegmentedControl.svelte | 4 +- web-player/src/lib/player/player.svelte.ts | 21 +++-- web-player/src/lib/state/dialog.svelte.ts | 35 ++++++++ web-player/src/lib/state/menus.svelte.ts | 5 +- web-player/src/lib/theme/color.ts | 4 +- web-player/src/lib/theme/theme.css | 37 +++++--- web-player/src/lib/theme/tokens.ts | 89 ++++++++++--------- .../src/routes/(app)/albums/[id]/+page.svelte | 4 +- .../src/routes/(app)/explore/+page.svelte | 9 +- .../routes/(app)/playlists/[id]/+page.svelte | 4 +- .../src/routes/(app)/upload/+page.svelte | 10 +-- web-player/src/routes/+layout.svelte | 4 + web-player/src/routes/+page.svelte | 14 ++- web-player/src/routes/layout.css | 50 +++++++---- 49 files changed, 356 insertions(+), 195 deletions(-) create mode 100644 web-player/src/lib/components/ui/overlay/Dialog.svelte create mode 100644 web-player/src/lib/components/ui/overlay/DialogHost.svelte create mode 100644 web-player/src/lib/state/dialog.svelte.ts diff --git a/web-player/.prettierignore b/web-player/.prettierignore index 1f10deb..a69f55c 100644 --- a/web-player/.prettierignore +++ b/web-player/.prettierignore @@ -9,3 +9,5 @@ package package-lock.json src/lib/api/schema.d.ts static +.agents +skills-lock.json diff --git a/web-player/.prettierrc b/web-player/.prettierrc index 664d576..ee3f14c 100644 --- a/web-player/.prettierrc +++ b/web-player/.prettierrc @@ -3,6 +3,7 @@ "singleQuote": true, "trailingComma": "none", "printWidth": 100, + "endOfLine": "auto", "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"], "tailwindStylesheet": "./src/routes/layout.css", "overrides": [ diff --git a/web-player/CLAUDE.md b/web-player/CLAUDE.md index 448fbcf..20035f7 100644 --- a/web-player/CLAUDE.md +++ b/web-player/CLAUDE.md @@ -57,6 +57,14 @@ The design system lives in `src/routes/layout.css` (`@theme` tokens plus `@utili - Reach for these base components before creating a new one: `Artwork`, `Avatar`, `ListRow`, `MediaIdentity`, `TrackList`, `MediaCard`, `PageHeader`, `ContextMenu`, `ConfirmDialog`, `PlayButton`, `Slider`, `Logo`, `Chip`, `SegmentedControl`, `CoverForm`. - Known and accepted gap (documented in `scripts/check-tokens.mjs`): icon `strokeWidth={n}` isn't unified yet. There are 13 different values spread across almost every component, and migrating them to `stroke-thin/regular/bold` recipes safely would require visually confirming that `lucide-svelte` actually respects `stroke-width` through CSS, so that was left out of the last pass. +## Motion + +Every animation follows one scale of three durations and one easing curve, all defined in `theme.css`. Fast (`--mf-motion-fast`, 150ms) is for hover, focus and press feedback: color, opacity and small scale changes. Plain `transition` or `transition-colors` already uses it because it is the Tailwind default, so never write `duration-150`. Base (`--mf-motion-base`, 200ms) is for things that appear on top of the page or move inside a control: modals, menus, the queue panel, `animate-pop`, `animate-fade` and the segmented control thumb. Slow (`--mf-motion-slow`, 300ms) is for content entering the page and larger movement: `animate-enter`, cover zoom on hover and the player dock padding. + +Entrances and movement always use `--mf-ease` (`ease-snappy` in Tailwind, `expoOut` in Svelte transitions), which feels immediate because most of the motion happens at the start. Color transitions keep the Tailwind default curve. Overlays must feel instant: the modal backdrop uses `transition:fade={{ duration: 200 }}` and the panel uses a local `pop` transition (opacity + scale + translateY, `expoOut`, 200ms) mirroring `animate-pop`'s keyframes — both directives so the modal fades and pops on close too, not just on open, and the whole thing settles in 200ms. Staggered lists use `--i` with 40ms steps capped at ten items. + +The only exceptions are looping indicators (equalizer bars, pulse, spin, sheen) and the accent hue crossfade in `+layout.svelte` (600ms), which is ambient and meant to be slow. Do not add new durations or curves; if something needs a different feel, pick the closest step of the scale. `prefers-reduced-motion` disables everything globally in `layout.css`. + ## Auth `hooks.server.ts` validates the encrypted session cookie (`mf_session`), refreshes the `access_token`, and fills `locals.user` and `locals.accessToken`. To protect a route, check `locals.user` in its `load` and redirect to `/auth?returnTo=…`. When talking to the backend, send `locals.accessToken` as a Bearer token to `API_BASE_URL`. diff --git a/web-player/docs/paginas.md b/web-player/docs/paginas.md index 0c402a5..74c11e6 100644 --- a/web-player/docs/paginas.md +++ b/web-player/docs/paginas.md @@ -119,10 +119,10 @@ A fixed bottom bar, visible while something is playing. Shows track info, transp ## Available backend (summary) -| Resource | Endpoints | -| --------- | --------------------------------------------------------------------- | -| Tracks | list/search, detail, by user, stream, create, delete, upload-urls | -| Playlists | CRUD, playlist tracks, add/remove track, upload-picture | -| Users | list/search, detail, create | +| Resource | Endpoints | +| --------- | ----------------------------------------------------------------- | +| Tracks | list/search, detail, by user, stream, create, delete, upload-urls | +| Playlists | CRUD, playlist tracks, add/remove track, upload-picture | +| Users | list/search, detail, create | Typed client in `$lib/server/api.ts` (`openapi-fetch`, ErrorOr style). Use it inside `load`/server actions, never from the client. Types live in `src/lib/api/schema.d.ts`. diff --git a/web-player/src/lib/components/layout/Sidebar.svelte b/web-player/src/lib/components/layout/Sidebar.svelte index f4cf981..a835f8b 100644 --- a/web-player/src/lib/components/layout/Sidebar.svelte +++ b/web-player/src/lib/components/layout/Sidebar.svelte @@ -6,7 +6,6 @@ import type { SessionUser } from '$lib/types'; import ListRow from '../ui/media/ListRow.svelte'; import IconButton from '../ui/primitives/IconButton.svelte'; - import Logo from '../ui/primitives/Logo.svelte'; import Plus from '@lucide/svelte/icons/plus'; interface SidebarPlaylist { @@ -40,14 +39,14 @@ {link.label} {#if link.count} - {link.count} + {link.count} {/if} {/each} @@ -56,7 +55,7 @@ {#if user}
- Tus playlists + Tus playlists {#if playlists.length > 0} createPlaylistModal.show()} > - + {/if}
@@ -87,7 +86,7 @@ diff --git a/web-player/src/lib/components/player/PlayerBar.svelte b/web-player/src/lib/components/player/PlayerBar.svelte index 6b85a1e..3b14356 100644 --- a/web-player/src/lib/components/player/PlayerBar.svelte +++ b/web-player/src/lib/components/player/PlayerBar.svelte @@ -32,7 +32,7 @@
- + {fmtTime(player.progress)} - + {fmtTime(player.current.duration)}