2024-01-25 19:50:26 -05:00
|
|
|
<script lang="ts">
|
2024-04-05 02:00:17 -04:00
|
|
|
import MediaPlayer from '$lib/components/media/mediaPlayer.svelte'
|
2024-07-18 22:52:08 -04:00
|
|
|
import Navbar from '$lib/components/util/navbar.svelte'
|
|
|
|
|
import Sidebar from '$lib/components/util/sidebar.svelte'
|
|
|
|
|
import { queue } from '$lib/stores'
|
2024-06-21 03:35:00 -04:00
|
|
|
|
|
|
|
|
// I'm thinking I might want to make /albums, /artists, and /playlists all there own routes and just wrap them in a (library) layout
|
2024-07-18 22:52:08 -04:00
|
|
|
let sidebar: Sidebar
|
|
|
|
|
|
|
|
|
|
$: currentlyPlaying = $queue.current
|
|
|
|
|
$: shuffled = $queue.isShuffled
|
2024-01-26 01:30:18 -05:00
|
|
|
</script>
|
|
|
|
|
|
2024-06-10 03:22:12 -04:00
|
|
|
<main id="grid-wrapper" class="h-full">
|
2024-07-18 22:52:08 -04:00
|
|
|
<Navbar on:opensidebar={sidebar.open} />
|
|
|
|
|
<Sidebar bind:this={sidebar} />
|
|
|
|
|
<section id="content-wrapper" class="overflow-y-scroll no-scrollbar">
|
2024-04-05 02:00:17 -04:00
|
|
|
<slot />
|
|
|
|
|
</section>
|
2024-07-18 22:52:08 -04:00
|
|
|
{#if currentlyPlaying}
|
|
|
|
|
<MediaPlayer
|
|
|
|
|
mediaItem={currentlyPlaying}
|
|
|
|
|
{shuffled}
|
|
|
|
|
mediaSession={'mediaSession' in navigator ? navigator.mediaSession : null}
|
|
|
|
|
on:stop={() => $queue.clear()}
|
|
|
|
|
on:next={() => $queue.next()}
|
|
|
|
|
on:previous={() => $queue.previous()}
|
|
|
|
|
on:toggleShuffle={() => $queue.toggleShuffle()}
|
|
|
|
|
/>
|
|
|
|
|
{/if}
|
2024-06-10 03:22:12 -04:00
|
|
|
</main>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
#grid-wrapper {
|
2024-07-18 22:52:08 -04:00
|
|
|
display: grid;
|
|
|
|
|
grid-template-rows: min-content auto;
|
2024-07-04 02:54:24 -04:00
|
|
|
}
|
2024-06-10 03:22:12 -04:00
|
|
|
</style>
|