From 687fff643da22db3dc07385b6555790bd8b49332 Mon Sep 17 00:00:00 2001 From: ld3zian <42660576+ld3z@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:57:30 -0700 Subject: [PATCH] added flashbang mode --- src/components/ComicCard.astro | 88 +++++++++++++++++++-------- src/components/LanguageSelector.astro | 16 +++-- src/components/RSSLink.astro | 5 +- src/components/ThemeToggle.astro | 82 +++++++++++++++++++++++++ src/layouts/Layout.astro | 45 +++++++++++++- src/lib/api.ts | 25 ++++++-- src/pages/[lang]/[type].astro | 9 +-- 7 files changed, 227 insertions(+), 43 deletions(-) create mode 100644 src/components/ThemeToggle.astro diff --git a/src/components/ComicCard.astro b/src/components/ComicCard.astro index e504109..543bb63 100644 --- a/src/components/ComicCard.astro +++ b/src/components/ComicCard.astro @@ -9,28 +9,47 @@ interface Props { const { comic } = Astro.props; -// Determine if the file is AVIF based on the URL -const isAvif = comic.md_comics.md_covers[0]?.b2key.endsWith('.avif'); - const coverUrl = comic.md_comics.md_covers[0] ? `https://meo.comick.pictures/${comic.md_comics.md_covers[0].b2key}` : '/placeholder.png'; + +// Determine if the file is AVIF based on the URL +const isAvif = comic.md_comics.md_covers[0]?.b2key.endsWith('.avif'); + +// Define standard image dimensions +const IMG_WIDTH = 250; +const IMG_HEIGHT = 350; + +// Generate optimized image URL with dimensions +const optimizedCoverUrl = coverUrl.includes('meo.comick.pictures') + ? `${coverUrl}?width=${IMG_WIDTH}&quality=80` + : coverUrl; --- +