diff --git a/src/lib/components/NowPlayingBar.svelte b/src/lib/components/NowPlayingBar.svelte index cd8251082..75e189a66 100644 --- a/src/lib/components/NowPlayingBar.svelte +++ b/src/lib/components/NowPlayingBar.svelte @@ -40,17 +40,17 @@ } let { - artwork = 'https://images.unsplash.com/photo-1470225620780-dba8ba36b745?w=200&h=200&fit=crop', - trackTitle = 'Irreplaceable', - artist = 'El Silencio de las Vega', - quality = 'FLAC • 24/192', - qualityLevel = 5, + artwork = '', + trackTitle = '', + artist = '', + quality = '', + qualityLevel = 0, isPlaying = false, onTogglePlay, onSkipBack, onSkipForward, - currentTime = 201, - duration = 345, + currentTime = 0, + duration = 0, onSeek, volume = 70, onVolumeChange, @@ -69,7 +69,8 @@ let isDraggingProgress = $state(false); let isDraggingVolume = $state(false); - const progress = $derived((currentTime / duration) * 100); + const progress = $derived(duration > 0 ? (currentTime / duration) * 100 : 0); + const hasTrack = $derived(trackTitle !== ''); function formatTime(seconds: number): string { const mins = Math.floor(seconds / 60); @@ -133,22 +134,36 @@
- -
-
{trackTitle}
-
{artist}
-
- {quality} - • -
- {#each Array(5) as _, i} -
- {/each} + {#if hasTrack} + +
+
{trackTitle}
+
{artist}
+
+ {quality} + {#if quality} + • +
+ {#each Array(5) as _, i} +
+ {/each} +
+ {/if}
-
+ {:else} +
+ No track playing +
+ {/if}
@@ -248,7 +263,7 @@
- 2:34 + -{formatTime(Math.max(0, duration - currentTime))}
@@ -294,6 +309,28 @@ object-fit: cover; } + .artwork-placeholder { + width: 56px; + height: 56px; + border-radius: 4px; + background: var(--bg-tertiary); + display: flex; + align-items: center; + justify-content: center; + color: var(--text-muted); + } + + .empty-state { + display: flex; + align-items: center; + height: 56px; + } + + .empty-text { + font-size: 14px; + color: var(--text-muted); + } + .track-details { flex: 1; min-width: 0; diff --git a/src/lib/components/Sidebar.svelte b/src/lib/components/Sidebar.svelte index d06741562..b95a14c12 100644 --- a/src/lib/components/Sidebar.svelte +++ b/src/lib/components/Sidebar.svelte @@ -116,32 +116,11 @@ handleViewChange('all-playlists')} + label="Favorites" + active={activeView === 'favorites'} + onclick={() => handleViewChange('favorites')} > - {#snippet icon()}{/snippet} - - handleViewChange('playlist-1')} - > - {#snippet icon()}{/snippet} - - handleViewChange('playlist-2')} - > - {#snippet icon()}{/snippet} - - handleViewChange('playlist-3')} - > - {#snippet icon()}{/snippet} + {#snippet icon()}{/snippet}