mirror of
https://github.com/MrUnknownDE/utools.git
synced 2026-05-06 06:16:04 +02:00
remove placeholder sentry and add mobil menu
This commit is contained in:
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user