= 1024) mobileMenuOpen = false" @site-menu-destination-ready="focusDestination = true; mobileMenuOpen = false" @site-menu-navigation-aborted="mobileMenuNavigationPending = false" @site-menu-pending="mobileMenuNavigationPending = true" data-astro-cid-pux6a34n data-astro-transition-scope=astro-jicqxufy-1 data-at-top=true data-site-nav style=min-height:4rem;height:4rem x-data="{ mobileMenuOpen: false, mobileMenuClosing: false, mobileMenuNavigationPending: false, focusDestination: false, closeTimer: null, init() { const restoreLocale = document.documentElement.dataset.mobileMenuRestore; this.mobileMenuOpen = Boolean(restoreLocale) && window.innerWidth < 1024; this.focusDestination = restoreLocale === 'page'; this.mobileMenuNavigationPending = this.focusDestination; this.$watch('mobileMenuOpen', open => { clearTimeout(this.closeTimer); if (open) { this.mobileMenuClosing = false; document.querySelectorAll('main, footer').forEach(el => el.inert = true); this.$nextTick(() => this.$refs.mobilePanel.querySelector('a')?.focus({ preventScroll: true })); } else { this.mobileMenuClosing = true; this.$nextTick(() => { if (window.innerWidth >= 1024 || window.matchMedia('(prefers-reduced-motion: reduce)').matches) this.finishMenuClose(); else this.closeTimer = setTimeout(() => this.finishMenuClose(), 420); }); } }); if (this.mobileMenuOpen) { document.querySelectorAll('main, footer').forEach(el => el.inert = true); if (!this.focusDestination) this.$nextTick(() => this.$refs.mobilePanel.querySelector('[data-language-target=' + restoreLocale + ']')?.focus({ preventScroll: true })); } }, followMenuLink(event) { if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return; const target = new URL(event.currentTarget.href, window.location.href); if (target.href === window.location.href) { event.preventDefault(); this.mobileMenuOpen = false; } }, finishMenuClose() { if (this.mobileMenuOpen || !this.mobileMenuClosing) return; clearTimeout(this.closeTimer); this.mobileMenuClosing = false; this.mobileMenuNavigationPending = false; this.$refs.mobilePanel.removeAttribute('data-menu-restored'); document.querySelectorAll('main, footer').forEach(el => el.inert = false); const destination = this.focusDestination; this.focusDestination = false; this.$dispatch('site-menu-closed'); this.$nextTick(() => { const heading = destination ? document.querySelector('main h1') : null; if (heading) { if (!heading.hasAttribute('tabindex')) { heading.setAttribute('tabindex', '-1'); heading.addEventListener('blur', () => heading.removeAttribute('tabindex'), { once: true }); } heading.focus({ preventScroll: true }); } else { const target = this.$refs.menuToggle.getClientRects().length ? this.$refs.menuToggle : this.$el.querySelector('.site-nav-brand'); target.focus({ preventScroll: true }); } }); }, trapMenuFocus(event) { if (!this.mobileMenuOpen || event.key !== 'Tab') return; const items = [...this.$el.querySelectorAll('a[href], button')].filter(el => el.getClientRects().length && !el.closest('[inert]')); const first = items[0], last = items[items.length - 1]; if (event.shiftKey && document.activeElement === first) { event.preventDefault(); last.focus(); } else if (!event.shiftKey && document.activeElement === last) { event.preventDefault(); first.focus(); } }, destroy() { clearTimeout(this.closeTimer); if (document.documentElement.dataset.mobileMenuRestore) return; document.querySelectorAll('main, footer').forEach(el => el.inert = false); document.documentElement.classList.remove('mobile-nav-open'); document.body.classList.remove('mobile-nav-open'); } }" x-effect="document.documentElement.classList.toggle('mobile-nav-open', mobileMenuOpen || mobileMenuClosing); document.body.classList.toggle('mobile-nav-open', mobileMenuOpen || mobileMenuClosing)">
Projects
Dev Notes
About
EN
DE
Get in touch
Menu
Where to next?
↗
01
Home
02
Projects
03
Dev Notes
04
About
Got a good idea?
Let’s talk.
Language
EN
DE
Redirecting...