From d63c2e60a7953e045d40390f1b5f098b69da68f0 Mon Sep 17 00:00:00 2001 From: JovannMC Date: Wed, 13 Nov 2024 20:34:23 +0300 Subject: [PATCH] Format code oops (also add image of VERT to readme too) --- README.md | 12 +++++----- src/lib/components/functional/Uploader.svelte | 7 +++++- src/lib/store/index.svelte.ts | 2 +- src/routes/+page.svelte | 4 +++- src/routes/convert/+page.svelte | 22 +++++++++++-------- 5 files changed, 30 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index c3140f0..5f5c010 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ # VERT +![Image of VERT on an old computer monitor](/src/lib/assets/VERT_Feature.webp) + VERT is a file conversion utility for the web that uses WebAssembly to convert files directly on your device instead of on a cloud. Check out the live instance at [vert.sh](https://vert.sh). VERT is built with Svelte & TypeScript (using [bun](https://bun.sh)). ## Development -- Clone the project - `git clone https://github.com/not-nullptr/VERT.git` -- Use [bun](https://bun.sh) to install the dependencies - `bun install` -- Copy the contents of `.env.example` into `.env` and make any changes (if wanted) -- Start a dev environment & make your changes - `bun run dev` -- Build and preview for production - `bun run build` & `bun run preview` +- Clone the project - `git clone https://github.com/not-nullptr/VERT.git` +- Use [bun](https://bun.sh) to install the dependencies - `bun install` +- Copy the contents of `.env.example` into `.env` and make any changes (if wanted) +- Start a dev environment & make your changes - `bun run dev` +- Build and preview for production - `bun run build` & `bun run preview` diff --git a/src/lib/components/functional/Uploader.svelte b/src/lib/components/functional/Uploader.svelte index 28beb68..e01e087 100644 --- a/src/lib/components/functional/Uploader.svelte +++ b/src/lib/components/functional/Uploader.svelte @@ -21,7 +21,12 @@ let fileInput = $state(); let dragOver = $state(false); - let { files = $bindable(), onupload, isMobile, acceptedFormats }: Props = $props(); + let { + files = $bindable(), + onupload, + isMobile, + acceptedFormats, + }: Props = $props(); function upload() { if (!fileInput) return; diff --git a/src/lib/store/index.svelte.ts b/src/lib/store/index.svelte.ts index f2119f8..9e67895 100644 --- a/src/lib/store/index.svelte.ts +++ b/src/lib/store/index.svelte.ts @@ -19,4 +19,4 @@ class Files { export const files = new Files(); -export const outputFilenameOption = ['default', 'original']; +export const outputFilenameOption = ["default", "original"]; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 6f63688..526bfa7 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -86,7 +86,9 @@ isMobile={data.isMobile} bind:files={ourFiles} onupload={runUpload} - acceptedFormats={[...new Set(converters.flatMap((c) => c.supportedFormats))]} + acceptedFormats={[ + ...new Set(converters.flatMap((c) => c.supportedFormats)), + ]} /> diff --git a/src/routes/convert/+page.svelte b/src/routes/convert/+page.svelte index 97e2771..428394c 100644 --- a/src/routes/convert/+page.svelte +++ b/src/routes/convert/+page.svelte @@ -45,7 +45,7 @@ const allConvertersReady = $derived( convertersRequired.every((c) => c.ready), ); - + // Options let outputFilename = $state(outputFilenameOption[0]); @@ -56,10 +56,10 @@ }); // reloads the "output filename" option - const savedOption = localStorage.getItem('outputFilename'); - if (savedOption) { - outputFilename = savedOption; - } + const savedOption = localStorage.getItem("outputFilename"); + if (savedOption) { + outputFilename = savedOption; + } }); let disabled = $derived(files.files.some((f) => !f.result)); @@ -134,9 +134,10 @@ if (files.files.length === 0) return; if (files.files.length === 1) { // download the image only - const filename = outputFilename === "default" - ? `VERT-Converted_${date}` - : files.files[0].file.name.replace(/\.[^/.]+$/, ""); + const filename = + outputFilename === "default" + ? `VERT-Converted_${date}` + : files.files[0].file.name.replace(/\.[^/.]+$/, ""); const blob = URL.createObjectURL( new Blob([dlFiles[0].input], { type: files.files[0].to.slice(1), @@ -204,7 +205,10 @@ selected={outputFilename} onselect={(o) => { outputFilename = o; - localStorage.setItem('outputFilename', o); + localStorage.setItem( + "outputFilename", + o, + ); }} />