From 9dc3e7006e451f79dd61771e8d19f583df5b625c Mon Sep 17 00:00:00 2001 From: AlacrisDevs Date: Mon, 8 Dec 2025 14:33:45 +0200 Subject: [PATCH] More QoL changes --- messages/en.json | 4 +- messages/et.json | 4 +- package-lock.json | 10 ++-- package.json | 6 +- src/lib/assets/favicon-kuldvillak.svg | 8 --- src/lib/assets/kuldvillak_favicon.svg | 3 + src/lib/components/ErrorBoundary.svelte | 6 +- src/routes/kuldvillak/+layout.svelte | 2 +- src/routes/kuldvillak/play/+page.svelte | 2 + .../kuldvillak/play/ModeratorView.svelte | 58 +++++++++++++------ 10 files changed, 62 insertions(+), 41 deletions(-) delete mode 100644 src/lib/assets/favicon-kuldvillak.svg create mode 100644 src/lib/assets/kuldvillak_favicon.svg diff --git a/messages/en.json b/messages/en.json index beefae4..bd12883 100644 --- a/messages/en.json +++ b/messages/en.json @@ -1,7 +1,7 @@ { "$schema": "https://inlang.com/schema/inlang-message-format", "app_title": "Ultimate Gaming", - "app_version": "V0.01 Student Edition", + "app_version": "v0.1.0", "coming_soon": "Coming Soon", "game_kuldvillak": "Jeopardy", "game_rooside_soda": "Family Feud", @@ -99,7 +99,7 @@ "kv_play_last_answer": "Last", "kv_play_introduce_categories": "Introduce Categories", "kv_play_skip_to_game": "Skip to Game", - "kv_play_introducing_categories": "Introducing Categories...", + "kv_play_introducing_categories": "Introducing categories in {seconds} seconds...", "kv_play_start_game": "Start Game", "kv_play_daily_double": "Daily Double", "kv_play_wager": "Wager", diff --git a/messages/et.json b/messages/et.json index e9e49ae..76a086f 100644 --- a/messages/et.json +++ b/messages/et.json @@ -1,7 +1,7 @@ { "$schema": "https://inlang.com/schema/inlang-message-format", "app_title": "Sassi Mängukoobas", - "app_version": "V0.01 Tudengite Eri", + "app_version": "v0.1.0", "coming_soon": "Tulekul", "game_kuldvillak": "Kuldvillak", "game_rooside_soda": "Rooside Sõda", @@ -99,7 +99,7 @@ "kv_play_last_answer": "Viimane", "kv_play_introduce_categories": "Tutvusta kategooriaid", "kv_play_skip_to_game": "Jäta vahele", - "kv_play_introducing_categories": "Tutvustan kategooriaid...", + "kv_play_introducing_categories": "Tutvustan kategooriaid {seconds} sekundi pärast...", "kv_play_start_game": "Alusta mängu", "kv_play_daily_double": "Hõbevillak", "kv_play_wager": "Panus", diff --git a/package-lock.json b/package-lock.json index d6a4016..ea2c3be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "myapp", - "version": "0.0.1", + "name": "ultimate-gaming", + "version": "0.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "myapp", - "version": "0.0.1", + "name": "ultimate-gaming", + "version": "0.1.0", "devDependencies": { "@inlang/paraglide-js": "^2.5.0", "@sveltejs/adapter-auto": "^7.0.0", @@ -4400,4 +4400,4 @@ "license": "MIT" } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 88be462..2bb8cab 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "myapp", + "name": "ultimate-gaming", "private": true, - "version": "0.0.1", + "version": "0.1.0", "type": "module", "scripts": { "dev": "vite dev", @@ -28,4 +28,4 @@ "vite": "^7.2.2", "vitest": "^2.1.0" } -} +} \ No newline at end of file diff --git a/src/lib/assets/favicon-kuldvillak.svg b/src/lib/assets/favicon-kuldvillak.svg deleted file mode 100644 index e3d8814..0000000 --- a/src/lib/assets/favicon-kuldvillak.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/src/lib/assets/kuldvillak_favicon.svg b/src/lib/assets/kuldvillak_favicon.svg new file mode 100644 index 0000000..fd3cb2b --- /dev/null +++ b/src/lib/assets/kuldvillak_favicon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/lib/components/ErrorBoundary.svelte b/src/lib/components/ErrorBoundary.svelte index 245ec96..eaa4ec3 100644 --- a/src/lib/components/ErrorBoundary.svelte +++ b/src/lib/components/ErrorBoundary.svelte @@ -65,16 +65,16 @@ -

+

{m.error_title?.() ?? "Something went wrong"}

-

+

{m.error_description?.() ?? "An unexpected error occurred. Please try again."}

{m.error_details?.() ?? "Technical details"} diff --git a/src/routes/kuldvillak/+layout.svelte b/src/routes/kuldvillak/+layout.svelte index 058e7a3..da462cb 100644 --- a/src/routes/kuldvillak/+layout.svelte +++ b/src/routes/kuldvillak/+layout.svelte @@ -4,7 +4,7 @@ import { audioStore } from "$lib/stores/audio.svelte"; import { themeStore } from "$lib/stores/theme.svelte"; import type { Snippet } from "svelte"; - import faviconKuldvillak from "$lib/assets/favicon-kuldvillak.svg"; + import faviconKuldvillak from "$lib/assets/kuldvillak_favicon.svg"; let { children }: { children: Snippet } = $props(); diff --git a/src/routes/kuldvillak/play/+page.svelte b/src/routes/kuldvillak/play/+page.svelte index 31fe61d..36bafa0 100644 --- a/src/routes/kuldvillak/play/+page.svelte +++ b/src/routes/kuldvillak/play/+page.svelte @@ -8,12 +8,14 @@ KvSpinner, } from "$lib/components/kuldvillak/ui"; import * as m from "$lib/paraglide/messages"; + import faviconKuldvillak from "$lib/assets/kuldvillak_favicon.svg"; // Get view from URL query param let view = $derived($page.url.searchParams.get("view") ?? "moderator"); + {gameSession.state?.name ?? "Play"} - Kuldvillak diff --git a/src/routes/kuldvillak/play/ModeratorView.svelte b/src/routes/kuldvillak/play/ModeratorView.svelte index 3a76bde..bdcd96f 100644 --- a/src/routes/kuldvillak/play/ModeratorView.svelte +++ b/src/routes/kuldvillak/play/ModeratorView.svelte @@ -22,6 +22,15 @@ // End game confirmation dialog let showEndGameConfirm = $state(false); + // Loading overlay when finishing game + let isFinishing = $state(false); + + async function finishGame() { + isFinishing = true; + gameSession.clearSession(); + await goto("/kuldvillak/edit"); + } + function openProjector() { gameSession.openProjector(); } @@ -34,6 +43,7 @@ let wagerInput = $state(5); let scoreAdjustment = $state(10); let introDelayComplete = $state(false); + let introCountdown = $state(3); let prevIntroPhase = $state(null); // Derived state @@ -46,13 +56,20 @@ phase === "intro-categories" && prevIntroPhase !== "intro-categories" ) { - // Just entered intro-categories, start 3s delay + // Just entered intro-categories, start 3s countdown introDelayComplete = false; - setTimeout(() => { - introDelayComplete = true; - }, 3000); + introCountdown = 3; + const interval = setInterval(() => { + introCountdown--; + if (introCountdown <= 0) { + clearInterval(interval); + introDelayComplete = true; + } + }, 1000); + return () => clearInterval(interval); } else if (phase !== "intro-categories") { introDelayComplete = false; + introCountdown = 3; } prevIntroPhase = phase ?? null; }); @@ -322,7 +339,7 @@ {:else if session.phase === "intro-categories"} {#if !introDelayComplete && session.introCategoryIndex === 0} - + @@ -330,6 +347,13 @@ ? "Villak" : "Topeltvillak"} + + {m.kv_play_introducing_categories({ + seconds: introCountdown, + })} + {:else if currentRound?.categories[session.introCategoryIndex]} {m.kv_play_game_over()}! - { - gameSession.clearSession(); - goto("/kuldvillak/edit"); - }} - > + {m.kv_play_finish()} {/if} -{:else} -
- - {m.kv_play_loading()} - -
{/if} @@ -885,3 +898,14 @@ confirmText={m.kv_play_end_game()} onconfirm={() => gameSession.endGame()} /> + + +{#if isFinishing} +
+
+
+{/if}