/* The mobile drawer. * * Search used to live here too, in an overlay of its own behind a magnifying * glass in the top bar. Both are gone: NEU's face is the search button now and * the searching happens inside NEU's box, over the same list. See neuchat.js — * it also keeps the "/" shortcut this file used to own. */ (function () { 'use strict'; const $ = s => document.querySelector(s); const burger = $('#navBurger'); const drawer = $('#navDrawer'); /* ---------- mobile drawer ---------- */ const setDrawer = open => { drawer.hidden = !open; burger.setAttribute('aria-expanded', String(open)); burger.classList.toggle('is-open', open); document.body.classList.toggle('drawer-open', open); }; if (burger) { burger.addEventListener('click', () => setDrawer(drawer.hidden)); // in-page links: close the drawer, then scroll to the target drawer.querySelectorAll('a[href^="#"]').forEach(a => { a.addEventListener('click', e => { e.preventDefault(); setDrawer(false); const t = $(a.getAttribute('href')); if (t) t.scrollIntoView({ behavior: 'smooth' }); }); }); } addEventListener('keydown', e => { if (e.key === 'Escape' && drawer) setDrawer(false); }); })();