adventskalender/shared/js/door-open.js aktualisiert

This commit is contained in:
2025-11-05 20:18:14 +00:00
parent 09ac268292
commit 5de99402ad

View File

@@ -7,6 +7,12 @@ document.querySelectorAll(".door, .fluegel, .openfield").forEach(elem => {
const day = elem.dataset.day; const day = elem.dataset.day;
if (!day) return; if (!day) return;
// 🔒 Tages-Sperre prüfen
if (typeof isDoorUnlocked === "function" && !isDoorUnlocked(day)) {
console.log(`Türchen ${day} ist noch gesperrt.`);
return;
}
const openfield = document.querySelector(`.openfield[data-day="${day}"]`); const openfield = document.querySelector(`.openfield[data-day="${day}"]`);
const door = document.querySelector(`.door[data-day="${day}"]`); const door = document.querySelector(`.door[data-day="${day}"]`);
const flLeft = document.querySelector(`.fluegel.left[data-day="${day}"]`); const flLeft = document.querySelector(`.fluegel.left[data-day="${day}"]`);