pop anpassung

This commit is contained in:
2025-11-09 21:58:52 +01:00
parent 5a91acf0a6
commit e2e1001749

View File

@@ -34,13 +34,28 @@ const popupData = {
};
// === Platzhalterfunktion ===
function placeholder(text) {
return `
<div class="placeholder">
<p><em>${text}</em></p>
<p style="opacity:0.7;">(Inhalt wird noch produziert)</p>
</div>
`;
function openPopup(day) {
const data = popupData[day];
if (!data) return;
const tag = String(day).padStart(2, '0');
const url = `/2025/inhalte/tag${tag}.html`;
fetch(url)
.then(res => {
if (!res.ok) throw new Error("Inhalt nicht gefunden");
return res.text();
})
.then(html => {
popupContent.innerHTML = `<h2>${data.title}</h2>${html}`;
popupOverlay.classList.add("active");
})
.catch(err => {
// Fallback auf bekannte JS-Daten
popupContent.innerHTML = `<h2>${data.title}</h2>${data.content}`;
popupOverlay.classList.add("active");
console.warn(`Türchen ${day}: HTML konnte nicht geladen werden. Fallback verwendet.`, err);
});
}
// === Öffnen / Schließen ===