From 51f5a1b1de7002be2f5551b1181d0a82a0098039 Mon Sep 17 00:00:00 2001 From: gammelalf Date: Tue, 24 Jan 2023 12:37:33 +0100 Subject: Changed basic layout --- web/src/app.html | 2 +- web/src/routes/+page.svelte | 86 +++++++++++++++++++++++++++++++-------------- web/static/client.css | 9 ++++- 3 files changed, 69 insertions(+), 28 deletions(-) diff --git a/web/src/app.html b/web/src/app.html index 1d67ac6..2404d44 100644 --- a/web/src/app.html +++ b/web/src/app.html @@ -8,6 +8,6 @@ %sveltekit.head% -
%sveltekit.body%
+ %sveltekit.body% diff --git a/web/src/routes/+page.svelte b/web/src/routes/+page.svelte index 3855c2a..ba9bd98 100644 --- a/web/src/routes/+page.svelte +++ b/web/src/routes/+page.svelte @@ -18,6 +18,9 @@ let socket: WebSocket; onMount(function () { socket = new WebSocket('ws://localhost:8080/ws'); + // Expose websocket for debugging + // ts-ignore + window.WS = socket; console.info('Attempting Connection...'); socket.onopen = () => { @@ -101,38 +104,29 @@ } -
-

Currently Playing

-

{currentSong?.title || 'Nothing'}

-
- -
+

Add your song

- + - {#each searchResults as { title, artist, source, uri, weight } (uri)} -
- - {artist + ' - ' + title} - {source} -
- {/each}
+ {#each searchResults as { title, artist, source, uri, weight } (uri)} +
+ + {artist + ' - ' + title} + {source} +
+ {/each}

Playlist

@@ -146,9 +140,49 @@ {/each}
+ +
+ +

+ {#if currentSong !== null} + {currentSong.title}
{currentSong.artist} + {:else} + No songs schedulded :(
Try adding some. + {/if} +

+