Noch mehr KI Fehler
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<!-- === Basisbild (Platzhalter oder Hauptmotiv) ===
|
||||
<div class="image-wrapper">
|
||||
<picture>
|
||||
<!-- AVIF -->
|
||||
<!-- AVIF
|
||||
<source
|
||||
type="image/avif"
|
||||
srcset="
|
||||
@@ -19,7 +19,7 @@
|
||||
/2025/assets/images/3840/avif/Basisbild.avif 3840w"
|
||||
sizes="100vw">
|
||||
|
||||
<!-- WebP -->
|
||||
<!-- WebP
|
||||
<source
|
||||
type="image/webp"
|
||||
srcset="
|
||||
@@ -33,7 +33,7 @@
|
||||
/2025/assets/images/3840/webp/Basisbild.webp 3840w"
|
||||
sizes="100vw">
|
||||
|
||||
<!-- JPEG-Fallback -->
|
||||
<!-- JPEG-Fallback
|
||||
<img
|
||||
src="/2025/assets/images/1366/jpeg/Basisbild.jpeg"
|
||||
srcset="
|
||||
|
||||
@@ -84,7 +84,7 @@ function openPopup(day) {
|
||||
v.loop = true;
|
||||
v.play().catch(() => {});
|
||||
});
|
||||
}, 500); // 500 ms – Zeit für DOM + Quellen
|
||||
}, 500);
|
||||
})
|
||||
.catch(err => {
|
||||
popupContent.innerHTML = `<h2>${data.title}</h2>${data.content}`;
|
||||
@@ -113,11 +113,48 @@ function closePopup() {
|
||||
}
|
||||
|
||||
// === Schließen-Events ===
|
||||
popupClose.addEventListener("click", closePopup);
|
||||
popupOverlay.addEventListener("click", e => {
|
||||
if (e.target === popupOverlay) closePopup();
|
||||
});
|
||||
if (popupClose) popupClose.addEventListener("click", closePopup);
|
||||
if (popupOverlay) {
|
||||
popupOverlay.addEventListener("click", e => {
|
||||
if (e.target === popupOverlay) closePopup();
|
||||
});
|
||||
}
|
||||
|
||||
// === Export für door-open.js ===
|
||||
window.openPopup = openPopup;
|
||||
window.closePopup = closePopup;
|
||||
window.closePopup = closePopup;
|
||||
|
||||
// ============================================================
|
||||
// Ergänzung: Gesperrte Türchen – Popup mit Zufallsspruch + Zeitangabe
|
||||
// ============================================================
|
||||
|
||||
window.showLockedPopup = function (day) {
|
||||
const sprueche = [
|
||||
"🎁 Na na na, hier wird nicht geschummelt!",
|
||||
"❄️ Geduld ist auch eine Form von Magie.",
|
||||
"🎅 Ho ho ho – zu früh! Versuch es später nochmal.",
|
||||
"⏳ Die Tür klemmt noch – vielleicht morgen?",
|
||||
"🍪 Kein Plätzchen für Ungeduldige!",
|
||||
"🎄 Schön, dass du neugierig bist – aber noch ist Geheimniszeit!",
|
||||
"🔒 Tür verriegelt. Der Weihnachtszauber hat Öffnungszeiten.",
|
||||
"✨ Geduld, kleiner Weihnachtself – noch ein bisschen Glitzer abwarten!",
|
||||
"🕯️ Zu früh dran? Das Lichtlein brennt noch nicht für dich."
|
||||
];
|
||||
|
||||
const zufall = sprueche[Math.floor(Math.random() * sprueche.length)];
|
||||
|
||||
const yearMatch = document.title.match(/\d{4}/);
|
||||
const year = yearMatch ? parseInt(yearMatch[0], 10) : new Date().getFullYear();
|
||||
const unlockDate = new Date(year, 11, parseInt(day, 10), 0, 0, 0);
|
||||
|
||||
const options = { day: "2-digit", month: "long", year: "numeric", hour: "2-digit", minute: "2-digit" };
|
||||
const dateText = unlockDate.toLocaleString("de-DE", options).replace(" um", ",");
|
||||
|
||||
popupContent.innerHTML = `
|
||||
<h2>Türchen ${day} ist noch geschlossen</h2>
|
||||
<p>${zufall}</p>
|
||||
<p style="margin-top: 10px; opacity: 0.8;">🔓 Öffnet sich am <strong>${dateText}</strong></p>
|
||||
`;
|
||||
|
||||
popupOverlay.classList.add("active");
|
||||
};
|
||||
Reference in New Issue
Block a user