converted to proper npm sveltekit project

This commit is contained in:
C-West8
2026-07-22 14:52:35 -05:00
parent ba0a445aaf
commit 086542169c
37 changed files with 6018 additions and 14 deletions

15
src/lib/toast.svelte.ts Normal file
View File

@@ -0,0 +1,15 @@
// Tiny shared toast controller. Import `toast` anywhere and call toast.show('...').
class ToastController {
message = $state('');
visible = $state(false);
#timer: ReturnType<typeof setTimeout> | null = null;
show(msg: string, ms = 2200): void {
this.message = msg;
this.visible = true;
if (this.#timer) clearTimeout(this.#timer);
this.#timer = setTimeout(() => (this.visible = false), ms);
}
}
export const toast = new ToastController();