From e4133880cb4ed40705cca8c322edb9275d797c97 Mon Sep 17 00:00:00 2001 From: theoneand33 Date: Wed, 9 Sep 2026 15:52:19 +1200 Subject: [PATCH 1/3] feat(theme): add dark theme option with toggle and dark logo Class-based dark mode via Tailwind custom variant, persisted to localStorage with prefers-color-scheme fallback. Themes layout, game tiles, flash states, all pages, Pagefind search UI, and adds a dark variant of the site logo. Toggle uses inline Lucide icons. --- public/images/games_logo_dark.svg | 21 ++++++++++ src/components/fullscreen-button.astro | 2 +- src/components/gametile.astro | 2 +- src/layout/layout.astro | 58 ++++++++++++++++++++------ src/pages/404.astro | 4 +- src/pages/about.astro | 6 +-- src/pages/games/[slug].astro | 6 +-- src/pages/index.astro | 16 +++---- src/styles/styles.css | 40 ++++++++++++++++++ 9 files changed, 125 insertions(+), 30 deletions(-) create mode 100644 public/images/games_logo_dark.svg diff --git a/public/images/games_logo_dark.svg b/public/images/games_logo_dark.svg new file mode 100644 index 0000000..0b71d4f --- /dev/null +++ b/public/images/games_logo_dark.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + Superfun games + Unblocked games + diff --git a/src/components/fullscreen-button.astro b/src/components/fullscreen-button.astro index a3f6985..9f9cd62 100644 --- a/src/components/fullscreen-button.astro +++ b/src/components/fullscreen-button.astro @@ -10,7 +10,7 @@ const { targetId } = Astro.props; type="button" data-fullscreen-for={targetId} aria-live="polite" - class="rounded-lg border border-gray-300 bg-white px-4 py-1.5 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600" + class="rounded-lg border border-gray-300 bg-white px-4 py-1.5 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-200 dark:hover:bg-neutral-800" > ⛶ Full screen diff --git a/src/components/gametile.astro b/src/components/gametile.astro index 8043e9f..ab57d2f 100644 --- a/src/components/gametile.astro +++ b/src/components/gametile.astro @@ -18,5 +18,5 @@ const altText = `${Game} unblocked - play online free`; decoding="async" class="aspect-[3/2] h-auto w-full max-w-[300px] rounded-xl transition-transform duration-300 hover:scale-105 hover:shadow-lg active:scale-95" /> -

{Game}

+

{Game}

diff --git a/src/layout/layout.astro b/src/layout/layout.astro index 847728d..5960bb9 100644 --- a/src/layout/layout.astro +++ b/src/layout/layout.astro @@ -67,7 +67,8 @@ const moreGames = (() => { {gameTitle} - + + { @@ -226,20 +227,44 @@ const moreGames = (() => { + - + @@ -251,10 +276,10 @@ const moreGames = (() => { Play {Game} Unblocked on Chromebook
-

+

{gameDescription}

-

+

✓ {isFlash ? "No Flash plugin required — works on school Chromebooks via Ruffle emulator" : "Works on school Chromebooks — no downloads needed"} @@ -268,8 +293,8 @@ const moreGames = (() => { {Game && !isHome && (

-