Start Über mich Services Projekte Kontakt
// Cookie toggle functionality document.querySelectorAll('.toggle-switch:not(.disabled)').forEach(toggle => { toggle.addEventListener('click', () => { toggle.classList.toggle('active'); }); }); // Load current cookie preferences function loadCookiePreferences() { if (typeof window.CookieConsent !== 'undefined') { const prefs = window.CookieConsent.getPreferences(); const analyticsToggle = document.getElementById('analytics-toggle'); const marketingToggle = document.getElementById('marketing-toggle'); if (prefs.analytics && analyticsToggle) { analyticsToggle.classList.add('active'); } if (prefs.marketing && marketingToggle) { marketingToggle.classList.add('active'); } } } // Save cookie preferences function saveCookiePreferences() { const analyticsActive = document.getElementById('analytics-toggle').classList.contains('active'); const marketingActive = document.getElementById('marketing-toggle').classList.contains('active'); if (typeof window.CookieConsent !== 'undefined') { window.CookieConsent.setPreferences({ necessary: true, analytics: analyticsActive, marketing: marketingActive }); } alert('Cookie-Einstellungen wurden gespeichert!'); } // Accept all cookies function acceptAllCookies() { document.getElementById('analytics-toggle').classList.add('active'); document.getElementById('marketing-toggle').classList.add('active'); saveCookiePreferences(); } // Load preferences on page load document.addEventListener('DOMContentLoaded', loadCookiePreferences);