This commit is contained in:
2026-05-10 22:05:28 +02:00
parent cefca66094
commit 9050114508
3 changed files with 18 additions and 4 deletions

View File

@@ -1,20 +1,24 @@
document.getElementById("open-fin-modal").addEventListener("click", function() {
document.getElementById("fin-modal").style.visibility = "visible";
document.body.classList.add("modal-open");
});
document.querySelectorAll(".close-fin-modal").forEach(function(button) {
button.addEventListener("click", function() {
document.getElementById("fin-modal").style.visibility = "hidden";
document.body.classList.remove("modal-open");
});
});
document.getElementById("open-game-modal").addEventListener("click", function() {
document.getElementById("game-modal").style.visibility = "visible";
document.body.classList.add("modal-open");
});
document.querySelectorAll(".close-game-modal").forEach(function(button) {
button.addEventListener("click", function() {
document.getElementById("game-modal").style.visibility = "hidden";
document.body.classList.remove("modal-open");
});
});

View File

@@ -102,10 +102,12 @@ document.addEventListener("DOMContentLoaded", function() {
`;
document.body.insertAdjacentHTML("beforeend", modalHtml);
const modal = document.getElementById("image-modal");
modal.style.visibility = "visible";
modal.style.visibility = 'visible';
document.body.classList.add("modal-open");
modal.querySelector(".close").addEventListener("click", () => {
modal.remove();
document.body.classList.remove("modal-open");
});
});
});