Files
gornodox.dev/src/routes/+layout.svelte
T

55 lines
1.2 KiB
Svelte

<script lang="ts">
import favicon from '$lib/assets/favicon.svg';
import { theme } from '$lib/stores/theme';
import { onMount, type Snippet } from 'svelte';
import '../app.css';
//import Loading from '../modules/Loading.svelte';
//import Shimeji from '../modules/Shimeji.svelte';
let { children }: { children: Snippet } = $props();
let bg1: string | null;
let bg2: string | null;
onMount(() => {
const style = window.getComputedStyle(document.documentElement);
bg1 = style.getPropertyValue('--dots-bg-1');
bg2 = style.getPropertyValue('--dots-bg-2');
if (bg2 && bg1) {
window.CSS.registerProperty({
name: '--dots-bg-2',
syntax: '<color>',
inherits: true,
initialValue: bg2
});
window.CSS.registerProperty({
name: '--dots-bg-1',
syntax: '<color>',
inherits: true,
initialValue: bg1
});
}
});
</script>
<svelte:head>
<link rel="icon" href={favicon} />
</svelte:head>
<main
class="text-text m-auto flex min-h-dvh w-full flex-col items-center justify-center overflow-hidden bg-bg-base"
class:dark={$theme === 'dark'}
class:light={$theme === 'light'}
>
{@render children()}
</main>
<style>
main {
transition: all 0.2s ease-in;
}
</style>