feat(ui): add now playing panel and context menu for tracks

This commit is contained in:
2025-10-03 20:59:37 -04:00
parent a7fc6e8d5d
commit fc2b987f63
9 changed files with 1035 additions and 5 deletions

View File

@@ -1,6 +1,8 @@
<script lang="ts">
import { beforeNavigate } from '$app/navigation';
let { onToggleNowPlaying }: { onToggleNowPlaying?: () => void } = $props();
const icons = {
back: '/icons/leftarrow.png',
forward: '/icons/rightarrow.png',
@@ -36,6 +38,12 @@
}
}
function handleNowPlayingClick() {
if (onToggleNowPlaying) {
onToggleNowPlaying();
}
}
$effect(() => {
if (history.length === 0 && typeof window !== 'undefined') {
history = [window.location.pathname];
@@ -64,7 +72,7 @@
<div class="toolbar-separator"></div>
<button class="toolbar-button" disabled title="Now Playing">
<button class="toolbar-button" onclick={handleNowPlayingClick} title="Now Playing">
<img src={icons.play} alt="Play" />
<span>Now Playing</span>
</button>