diff options
author | Matt Strapp <matt@mattstrapp.net> | 2023-09-29 10:11:33 -0500 |
---|---|---|
committer | Matt Strapp <matt@mattstrapp.net> | 2023-09-29 10:11:33 -0500 |
commit | 11ece69e006b446b9ca4e06eb5af5662bc811469 (patch) | |
tree | 29dbb0b4b88aa9eae29d80f5ebc08b8f710f51f8 /app/src/routes | |
parent | Update dep + fix build (diff) | |
download | trinkets-11ece69e006b446b9ca4e06eb5af5662bc811469.tar trinkets-11ece69e006b446b9ca4e06eb5af5662bc811469.tar.gz trinkets-11ece69e006b446b9ca4e06eb5af5662bc811469.tar.bz2 trinkets-11ece69e006b446b9ca4e06eb5af5662bc811469.tar.lz trinkets-11ece69e006b446b9ca4e06eb5af5662bc811469.tar.xz trinkets-11ece69e006b446b9ca4e06eb5af5662bc811469.tar.zst trinkets-11ece69e006b446b9ca4e06eb5af5662bc811469.zip |
Formatting
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to '')
-rw-r--r-- | app/src/routes/+layout.svelte | 24 | ||||
-rw-r--r-- | app/src/routes/+layout.ts | 2 | ||||
-rw-r--r-- | app/src/routes/+page.svelte | 9 | ||||
-rw-r--r-- | app/src/routes/truncate/+page.svelte | 48 |
4 files changed, 41 insertions, 42 deletions
diff --git a/app/src/routes/+layout.svelte b/app/src/routes/+layout.svelte index 087465b..df0f707 100644 --- a/app/src/routes/+layout.svelte +++ b/app/src/routes/+layout.svelte @@ -1,34 +1,34 @@ <script lang="ts"> - import Navigation from '$lib/svelte/Navigation.svelte'; - import Icon from '@iconify/svelte'; - import menuIcon from '@iconify/icons-carbon/menu'; + import Navigation from '$lib/svelte/Navigation.svelte' + import Icon from '@iconify/svelte' + import menuIcon from '@iconify/icons-carbon/menu' import { AppBar, AppShell, Drawer, Toast, getDrawerStore, - initializeStores - } from '@skeletonlabs/skeleton'; - import { pwaInfo } from 'virtual:pwa-info'; - import '../app.postcss'; + initializeStores, + } from '@skeletonlabs/skeleton' + import { pwaInfo } from 'virtual:pwa-info' + import '../app.postcss' // Floating UI for Popups // import { computePosition, autoUpdate, flip, shift, offset, arrow } from '@floating-ui/dom'; // import { storePopup } from '@skeletonlabs/skeleton'; // storePopup.set({ computePosition, autoUpdate, flip, shift, offset, arrow }); - initializeStores(); + initializeStores() - const drawerStore = getDrawerStore(); + const drawerStore = getDrawerStore() function drawerOpen() { drawerStore.open({ - width: 'w-[80px]' - }); + width: 'w-[80px]', + }) } - $: webManifestLink = pwaInfo ? pwaInfo.webManifest.linkTag : ''; + $: webManifestLink = pwaInfo ? pwaInfo.webManifest.linkTag : '' </script> <svelte:head> diff --git a/app/src/routes/+layout.ts b/app/src/routes/+layout.ts index 189f71e..176ae64 100644 --- a/app/src/routes/+layout.ts +++ b/app/src/routes/+layout.ts @@ -1 +1 @@ -export const prerender = true; +export const prerender = true diff --git a/app/src/routes/+page.svelte b/app/src/routes/+page.svelte index e34c31e..123282c 100644 --- a/app/src/routes/+page.svelte +++ b/app/src/routes/+page.svelte @@ -1,15 +1,14 @@ <svelte:head> - <title>Coming Soon(TM)</title> + <title>Coming Soon(TM)</title> </svelte:head> <!-- YOU CAN DELETE EVERYTHING IN THIS PAGE --> <div class="container h-full mx-auto flex justify-center items-center"> - <div class="space-y-10 text-center flex flex-col items-center"> - <h2 class="h2">Welcome to a placeholder.</h2> - </div> + <div class="space-y-10 text-center flex flex-col items-center"> + <h2 class="h2">Welcome to a placeholder.</h2> + </div> </div> <style lang="postcss"> - </style> diff --git a/app/src/routes/truncate/+page.svelte b/app/src/routes/truncate/+page.svelte index 635b6bc..6db6d25 100644 --- a/app/src/routes/truncate/+page.svelte +++ b/app/src/routes/truncate/+page.svelte @@ -1,36 +1,36 @@ <script lang="ts"> - import saveFile from '$lib/ts/download'; - import type { TruncateRequest, TruncateResponse } from '$lib/types/truncate-worker'; - import Icon from '@iconify/svelte'; - import fileStorage from '@iconify/icons-carbon/file-storage'; - import { FileDropzone, ProgressBar } from '@skeletonlabs/skeleton'; - import { onDestroy, onMount } from 'svelte'; + import saveFile from '$lib/ts/download' + import type { TruncateRequest, TruncateResponse } from '$lib/types/truncate-worker' + import Icon from '@iconify/svelte' + import fileStorage from '@iconify/icons-carbon/file-storage' + import { FileDropzone, ProgressBar } from '@skeletonlabs/skeleton' + import { onDestroy, onMount } from 'svelte' - let disableInput = false; - let files: FileList; - let form: HTMLFormElement; - let worker: Worker; - $: truncateTo = 1; - let originalName: string; + let disableInput = false + let files: FileList + let form: HTMLFormElement + let worker: Worker + $: truncateTo = 1 + let originalName: string function onUpload() { - disableInput = true; - originalName = files[0].name; + disableInput = true + originalName = files[0].name worker.postMessage({ file: files[0], - size: truncateTo - } as TruncateRequest); + size: truncateTo, + } as TruncateRequest) } onMount(async () => { - worker = new Worker(new URL('$lib/ts/truncate.worker.ts', import.meta.url), { type: 'module' }); + worker = new Worker(new URL('$lib/ts/truncate.worker.ts', import.meta.url), { type: 'module' }) worker.onmessage = async (e: MessageEvent<TruncateResponse>) => { - await saveFile(e.data.file, `trunc-${originalName}`).catch((e) => console.error(e)); - disableInput = false; - form.reset(); - truncateTo = 1; - }; - }); + await saveFile(e.data.file, `trunc-${originalName}`).catch((e) => console.error(e)) + disableInput = false + form.reset() + truncateTo = 1 + } + }) onDestroy(() => { worker?.terminate() @@ -60,7 +60,7 @@ > <svelte:fragment slot="lead"> <div class="flex justify-center items-center"> - <Icon icon={fileStorage} width="50" /> + <Icon icon={fileStorage} width="50" /> </div> </svelte:fragment> <svelte:fragment slot="meta">Drop a file here to truncate it.</svelte:fragment> |