Added mobile hamburger.
This commit is contained in:
parent
ec5b5192da
commit
4461adfa7a
3 changed files with 47 additions and 4 deletions
|
|
@ -23,6 +23,7 @@
|
|||
let loading = $state(true)
|
||||
let route = $state(window.location.hash || '#/')
|
||||
let updateAvailable = $state(false)
|
||||
let mobileNavOpen = $state(false)
|
||||
|
||||
// Check if this is a kiosk token URL before doing anything else
|
||||
const kioskToken = $derived(window.location.hash.match(/^#\/v\/([A-Z0-9]+)/i)?.[1] ?? '')
|
||||
|
|
@ -52,6 +53,7 @@
|
|||
}
|
||||
window.addEventListener('hashchange', () => {
|
||||
route = window.location.hash || '#/'
|
||||
mobileNavOpen = false
|
||||
})
|
||||
|
||||
// Periodically check for updates
|
||||
|
|
@ -92,8 +94,18 @@
|
|||
<GateUI {session} {onLogout} />
|
||||
{:else}
|
||||
<div class="layout">
|
||||
<Nav {session} {onLogout} active={path} />
|
||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
||||
{#if mobileNavOpen}
|
||||
<div class="nav-overlay" onclick={() => mobileNavOpen = false} onkeydown={() => {}}></div>
|
||||
{/if}
|
||||
<Nav {session} {onLogout} active={path} open={mobileNavOpen} />
|
||||
<div class="main">
|
||||
<header class="mobile-header">
|
||||
<button class="hamburger" onclick={() => mobileNavOpen = !mobileNavOpen} aria-label="Menu">
|
||||
<span></span><span></span><span></span>
|
||||
</button>
|
||||
<span class="mobile-brand">Turn<span class="accent">pike</span></span>
|
||||
</header>
|
||||
{#if path === '/' || path === ''}
|
||||
{#if role === 'volunteer_lead'}
|
||||
<ScheduleBoard {session} />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue