pop anpassung
This commit is contained in:
@@ -34,13 +34,28 @@ const popupData = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// === Platzhalterfunktion ===
|
// === Platzhalterfunktion ===
|
||||||
function placeholder(text) {
|
function openPopup(day) {
|
||||||
return `
|
const data = popupData[day];
|
||||||
<div class="placeholder">
|
if (!data) return;
|
||||||
<p><em>${text}</em></p>
|
|
||||||
<p style="opacity:0.7;">(Inhalt wird noch produziert)</p>
|
const tag = String(day).padStart(2, '0');
|
||||||
</div>
|
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 ===
|
// === Öffnen / Schließen ===
|
||||||
|
|||||||
Reference in New Issue
Block a user