diff --git a/frontend/src/lib/components/CameraScreen.svelte b/frontend/src/lib/components/CameraScreen.svelte index eccb2ba..79c8446 100644 --- a/frontend/src/lib/components/CameraScreen.svelte +++ b/frontend/src/lib/components/CameraScreen.svelte @@ -43,6 +43,12 @@ }; }); + function playSuccessSound() { + const audio = new Audio("/report completed.mp3"); + audio.volume = 0.5; + audio.play().catch((e) => console.error("Error playing sound:", e)); + } + function handleFileUpload(event: Event) { const input = event.target as HTMLInputElement; const file = input.files?.[0]; @@ -67,6 +73,7 @@ analyzing = false; showResult = true; resultTranslateY = 0; + playSuccessSound(); typeText(); }, 1200); }; @@ -99,6 +106,7 @@ analyzing = false; showResult = true; resultTranslateY = 0; + playSuccessSound(); typeText(); }, 1200); } diff --git a/frontend/src/lib/components/CustomTabBar.svelte b/frontend/src/lib/components/CustomTabBar.svelte index d71b55a..f78f512 100644 --- a/frontend/src/lib/components/CustomTabBar.svelte +++ b/frontend/src/lib/components/CustomTabBar.svelte @@ -41,7 +41,14 @@ }, ]; + function playClickSound() { + const audio = new Audio("/clickpagesound.mp3"); + audio.volume = 0.4; + audio.play().catch((e) => console.error("Error playing sound:", e)); + } + function navigateToTab(route: string) { + playClickSound(); goto(route); } diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelte index b10172c..c80404b 100644 --- a/frontend/src/routes/+layout.svelte +++ b/frontend/src/routes/+layout.svelte @@ -64,6 +64,12 @@ recentItems = [item, ...recentItems]; } + function playClickSound() { + const audio = new Audio("/clickpagesound.mp3"); + audio.volume = 0.4; + audio.play().catch((e) => console.error("Error playing sound:", e)); + } + const navLinks = [ { name: "Home", route: "/", icon: "ri:home-4-line" }, { name: "Goal", route: "/goal", icon: "ri:flag-2-line" }, @@ -114,12 +120,17 @@ href={link.route} class="nav-link" class:active={$page.route.id === link.route} + onclick={playClickSound} > {link.name} {/each} - + Browse Catalogue diff --git a/frontend/static/clickpagesound.mp3 b/frontend/static/clickpagesound.mp3 new file mode 100644 index 0000000..2434758 Binary files /dev/null and b/frontend/static/clickpagesound.mp3 differ diff --git a/frontend/static/report completed.mp3 b/frontend/static/report completed.mp3 new file mode 100644 index 0000000..e690107 Binary files /dev/null and b/frontend/static/report completed.mp3 differ