From a3f586abdb077dae067d6f020b7d5e8113a2ad82 Mon Sep 17 00:00:00 2001 From: Darshak Parikh Date: Fri, 22 Nov 2024 15:53:51 +0530 Subject: [PATCH] Add prettier-plugin-svelte and format everything --- .github/workflows/main.yml | 2 +- index.html | 15 ++-- src/.prettierrc.json | 4 ++ src/App.svelte | 144 ++++++++++++++++++++----------------- src/Footer.svelte | 30 ++++---- src/Header.svelte | 27 +++---- src/InfoModal.svelte | 56 +++++++-------- src/main.js | 6 +- vite.config.js | 8 +-- 9 files changed, 156 insertions(+), 136 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 441f5a9..cd1d516 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: Build and publish to GitHub Pages on: push: - branches: [ main ] + branches: [main] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/index.html b/index.html index d74d983..13c7e7b 100644 --- a/index.html +++ b/index.html @@ -1,13 +1,16 @@ - + - - - - - + + + + + Obliviate diff --git a/src/.prettierrc.json b/src/.prettierrc.json index e69de29..6b78363 100644 --- a/src/.prettierrc.json +++ b/src/.prettierrc.json @@ -0,0 +1,4 @@ +{ + "plugins": ["prettier-plugin-svelte"], + "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] +} diff --git a/src/App.svelte b/src/App.svelte index bde6936..052b7df 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -112,11 +112,11 @@ cipher, site.toLowerCase(), 10000, - 16 + 16, ); const indices = new Uint8Array(derivedBuffer).map( - (byte) => byte % allowedCharacters.length + (byte) => byte % allowedCharacters.length, ); derivedPassword = Array.from(indices) @@ -133,7 +133,7 @@ } function handleCopyWithoutSymbols() { - copy(derivedPassword.replaceAll(/[^0-9a-z]/ig, "")); + copy(derivedPassword.replaceAll(/[^0-9a-z]/gi, "")); copyWithoutSymbolsText = "Copied!"; setTimeout(() => { copyWithoutSymbolsText = "Copy without symbols"; @@ -141,55 +141,12 @@ } - -
{ showInfoModal = true; - }} /> + }} + />
@@ -199,64 +156,72 @@ id="site" placeholder="GitHub" bind:value={site} - oninput={handleDerive} /> + oninput={handleDerive} + /> { cipher = e.target.value; handleDerive(); - }} /> + }} + /> + class="derived" + /> - + - +