diff --git a/app/app.vue b/app/app.vue index 6dc14cb9..eebac735 100644 --- a/app/app.vue +++ b/app/app.vue @@ -5,6 +5,12 @@ :class="{ 'highlight-islands': highlightIslands }" @click="openSiteUI" > + + Skip to main content + diff --git a/app/components/layout/TheSiteHeader.vue b/app/components/layout/TheSiteHeader.vue index 15a77da9..bfbcbe00 100644 --- a/app/components/layout/TheSiteHeader.vue +++ b/app/components/layout/TheSiteHeader.vue @@ -5,6 +5,7 @@ const redirect = import.meta.dev : '' const loginURL = `https://github.com/login/oauth/authorize?client_id=${config.public.githubClientId}${redirect}&scope=read:org` +const mobileMenuRef = ref(null) const showMenu = ref(false) const { data: currentLocation } = await useFetch('/api/current-location', { @@ -34,25 +35,13 @@ const menu = [ ] useRouter().afterEach(() => { - toggleMenu(false) + mobileMenuRef.value?.hidePopover() }) -watch(showMenu, value => { - document.body.classList.toggle('overflow-hidden', value) -}) - -function toggleMenu (input?: Event | boolean) { - const newValue = typeof input === 'boolean' ? input : !showMenu.value - if (import.meta.server || input === showMenu.value) return - if (document.startViewTransition) { - document.startViewTransition(async () => { - showMenu.value = newValue - await nextTick() - }) - } - else { - showMenu.value = newValue - } +function onPopoverToggle (event: ToggleEvent) { + const isOpen = event.newState === 'open' + showMenu.value = isOpen + document.body.classList.toggle('overflow-hidden', isOpen) } @@ -152,7 +141,7 @@ function toggleMenu (input?: Event | boolean) { - -