1/* Gesundheitszentrum Embken â UI-Interaktionen */ 2(function () { 3 "use strict"; 4 5 /* ---- Mobile-Navigation ---- */ 6 var toggle = document.querySelector(".nav-toggle"); 7 var nav = document.querySelector(".nav"); 8 var overlay = document.querySelector(".nav-overlay"); 9 10 function setNav(open) { 11 if (!nav) return; 12 nav.classList.toggle("open", open); 13 if (overlay) overlay.classList.toggle("open", open); 14 if (toggle) toggle.setAttribute("aria-expanded", open ? "true" : "false"); 15 document.body.style.overflow = open ? "hidden" : ""; 16 } 17 if (toggle) toggle.addEventListener("click", function () { 18 setNav(!nav.classList.contains("open")); 19 }); 20 if (overlay) overlay.addEventListener("click", function () { setNav(false); }); 21 22 // Untermenüs auf Mobile per Tap aufklappen 23 document.querySelectorAll(".nav .has-children > .navlink").forEach(function (link) { 24 link.addEventListener("click", function (e) { 25 if (window.matchMedia("(max-width: 960px)").matches) { 26 e.preventDefault(); 27 link.parentElement.classList.toggle("submenu-open"); 28 } 29 }); 30 }); 31 document.addEventListener("keydown", function (e) { if (e.key === "Escape") setNav(false); }); 32 33 /* ---- Ãffnungszeiten-Status ("jetzt geöffnet") ---- */ 34 // Sprechzeiten je Wochentag (0=So ... 6=Sa), Minuten ab Mitternacht 35 var HOURS = { 36 1: [[480, 660]], // Mo 08â11 37 2: [[480, 660], [900, 1020]], // Di 08â11, 15â17 38 3: [[480, 660]], // Mi 08â11 39 4: [[480, 660], [900, 1080]], // Do 08â11, 15â18 40 5: [[480, 660]] // Fr 08â11 41 }; 42 var badge = document.querySelector("[data-open-status]"); 43 if (badge) { 44 var now = new Date(); 45 var mins = now.getHours() * 60 + now.getMinutes(); 46 var today = HOURS[now.getDay()] || []; 47 var open = today.some(function (r) { return mins >= r[0] && mins < r[1]; }); 48 badge.classList.add(open ? "is-open" : "is-closed"); 49 var label = badge.querySelector("[data-open-label]"); 50 var dot = badge.querySelector(".dot"); 51 if (label) label.textContent = open ? "Jetzt geöffnet" : "Aktuell geschlossen"; 52 if (dot && !open) dot.style.background = "#b0bccb", dot.style.boxShadow = "0 0 0 4px rgba(176,188,203,.25)"; 53 } 54 55 /* ---- Header beim Scrollen kompakt: Schatten an, Logo kleiner ---- 56 Oben steht die Wortbildmarke groà und lesbar, beim Scrollen schrumpft 57 der Header, damit der sticky Kopf nicht dauerhaft Platz frisst. */ 58 var header = document.querySelector(".site-header"); 59 if (header) { 60 var onScroll = function () { 61 header.classList.toggle("scrolled", window.scrollY > 8); 62 }; 63 onScroll(); 64 window.addEventListener("scroll", onScroll, { passive: true }); 65 } 66})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.