dasd
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user