You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
789 B
27 lines
789 B
<script lang="ts"> |
|
import { onMount, onDestroy } from "svelte"; |
|
import { browser } from "$app/environment"; |
|
import { audioStore } from "$lib/stores/audio.svelte"; |
|
import { themeStore } from "$lib/stores/theme.svelte"; |
|
import type { Snippet } from "svelte"; |
|
import faviconKuldvillak from "$lib/assets/kuldvillak_favicon.svg"; |
|
|
|
let { children }: { children: Snippet } = $props(); |
|
|
|
onMount(() => { |
|
if (browser) { |
|
audioStore.initMusic("/audio/kuldvillak_teema.mp3"); |
|
themeStore.applyTheme(); |
|
} |
|
}); |
|
|
|
onDestroy(() => { |
|
// Don't destroy on navigation within kuldvillak - only when leaving |
|
}); |
|
</script> |
|
|
|
<svelte:head> |
|
<link rel="icon" href={faviconKuldvillak} /> |
|
</svelte:head> |
|
|
|
{@render children()}
|
|
|