From e2b3df0508751d982c76752435390e958eb73b13 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Sat, 20 Jan 2024 11:27:31 -0600 Subject: Migrate repos Signed-off-by: Matt Strapp --- clients/www/LICENSE | 21 ++++++++++++++ clients/www/package.json | 4 +-- clients/www/src/lib/components/ReloadPrompt.svelte | 32 +++++++++++++++++++++ clients/www/src/lib/offlineToast.ts | 33 ---------------------- clients/www/src/routes/+layout.svelte | 9 ++++-- clients/www/src/routes/+page.svelte | 4 ++- clients/www/svelte.config.js | 2 +- 7 files changed, 66 insertions(+), 39 deletions(-) create mode 100644 clients/www/LICENSE create mode 100644 clients/www/src/lib/components/ReloadPrompt.svelte delete mode 100644 clients/www/src/lib/offlineToast.ts (limited to 'clients/www') diff --git a/clients/www/LICENSE b/clients/www/LICENSE new file mode 100644 index 0000000..f328a5d --- /dev/null +++ b/clients/www/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Matthew Strapp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/clients/www/package.json b/clients/www/package.json index ec7075a..7a84ae8 100644 --- a/clients/www/package.json +++ b/clients/www/package.json @@ -1,6 +1,6 @@ { - "name": "website", - "description": "The actual website", + "name": "zorascript-web", + "description": "A Svelte interface for ZoraScript", "version": "0.0.1", "private": true, "license": "MIT", diff --git a/clients/www/src/lib/components/ReloadPrompt.svelte b/clients/www/src/lib/components/ReloadPrompt.svelte new file mode 100644 index 0000000..e6effbb --- /dev/null +++ b/clients/www/src/lib/components/ReloadPrompt.svelte @@ -0,0 +1,32 @@ + diff --git a/clients/www/src/lib/offlineToast.ts b/clients/www/src/lib/offlineToast.ts deleted file mode 100644 index 3ae943e..0000000 --- a/clients/www/src/lib/offlineToast.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 index 15780c3..12996ec 100644 --- a/clients/www/src/routes/+layout.svelte +++ b/clients/www/src/routes/+layout.svelte @@ -1,4 +1,5 @@