From 472c18a99851397939351dd4cfc50220c84dc4c2 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Fri, 20 Oct 2023 18:08:15 -0500 Subject: Initial skeleton (hehe) commit Signed-off-by: Matt Strapp --- clients/www/src/app.d.ts | 12 ++++++++++++ clients/www/src/app.html | 12 ++++++++++++ clients/www/src/app.postcss | 9 +++++++++ clients/www/src/lib/offlineToast.ts | 33 +++++++++++++++++++++++++++++++++ clients/www/src/routes/+layout.svelte | 33 +++++++++++++++++++++++++++++++++ clients/www/src/routes/+layout.ts | 1 + clients/www/src/routes/+page.svelte | 1 + 7 files changed, 101 insertions(+) create mode 100644 clients/www/src/app.d.ts create mode 100644 clients/www/src/app.html create mode 100644 clients/www/src/app.postcss create mode 100644 clients/www/src/lib/offlineToast.ts create mode 100644 clients/www/src/routes/+layout.svelte create mode 100644 clients/www/src/routes/+layout.ts create mode 100644 clients/www/src/routes/+page.svelte (limited to 'clients/www/src') diff --git a/clients/www/src/app.d.ts b/clients/www/src/app.d.ts new file mode 100644 index 0000000..4c48b71 --- /dev/null +++ b/clients/www/src/app.d.ts @@ -0,0 +1,12 @@ +// See https://kit.svelte.dev/docs/types#app +// for information about these interfaces +// and what to do when importing types + +import 'vite-plugin-pwa/info' + +declare namespace App { + // interface Locals {} + // interface PageData {} + // interface Error {} + // interface Platform {} +} diff --git a/clients/www/src/app.html b/clients/www/src/app.html new file mode 100644 index 0000000..fff52f4 --- /dev/null +++ b/clients/www/src/app.html @@ -0,0 +1,12 @@ + + + + + + + %sveltekit.head% + + +
%sveltekit.body%
+ + diff --git a/clients/www/src/app.postcss b/clients/www/src/app.postcss new file mode 100644 index 0000000..ddaec40 --- /dev/null +++ b/clients/www/src/app.postcss @@ -0,0 +1,9 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; +@tailwind variants; + +html, +body { + @apply h-full overflow-hidden; +} \ No newline at end of file diff --git a/clients/www/src/lib/offlineToast.ts b/clients/www/src/lib/offlineToast.ts new file mode 100644 index 0000000..3ae943e --- /dev/null +++ b/clients/www/src/lib/offlineToast.ts @@ -0,0 +1,33 @@ +import { getToastStore, type ToastSettings } from '@skeletonlabs/skeleton'; + +const toastStore = getToastStore(); + +const offline: ToastSettings = { + message: 'You are currently offline.', + background: 'variant-filled-error', + autohide: false +}; + +const online: ToastSettings = { + message: 'You are back online.', + background: 'variant-filled-success', + autohide: true, + timeout: 3000 +}; + +/** + * Make a toast for if the PWA is ever brought offline for whatever reason. + */ +export default function offlineToast() { + window.addEventListener('offline', () => { + toastStore.clear(); + toastStore.trigger(offline); + }); + + window.addEventListener('online', () => { + toastStore.clear(); + setTimeout(() => { + toastStore.trigger(online); + }, 300); + }); +} diff --git a/clients/www/src/routes/+layout.svelte b/clients/www/src/routes/+layout.svelte new file mode 100644 index 0000000..15780c3 --- /dev/null +++ b/clients/www/src/routes/+layout.svelte @@ -0,0 +1,33 @@ + + + + + {@html webManifest} + + + + + + + + + + + Zelda: Oracle Password Generator + + TODO: SOURCE CODE + + + + + + diff --git a/clients/www/src/routes/+layout.ts b/clients/www/src/routes/+layout.ts new file mode 100644 index 0000000..c8cacf0 --- /dev/null +++ b/clients/www/src/routes/+layout.ts @@ -0,0 +1 @@ +export const prerender = true; \ No newline at end of file diff --git a/clients/www/src/routes/+page.svelte b/clients/www/src/routes/+page.svelte new file mode 100644 index 0000000..2ea190a --- /dev/null +++ b/clients/www/src/routes/+page.svelte @@ -0,0 +1 @@ +TODO: Draw the rest of the owl \ No newline at end of file -- cgit v1.2.3