Files
Bratonien-Adventskalender/adventskalender/shared/js/door-open.js

21 lines
628 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Türchen-Interaktion: Öffnen & später Popup
document.querySelectorAll(".door").forEach(door => {
// Klick auf Türchen
door.addEventListener("click", () => {
// Doppeltüren (6 & 24) überspringen eigene Logik folgt später
if (door.classList.contains("double")) return;
// Wenn Tür noch geschlossen ist
if (!door.classList.contains("open")) {
door.classList.add("open"); // öffnet das Türchen per CSS
// später: hier Popup öffnen
} else {
// Wenn bereits offen Popup (später)
console.log(`Tür ${door.dataset.day} wurde erneut geöffnet`);
}
});
});