burger
Deploy to FTP / deploy (push) Successful in 6s

This commit is contained in:
Sebastian Molenda
2026-05-16 09:46:03 +02:00
parent 53b50c94af
commit 1dbad2a9f7
8 changed files with 513 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
// Shared hamburger menu toggle
(function () {
document.addEventListener('DOMContentLoaded', () => {
const btn = document.getElementById('hamburger-btn')
const menu = document.getElementById('hamburger-menu')
if (!btn || !menu) return
btn.addEventListener('click', (e) => {
e.stopPropagation()
menu.classList.toggle('open')
})
document.addEventListener('click', () => menu.classList.remove('open'))
// mark active link
const current = location.pathname.split('/').pop() || 'index.html'
menu.querySelectorAll('a').forEach(a => {
if (a.getAttribute('href') === current) a.classList.add('active')
})
})
})()