This commit is contained in:
2025-12-25 02:05:08 +01:00
parent 330df57424
commit fb793e0cb6
2 changed files with 18 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ document.addEventListener('DOMContentLoaded', () => {
const body = document.body;
const isLoggedIn = body.dataset.auth === '1';
const childGender = body.dataset.childGender || '';
const header = document.querySelector('.site-header');
// Logo-Logik
const pickLogo = (gender) => {
@@ -14,6 +15,15 @@ document.addEventListener('DOMContentLoaded', () => {
img.src = `/assets/bilder/${chosenLogo}`;
});
// Header shrink on scroll
const onScroll = () => {
if (!header) return;
const shouldShrink = window.scrollY > 40;
header.classList.toggle('is-scrolled', shouldShrink);
};
onScroll();
window.addEventListener('scroll', onScroll, { passive: true });
// Mobile Menü
const mobileMenu = document.getElementById('mobileMenu');
document.querySelectorAll('.menu-toggle').forEach(btn => {