From 2074c9c732f6d279f5153688b9e33bdc8c9c7674 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Fri, 15 Sep 2023 13:54:56 -0500 Subject: Here goes nothing! Signed-off-by: Matt Strapp --- .vscode/launch.json | 30 +++++++++ app/.gitignore | 1 + app/package.json | 5 +- app/pnpm-lock.yaml | 59 +++++++++++------- app/src/app.d.ts | 3 + app/src/app.html | 4 +- app/src/lib/index.ts | 1 - app/src/lib/svelte/Navigation.svelte | 11 ++++ app/src/lib/ts/crc32.worker.ts | 8 +++ app/src/routes/+layout.svelte | 117 +++++++++++++++++------------------ app/src/routes/+page.svelte | 64 +------------------ app/src/routes/crc32/+page.svelte | 55 ++++++++++++++++ app/static/favicon.png | Bin 15086 -> 0 bytes app/static/favicon.svg | 1 + app/tailwind.config.ts | 2 +- app/tsconfig.json | 2 +- app/vite.config.ts | 25 +++++++- pnpm-lock.yaml | 4 ++ 18 files changed, 241 insertions(+), 151 deletions(-) create mode 100644 .vscode/launch.json delete mode 100644 app/src/lib/index.ts create mode 100644 app/src/lib/svelte/Navigation.svelte create mode 100644 app/src/lib/ts/crc32.worker.ts create mode 100644 app/src/routes/crc32/+page.svelte delete mode 100644 app/static/favicon.png create mode 100644 app/static/favicon.svg diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..8b550f9 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,30 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch server", + "request": "launch", + "runtimeArgs": ["-F", "website", "dev"], + "runtimeExecutable": "pnpm", + "skipFiles": ["/**"], + "type": "node" + }, + { + "type": "msedge", + "version": "dev", + "request": "launch", + "name": "Launch Edge", + "url": "http://localhost:5173", + "webRoot": "${workspaceFolder}/app" + } + ], + "compounds": [ + { + "name": "Both", + "configurations": ["Launch server", "Launch Edge"] + } + ] +} \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore index 6635cf5..ef995c0 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -3,6 +3,7 @@ node_modules /build /.svelte-kit /package +/dev-dist .env .env.* !.env.example diff --git a/app/package.json b/app/package.json index 379d87b..857d367 100644 --- a/app/package.json +++ b/app/package.json @@ -18,6 +18,7 @@ "@typescript-eslint/parser": "^6.7.0", "@vite-pwa/sveltekit": "^0.2.7", "autoprefixer": "10.4.15", + "crc": "^4.3.2", "eslint": "^8.49.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-svelte": "^2.33.1", @@ -36,10 +37,10 @@ }, "private": true, "scripts": { - "build": "vite build && mv .svelte-kit/output/server/sw.js.map .svelte-kit/output/server/workbox-*.map build/", + "build": "vite build && cp .svelte-kit/output/server/sw.js.map .svelte-kit/output/server/workbox-*.map build/", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "dev": "vite dev", + "dev": "vite dev && rm -rf dev-dist", "format": "prettier --write .", "lint": "prettier --check . && eslint .", "preview": "vite preview" diff --git a/app/pnpm-lock.yaml b/app/pnpm-lock.yaml index 4f11aeb..c6e2d2c 100644 --- a/app/pnpm-lock.yaml +++ b/app/pnpm-lock.yaml @@ -1,5 +1,9 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + dependencies: '@floating-ui/dom': specifier: 1.5.2 @@ -45,6 +49,9 @@ devDependencies: autoprefixer: specifier: 10.4.15 version: 10.4.15(postcss@8.4.29) + crc: + specifier: ^4.3.2 + version: 4.3.2 eslint: specifier: ^8.49.0 version: 8.49.0 @@ -234,7 +241,7 @@ packages: '@babel/helper-plugin-utils': 7.22.5 debug: 4.3.4 lodash.debounce: 4.0.8 - resolve: 1.22.4 + resolve: 1.22.5 transitivePeerDependencies: - supports-color dev: true @@ -1512,8 +1519,8 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@floating-ui/core@1.4.2: - resolution: {integrity: sha512-olUakR5nr9v2ueVr1yomoJnBTkHGqHzL/iK4AhforiJS/wKJgFphAYpZHZzADLv/zNUFuQwqLH3bcoUhFh2E1Q==} + /@floating-ui/core@1.5.0: + resolution: {integrity: sha512-kK1h4m36DQ0UHGj5Ah4db7R0rHemTqqO0QLvUqi1/mUUp3LuAWbWxdxSIf/XsnH9VS6rRVPLJCncjRzUvyCLXg==} dependencies: '@floating-ui/utils': 0.1.3 dev: false @@ -1521,7 +1528,7 @@ packages: /@floating-ui/dom@1.5.2: resolution: {integrity: sha512-6ArmenS6qJEWmwzczWyhvrXRdI/rI78poBcW0h/456+onlabit+2G+QxHx5xTOX60NBJQXjsCLFbW2CmsXpUog==} dependencies: - '@floating-ui/core': 1.4.2 + '@floating-ui/core': 1.5.0 '@floating-ui/utils': 0.1.3 dev: false @@ -1639,7 +1646,7 @@ packages: builtin-modules: 3.3.0 deepmerge: 4.3.1 is-module: 1.0.0 - resolve: 1.22.4 + resolve: 1.22.5 rollup: 2.79.1 dev: true @@ -1717,7 +1724,7 @@ packages: svelte: ^3.54.0 || ^4.0.0-next.0 vite: ^4.0.0 dependencies: - '@sveltejs/vite-plugin-svelte': 2.4.5(svelte@4.2.0)(vite@4.4.9) + '@sveltejs/vite-plugin-svelte': 2.4.6(svelte@4.2.0)(vite@4.4.9) '@types/cookie': 0.5.2 cookie: 0.5.0 devalue: 4.3.2 @@ -1736,7 +1743,7 @@ packages: - supports-color dev: true - /@sveltejs/vite-plugin-svelte-inspector@1.0.4(@sveltejs/vite-plugin-svelte@2.4.5)(svelte@4.2.0)(vite@4.4.9): + /@sveltejs/vite-plugin-svelte-inspector@1.0.4(@sveltejs/vite-plugin-svelte@2.4.6)(svelte@4.2.0)(vite@4.4.9): resolution: {integrity: sha512-zjiuZ3yydBtwpF3bj0kQNV0YXe+iKE545QGZVTaylW3eAzFr+pJ/cwK8lZEaRp4JtaJXhD5DyWAV4AxLh6DgaQ==} engines: {node: ^14.18.0 || >= 16} peerDependencies: @@ -1744,7 +1751,7 @@ packages: svelte: ^3.54.0 || ^4.0.0 vite: ^4.0.0 dependencies: - '@sveltejs/vite-plugin-svelte': 2.4.5(svelte@4.2.0)(vite@4.4.9) + '@sveltejs/vite-plugin-svelte': 2.4.6(svelte@4.2.0)(vite@4.4.9) debug: 4.3.4 svelte: 4.2.0 vite: 4.4.9(@types/node@20.6.0) @@ -1752,14 +1759,14 @@ packages: - supports-color dev: true - /@sveltejs/vite-plugin-svelte@2.4.5(svelte@4.2.0)(vite@4.4.9): - resolution: {integrity: sha512-UJKsFNwhzCVuiZd06jM/psscyNJNDwjQC+qIeb7GBJK9iWeQCcIyfcPWDvbCudfcJggY9jtxJeeaZH7uny93FQ==} + /@sveltejs/vite-plugin-svelte@2.4.6(svelte@4.2.0)(vite@4.4.9): + resolution: {integrity: sha512-zO79p0+DZnXPnF0ltIigWDx/ux7Ni+HRaFOw720Qeivc1azFUrJxTl0OryXVibYNx1hCboGia1NRV3x8RNv4cA==} engines: {node: ^14.18.0 || >= 16} peerDependencies: svelte: ^3.54.0 || ^4.0.0 vite: ^4.0.0 dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 1.0.4(@sveltejs/vite-plugin-svelte@2.4.5)(svelte@4.2.0)(vite@4.4.9) + '@sveltejs/vite-plugin-svelte-inspector': 1.0.4(@sveltejs/vite-plugin-svelte@2.4.6)(svelte@4.2.0)(vite@4.4.9) debug: 4.3.4 deepmerge: 4.3.1 kleur: 4.1.5 @@ -2186,7 +2193,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001534 - electron-to-chromium: 1.4.520 + electron-to-chromium: 1.4.522 node-releases: 2.0.13 update-browserslist-db: 1.0.11(browserslist@4.21.10) dev: true @@ -2347,6 +2354,16 @@ packages: browserslist: 4.21.10 dev: true + /crc@4.3.2: + resolution: {integrity: sha512-uGDHf4KLLh2zsHa8D8hIQ1H/HtFQhyHrc0uhHBcoKGol/Xnb+MPYfUMw7cvON6ze/GUESTudKayDcJC5HnJv1A==} + engines: {node: '>=12'} + peerDependencies: + buffer: '>=6.0.3' + peerDependenciesMeta: + buffer: + optional: true + dev: true + /cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} @@ -2465,8 +2482,8 @@ packages: jake: 10.8.7 dev: true - /electron-to-chromium@1.4.520: - resolution: {integrity: sha512-Frfus2VpYADsrh1lB3v/ft/WVFlVzOIm+Q0p7U7VqHI6qr7NWHYKe+Wif3W50n7JAFoBsWVsoU0+qDks6WQ60g==} + /electron-to-chromium@1.4.522: + resolution: {integrity: sha512-KGKjcafTpOxda0kqwQ72M0tDmX6RsGhUJTy0Hr7slt0+CgHh9Oex8JdjY9Og68dUkTLUlBOJC0A5W5Mw3QSGCg==} dev: true /entities@4.5.0: @@ -3687,7 +3704,7 @@ packages: postcss: 8.4.29 postcss-value-parser: 4.2.0 read-cache: 1.0.0 - resolve: 1.22.4 + resolve: 1.22.5 dev: true /postcss-js@4.0.1(postcss@8.4.29): @@ -3860,8 +3877,8 @@ packages: picomatch: 2.3.1 dev: true - /regenerate-unicode-properties@10.1.0: - resolution: {integrity: sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ==} + /regenerate-unicode-properties@10.1.1: + resolution: {integrity: sha512-X007RyZLsCJVVrjgEFVpLUTZwyOZk3oiL75ZcuYjlIWd6rNJtOjkBwQc5AsRrpbKVkxN6sklw/k/9m2jJYOf8Q==} engines: {node: '>=4'} dependencies: regenerate: 1.4.2 @@ -3896,7 +3913,7 @@ packages: dependencies: '@babel/regjsgen': 0.8.0 regenerate: 1.4.2 - regenerate-unicode-properties: 10.1.0 + regenerate-unicode-properties: 10.1.1 regjsparser: 0.9.1 unicode-match-property-ecmascript: 2.0.0 unicode-match-property-value-ecmascript: 2.1.0 @@ -3924,8 +3941,8 @@ packages: engines: {node: '>=4'} dev: true - /resolve@1.22.4: - resolution: {integrity: sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==} + /resolve@1.22.5: + resolution: {integrity: sha512-qWhv7PF1V95QPvRoUGHxOtnAlEvlXBylMZcjUR9pAumMmveFtcHJRXGIr+TkjfNJVQypqv2qcDiiars2y1PsSg==} hasBin: true dependencies: is-core-module: 2.13.0 @@ -4386,7 +4403,7 @@ packages: postcss-load-config: 4.0.1(postcss@8.4.29) postcss-nested: 6.0.1(postcss@8.4.29) postcss-selector-parser: 6.0.13 - resolve: 1.22.4 + resolve: 1.22.5 sucrase: 3.34.0 transitivePeerDependencies: - ts-node diff --git a/app/src/app.d.ts b/app/src/app.d.ts index 3e4ed20..bf2855f 100644 --- a/app/src/app.d.ts +++ b/app/src/app.d.ts @@ -1,6 +1,9 @@ // 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 {} diff --git a/app/src/app.html b/app/src/app.html index 4480bed..54f3529 100644 --- a/app/src/app.html +++ b/app/src/app.html @@ -2,11 +2,11 @@ - + %sveltekit.head% - +
%sveltekit.body%
diff --git a/app/src/lib/index.ts b/app/src/lib/index.ts deleted file mode 100644 index 856f2b6..0000000 --- a/app/src/lib/index.ts +++ /dev/null @@ -1 +0,0 @@ -// place files you want to import through the `$lib` alias in this folder. diff --git a/app/src/lib/svelte/Navigation.svelte b/app/src/lib/svelte/Navigation.svelte new file mode 100644 index 0000000..20c7d8b --- /dev/null +++ b/app/src/lib/svelte/Navigation.svelte @@ -0,0 +1,11 @@ + + + + + Home! + + CRC32 + diff --git a/app/src/lib/ts/crc32.worker.ts b/app/src/lib/ts/crc32.worker.ts new file mode 100644 index 0000000..0d04c7c --- /dev/null +++ b/app/src/lib/ts/crc32.worker.ts @@ -0,0 +1,8 @@ +import crc32 from 'crc/crc32'; + +onmessage = async (message: MessageEvent) => { + const file = message.data; + const buffer = await file.arrayBuffer(); + const crc = crc32(buffer, 517762881); + postMessage(crc); +}; diff --git a/app/src/routes/+layout.svelte b/app/src/routes/+layout.svelte index 8a70575..a0dd68a 100644 --- a/app/src/routes/+layout.svelte +++ b/app/src/routes/+layout.svelte @@ -1,76 +1,75 @@ - - {@html webManifestLink} + + {@html webManifestLink} + + - - - - - Skeleton - - - - Discord - - - Twitter - - - GitHub - - - - - - + + + + + A! + + + + Frontend Source + + + + + + + + + diff --git a/app/src/routes/+page.svelte b/app/src/routes/+page.svelte index 7cd11ed..1f0a15d 100644 --- a/app/src/routes/+page.svelte +++ b/app/src/routes/+page.svelte @@ -1,5 +1,5 @@ - Coming Soon(TM) + Coming Soon(TM) @@ -7,69 +7,9 @@

Welcome to a placeholder.

- -
-
- - - -
- - -
-

Try editing the following:

-

/src/routes/+layout.svelte

-

/src/routes/+page.svelte

-
-
diff --git a/app/src/routes/crc32/+page.svelte b/app/src/routes/crc32/+page.svelte new file mode 100644 index 0000000..18cc515 --- /dev/null +++ b/app/src/routes/crc32/+page.svelte @@ -0,0 +1,55 @@ + + + + CRC32 + + +
+
+
+ form.requestSubmit()} + required + disabled={disableInput} + > + +

Drop a file here to get its CRC32 checksum.

+
+
+
+ + {#if disableInput} +

Calculating the checksum, this may take time!


+ + {/if} + +
+
diff --git a/app/static/favicon.png b/app/static/favicon.png deleted file mode 100644 index c4e3735..0000000 Binary files a/app/static/favicon.png and /dev/null differ diff --git a/app/static/favicon.svg b/app/static/favicon.svg new file mode 100644 index 0000000..da48ab8 --- /dev/null +++ b/app/static/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/tailwind.config.ts b/app/tailwind.config.ts index 57f3822..5bb3fde 100644 --- a/app/tailwind.config.ts +++ b/app/tailwind.config.ts @@ -20,7 +20,7 @@ export default { themes: { preset: [ { - name: 'crimson', + name: 'wintry', enhancements: true } ] diff --git a/app/tsconfig.json b/app/tsconfig.json index dd9fd5d..a25e61a 100644 --- a/app/tsconfig.json +++ b/app/tsconfig.json @@ -9,7 +9,7 @@ "skipLibCheck": true, "sourceMap": true, "strict": true, - "types": ["vite-plugin-pwa/info", "vite-plugin-pwa"] + "types": ["vite-plugin-pwa/client"] } // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias // diff --git a/app/vite.config.ts b/app/vite.config.ts index 9837a67..00d8472 100644 --- a/app/vite.config.ts +++ b/app/vite.config.ts @@ -8,13 +8,34 @@ export default defineConfig({ sourcemap: true }, css: { - devSourcemap: true, + devSourcemap: true }, plugins: [ sveltekit(), purgeCss(), SvelteKitPWA({ - registerType: 'autoUpdate' + devOptions: { + enabled: true, + type: 'module' + }, + manifest: { + name: "RossTheRoss' Personal Tools", + short_name: 'Dumping Ground', + display: 'fullscreen', + display_override: ['window-controls-overlay', 'standalone', 'minimal-ui'], + icons: [ + { + src: '/favicon.svg', + sizes: 'any', + type: 'image/svg+xml' + } + ] + }, + registerType: 'autoUpdate', + workbox: { + globPatterns: ['**/*.{js,css,html,svg}'], + cleanupOutdatedCaches: true, + } }) ] }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4230777..f924705 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,5 +1,9 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + devDependencies: syncpack: specifier: ^11.2.1 -- cgit v1.2.3