From 5a6950899fec81795d9b6b9094ee6ac95a8774ad Mon Sep 17 00:00:00 2001 From: Pablu23 Date: Wed, 8 Oct 2025 10:34:38 +0200 Subject: [PATCH] Kinda working, dragging and dropping is working good --- src/routes/game/+page.svelte | 737 +++++++++++++++++++++-------------- 1 file changed, 451 insertions(+), 286 deletions(-) diff --git a/src/routes/game/+page.svelte b/src/routes/game/+page.svelte index deba82a..c05d7ed 100644 --- a/src/routes/game/+page.svelte +++ b/src/routes/game/+page.svelte @@ -1,290 +1,455 @@ -
-
- -
-

Music Guessing Game

- -
-
- -
-
- {previousPlayer?.name.substring(0, 2).toUpperCase() || '??'} -
- Previous -
- - -
-
- {currentPlayer?.name.substring(0, 2).toUpperCase() || '??'} -
- {currentPlayer?.name || 'Current'} -
- - -
-
- {nextPlayer?.name.substring(0, 2).toUpperCase() || '??'} -
- Next -
-
- - {#if isCurrentPlayer} -
- Your turn! -
- {:else} -
- Waiting for {currentPlayer?.name || 'current player'} to make a move... -
- {/if} -
-
- - -
-
- - -
- -
-
-
- - -
- -
-
- - {#each cards as card (card.id)} -
-
{card.artist}
-
{card.year}
-
{card.songTitle}
-
- {/each} -
-
- - -
- {#if middleCard.isFlipped} - -
- Music card -
- {:else} - -
-
{middleCard.artist}
-
{middleCard.year}
-
{middleCard.songTitle}
-
- {/if} -
- - -
- {#each Array(cards.length + 1) as _, i} - - {/each} -
-
- -
- {#if isCurrentPlayer} - Drag the mystery card and place it where you think it belongs in the timeline! - {:else} - Watch as {currentPlayer?.name || 'the current player'} makes their guess! - {/if} -
-
+
+ +
+
+
+ {#if getPlayerInfo().previous} +
+ Previous + PREVIOUS PLACE {getPlayerInfo().previous.name} +
+ {/if} + +
+ Current + {getPlayerInfo().current?.name} +
+ + {#if getPlayerInfo().next} +
+ Next + {getPlayerInfo().next.name} +
+ {/if} +
+ +
+ {players.length} Players +
+
+
+ + +
+ +
+
+ + +
+ +
+ {formatTime(audioProgress)} + {formatTime(audioDuration)} +
+
+
+
+ + +
+ +
+
+
+ {#each placedCards as card, index} + +
+
+
Artist
+
{card.artist}
+ +
+
{card.year}
+
+ +
Title
+
{card.title}
+
+
+ {/each} + + +
+
+
+
+ + + {#if currentCard} +
+
+
+
Artist
+
{currentCard.artist}
+ +
+
{currentCard.year}
+
+ +
Title
+
{currentCard.title}
+
+
+
+ {:else} + +
+
+ Waiting for next card... +
+
+ {/if} +
+
+ +