{#if currentlyPlaying}
{#if !expanded}
{currentlyPlaying.name}
{currentlyPlaying.artists?.map((artist) => artist.name).join(', ') || currentlyPlaying.uploader?.name}
(shuffled ? $queue.reorder() : $queue.shuffle())} class="aspect-square h-8">
$queue.previous()}>
(paused = !paused)} class="relative grid aspect-square h-8 place-items-center rounded-full bg-white text-black"> {#if waiting}
{:else}
{/if}
$queue.next()}>
(loop = !loop)} class="aspect-square h-8">
{ currentTimeTimestamp.innerText = formatTime(event.detail.value) seeking = true }} on:seeked={(event) => { currentTime = event.detail.value seeking = false }} />
(volume = volume > 0 ? 0 : Number(localStorage.getItem('volume')))} class="aspect-square h-8">
{ if (volume > 0) localStorage.setItem('volume', volume.toString()) }} />
(expanded = true)}>
$queue.clear()}>
{:else}
{#key currentlyPlaying}
{/key}
UP NEXT
{#each $queue.list as item} {@const isCurrent = item === currentlyPlaying}
{ if (!isCurrent) $queue.current = item }} class="queue-item h-20 w-full shrink-0 items-center gap-3 overflow-clip rounded-lg bg-neutral-900 {isCurrent ? 'pointer-events-none border-[1px] border-neutral-300' : 'hover:bg-neutral-800'}" >
{item.name}
{item.artists?.map((artist) => artist.name).join(', ') || item.uploader?.name}
{formatTime(item.duration)}
{/each}
{ expandedCurrentTimeTimestamp.innerText = formatTime(event.detail.value) seeking = true }} on:seeked={(event) => { currentTime = event.detail.value seeking = false }} />
(scrollDirection *= -1)} id="scrollingText" class="{scrollDistance > 0 ? (scrollDirection > 0 ? 'scrollLeft' : 'scrollRight') : ''} absolute whitespace-nowrap text-3xl">{currentlyPlaying.name}
{#if currentlyPlaying.artists && currentlyPlaying.artists.length > 0} {#each currentlyPlaying.artists as artist, index}
(expanded = false)} class="line-clamp-1 flex-shrink-0 text-lg hover:underline focus:underline" href="/details/artist?id={artist.id}&connection={currentlyPlaying.connection.id}">{artist.name}
{#if index < currentlyPlaying.artists.length - 1}
,
{/if} {/each} {:else if currentlyPlaying.uploader}
(expanded = false)} class="line-clamp-1 flex-shrink-0 text-lg hover:underline focus:underline" href="/details/user?id={currentlyPlaying.uploader.id}&connection={currentlyPlaying.connection.id}">{currentlyPlaying.uploader.name}
{/if} {#if currentlyPlaying.album}
-
(expanded = false)} class="line-clamp-1 flex-shrink-0 text-lg hover:underline focus:underline" href="/details/album?id={currentlyPlaying.album.id}&connection={currentlyPlaying.connection.id}">{currentlyPlaying.album.name}
{/if}
(shuffled ? $queue.reorder() : $queue.shuffle())} class="aspect-square h-16">
$queue.previous()}>
(paused = !paused)} class="relative grid aspect-square h-16 place-items-center rounded-full bg-white text-black"> {#if waiting}
{:else}
{/if}
$queue.next()}>
(loop = !loop)} class="aspect-square h-16">
(volume = volume > 0 ? 0 : Number(localStorage.getItem('volume')))} class="aspect-square h-8">
{ if (volume > 0) localStorage.setItem('volume', volume.toString()) }} />
(expanded = false)}>
$queue.clear()}>
{/if}
(waiting = false)} on:loadstart={() => (waiting = true)} on:waiting={() => (waiting = true)} on:ended={() => $queue.next()} on:error={() => setTimeout(() => audioElement.load(), 5000)} src="/api/audio?connection={currentlyPlaying.connection.id}&id={currentlyPlaying.id}" {loop} />
{/if}