57 lines
1.2 KiB
Svelte
Executable File
57 lines
1.2 KiB
Svelte
Executable File
<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-dots-bg bg-size-[20px_20px]"
|
|
class:dark={$theme === 'dark'}
|
|
class:light={$theme === 'light'}
|
|
>
|
|
{@render children()}
|
|
</main>
|
|
|
|
<style>
|
|
main {
|
|
transition:
|
|
--dots-bg-2 0.2s ease-in,
|
|
--dots-bg-1 0.2s ease-in;
|
|
}
|
|
</style>
|