remove placeholder sentry and add mobil menu

This commit is contained in:
2026-04-27 12:04:34 +02:00
parent a42f1b87e9
commit 10deecfb35
5 changed files with 82 additions and 60 deletions
+13
View File
@@ -15,8 +15,18 @@ const routes = {
};
const app = document.getElementById('app');
const header = document.querySelector('header');
let currentCleanup = null;
// ── Hamburger toggle ─────────────────────────────────────────────
const navToggle = document.getElementById('nav-toggle');
if (navToggle) {
navToggle.addEventListener('click', () => {
const open = header.classList.toggle('nav-open');
navToggle.setAttribute('aria-expanded', open);
});
}
function setActiveNav(path) {
document.querySelectorAll('nav a').forEach(a => {
try {
@@ -29,6 +39,9 @@ function setActiveNav(path) {
async function navigate(path, { push = true, search = '' } = {}) {
const route = routes[path] ?? routes['/'];
// ── close mobile nav on navigate ────────────────────────────
if (header) { header.classList.remove('nav-open'); navToggle?.setAttribute('aria-expanded', 'false'); }
// ── leave animation ──────────────────────────────────────────
app.classList.add('page-leaving');
if (currentCleanup) { try { currentCleanup(); } catch {} currentCleanup = null; }