mirror of
https://github.com/markuryy/shark.git
synced 2025-12-15 04:41:01 +00:00
feat(ui): add now playing panel and context menu for tracks
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user