Modified Executive Committee page

This commit is contained in:
Kent Joseph T. Palima
2026-04-30 12:37:45 +08:00
parent 4b7ae32e07
commit c333a4725a
+19 -16
View File
@@ -45,24 +45,27 @@ import vp_sec from '../assets/images/execomm/vp_sec.png';
const cards = document.querySelectorAll(".photo-card img"); const cards = document.querySelectorAll(".photo-card img");
const closeBtn = document.querySelector(".close-modal"); const closeBtn = document.querySelector(".close-modal");
cards.forEach(img => { // This simple check satisfies TypeScript's strict rules!
img.addEventListener("click", () => { if (modal && closeBtn && modalImg) {
modal.style.display = "flex"; cards.forEach(img => {
modalImg.src = (img as HTMLImageElement).src; img.addEventListener("click", () => {
document.body.style.overflow = "hidden"; // Prevent scrolling when open modal.style.display = "flex";
modalImg.src = (img as HTMLImageElement).src;
document.body.style.overflow = "hidden"; // Prevent scrolling when open
});
}); });
});
closeBtn.addEventListener("click", () => { closeBtn.addEventListener("click", () => {
modal.style.display = "none";
document.body.style.overflow = "auto";
});
// Close if user clicks outside the image
modal.addEventListener("click", (e) => {
if (e.target === modal) {
modal.style.display = "none"; modal.style.display = "none";
document.body.style.overflow = "auto"; document.body.style.overflow = "auto";
} });
});
// Close if user clicks outside the image
modal.addEventListener("click", (e) => {
if (e.target === modal) {
modal.style.display = "none";
document.body.style.overflow = "auto";
}
});
}
</script> </script>