Light mode update

This commit is contained in:
2026-06-12 16:57:07 -07:00
parent fa37cffe47
commit ba32c96b7b
7 changed files with 211 additions and 47 deletions

View File

@@ -1,10 +1,16 @@
<script>
import { extraMenuLinks } from '../lib/menu';
import { theme, toggleTheme } from '../lib/theme';
let open = false;
const baseLinks = [
$: themeLink = $theme === 'dark'
? { label: '☀️ Light Mode', action: toggleTheme, keepOpen: true, title: 'Switch to the light theme' }
: { label: '🌙 Dark Mode', action: toggleTheme, keepOpen: true, title: 'Switch to the dark theme' };
$: baseLinks = [
{ label: '📖 Rules', href: '/rules', external: true, title: 'Open the rulebook in a new tab' },
themeLink,
];
$: links = [...$extraMenuLinks, ...baseLinks];
@@ -29,7 +35,7 @@
<button
class="menu-item"
title={link.title}
on:click={() => { open = false; link.action(); }}
on:click={() => { if (!link.keepOpen) open = false; link.action(); }}
>{link.label}</button>
{:else}
<a