run svelte 5 migration and update deps

This commit is contained in:
Satria 2026-03-19 10:12:29 +07:00
commit 7d9254beb6
4 changed files with 134 additions and 76 deletions

View file

@ -2,9 +2,14 @@
import type { PageData } from './$types';
import "../app.css";
import { onMount } from 'svelte';
export let data: PageData;
interface Props {
data: PageData;
children?: import('svelte').Snippet;
}
let loaded = false;
let { data, children }: Props = $props();
let loaded = $state(false);
onMount(() => {
const handleVisibilityChange = () => loaded = document.visibilityState === 'visible';
document.addEventListener('visibilitychange', handleVisibilityChange);
@ -19,5 +24,5 @@
</svelte:head>
{#if loaded}
<slot />
{@render children?.()}
{/if}

View file

@ -3,7 +3,6 @@
import { daysUntilBirthday, getTimeIn, randomStr } from "$lib";
import { onMount } from "svelte";
import type { PageData } from "./$types";
export let data: PageData;
import {
blur,
crossfade,
@ -16,10 +15,15 @@
import {
cubicOut
} from 'svelte/easing';
interface Props {
data: PageData;
}
let { data }: Props = $props();
let days = daysUntilBirthday(data.birthday);
let time = getTimeIn(data.timezone);
let charAmount = 0;
let charAmount = $state(0);
let webring = $page.url.searchParams.has('webring');
onMount(() => {