The smokesignal.events web application
at main 23 lines 569 B view raw
1/** 2 * Navigation component 3 * 4 * Handles navbar burger toggle for mobile navigation. 5 * Migrated from static/site.js 6 */ 7 8export function initNavigation(): void { 9 const navbarBurgers = document.querySelectorAll<HTMLElement>('.navbar-burger') 10 11 navbarBurgers.forEach((el) => { 12 el.addEventListener('click', () => { 13 const targetId = el.dataset.target 14 if (!targetId) return 15 16 const target = document.getElementById(targetId) 17 if (!target) return 18 19 el.classList.toggle('is-active') 20 target.classList.toggle('is-active') 21 }) 22 }) 23}