From a94b30e17626ea43aaabf9f7a67f23798c4d5248 Mon Sep 17 00:00:00 2001 From: Christofer Date: Fri, 15 Sep 2023 20:46:48 +0400 Subject: [PATCH] . --- .vscode/extensions.json | 3 + scripts/critical.mjs | 27 ------ scripts/generate-smaller-image-sizes.sh | 22 ----- src/lib/Helper.mjs | 1 + src/lib/components/Quotes.js | 26 +++++- src/routes/+layout.svelte | 3 +- src/routes/CommunitySlice.svelte | 3 +- src/routes/DiscordProfilePicture.svelte | 2 +- src/routes/FameRicePreview.svelte | 2 +- src/routes/Firefly.svelte | 106 ------------------------ src/routes/Hypractive.svelte | 22 +++-- src/routes/Navbar.svelte | 2 - src/routes/SmoothCircle.svelte | 80 ------------------ src/routes/wall_of_fame/Contest.svelte | 1 + 14 files changed, 50 insertions(+), 250 deletions(-) create mode 100755 .vscode/extensions.json delete mode 100755 scripts/critical.mjs delete mode 100755 scripts/generate-smaller-image-sizes.sh delete mode 100755 src/routes/Firefly.svelte delete mode 100755 src/routes/SmoothCircle.svelte diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100755 index 0000000..b9a9505 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["bradlc.vscode-tailwindcss", "svelte.svelte-vscode"] +} diff --git a/scripts/critical.mjs b/scripts/critical.mjs deleted file mode 100755 index b9d4fc2..0000000 --- a/scripts/critical.mjs +++ /dev/null @@ -1,27 +0,0 @@ -import { generate } from 'critical' - -generate({ - inline: true, - base: 'build/', - src: 'index.html', - target: 'index-critical.html', - width: 1300, - height: 900 -}) -// generate({ -// inline: true, -// base: 'build/', -// src: 'index.html', -// target: 'index.c.html', - -// dimensions: [ -// { -// width: 1200, -// height: 900 -// }, -// { -// width: 480, -// height: 900 -// } -// ] -// }) diff --git a/scripts/generate-smaller-image-sizes.sh b/scripts/generate-smaller-image-sizes.sh deleted file mode 100755 index be64eba..0000000 --- a/scripts/generate-smaller-image-sizes.sh +++ /dev/null @@ -1,22 +0,0 @@ -parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) - -cd "$parent_path" - -find "../static/imgs/profile_pictures/" -type f \ - \( -iname "*.jpg" -o -iname "*.png" -o -iname "*.gif" -o -iname "*.bmp" -o -iname "*.jpeg" -o -iname "*.webp" \) -not -name "generated_*" -print0 | - -while IFS= read -r -d '' filepath; do - echo "$filepath" gets blurred - - directory=$(dirname "$filepath") - filename=$(basename "$filepath") - - - for SIZE in 100x100 64x64 48x48 32x32 - do - generated_filename="${directory}/generated_${SIZE}-${filename}" - - magick "$filepath" --resize "${SIZE}" "${generated_filename}" - done - -done diff --git a/src/lib/Helper.mjs b/src/lib/Helper.mjs index 6a522c3..13bb13e 100755 --- a/src/lib/Helper.mjs +++ b/src/lib/Helper.mjs @@ -96,6 +96,7 @@ export function getBlurredPath(path) { return `${path.substring(0, path.lastIndexOf('/'))}/generated_${path.split('/').at(-1)}` } +/** Get a random item from an array */ export function getRandom(array) { return array.at(Math.floor(Math.random() * array.length)) } diff --git a/src/lib/components/Quotes.js b/src/lib/components/Quotes.js index 162d0ce..a56d110 100755 --- a/src/lib/components/Quotes.js +++ b/src/lib/components/Quotes.js @@ -9,5 +9,29 @@ Lt. Dixon Piper: That's really f***ed up. MacGruber: -Thanks.` +Thanks.`, + + `MacGruber: +Looks like you're keeping your bod pretty tight. + +Frank Korver: +You're looking pretty good yourself. + +MacGruber: +Well, everday's a workout when you gotta carry around a 20 pound python in your jeans. + +Frank Korver: +You and your dick comments. + +MacGruber: +It's fun to say them. + +Frank Korver: +It's fun to hear them. + +MacGruber: +That's why I say them. + +Frank Korver: +And that's why I listen.` ] diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 556058c..082cb97 100755 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -6,10 +6,11 @@ import '@fontsource-variable/work-sans' import '@fontsource/ibm-plex-mono/500.css' import { quotes } from '$lib/components/Quotes' + import { getRandom } from '$lib/Helper.mjs' onMount(() => { if (import.meta.env.PROD) { - console.log(quotes.at(Math.floor(Math.random() * quotes.length))) + console.log(getRandom(quotes)) } }) diff --git a/src/routes/CommunitySlice.svelte b/src/routes/CommunitySlice.svelte index f780f31..ca047d9 100755 --- a/src/routes/CommunitySlice.svelte +++ b/src/routes/CommunitySlice.svelte @@ -162,7 +162,8 @@ image: '/imgs/profile_pictures/jacekpoz.svg', coordinates: [180, 730], size: 80, - class: 'outline-yellow-500 bg-orange-700' + class: 'outline-yellow-500 bg-orange-700', + quote: '"Piss blob"' } ] diff --git a/src/routes/DiscordProfilePicture.svelte b/src/routes/DiscordProfilePicture.svelte index ca021c2..4886947 100755 --- a/src/routes/DiscordProfilePicture.svelte +++ b/src/routes/DiscordProfilePicture.svelte @@ -76,7 +76,7 @@ } onMount(() => { - // Nesecarry as the load image load event might not get fired when its already loaded + // Nesecarry as the load image event might not get fired when its already loaded ( for example after a page reload ) hasImageLoaded = hasImageLoaded || imageElement.complete }) diff --git a/src/routes/FameRicePreview.svelte b/src/routes/FameRicePreview.svelte index c8f92f4..6a78cd8 100755 --- a/src/routes/FameRicePreview.svelte +++ b/src/routes/FameRicePreview.svelte @@ -10,7 +10,7 @@ /** @type {string | undefined} */ export let containerClass = undefined /** @type {string} - * The path to the image. Usually the file within `static`, but can also be an URL + * The path to the image. Usually the file within `static`, but can also be an URL. Defaults to `generated_` */ export let blurredBackground = undefined diff --git a/src/routes/Firefly.svelte b/src/routes/Firefly.svelte deleted file mode 100755 index 4a7b017..0000000 --- a/src/routes/Firefly.svelte +++ /dev/null @@ -1,106 +0,0 @@ - - -