feat: Popup

This commit is contained in:
2025-01-24 23:22:45 +03:00
parent bf94146675
commit db3eb73bc0
3 changed files with 27 additions and 14 deletions
+22 -10
View File
@@ -1,14 +1,26 @@
(function(window, document, undefined) {
const popupOverlay = document.getElementById("popup-overlay");
const popup = document.getElementById("popup");
// code that should be taken care of right away
function showPopup() {
popupOverlay.style.display = "block";
}
window.onload = init;
function hidePopup() {
popupOverlay.style.display = "none";
}
function init(){
const popupOverlay = document.getElementById("popup-overlay");
const popup = document.getElementById("popup");
const help = document.getElementById("help");
function showPopup() {
popupOverlay.style.display = "block";
}
function hidePopup() {
popupOverlay.style.display = "none";
}
help.addEventListener("click", showPopup);
popupOverlay.addEventListener("click", hidePopup);
popup.addEventListener("click", (event) => event.stopPropagation());
}
})(window, document, undefined);
popupOverlay.addEventListener("click", hidePopup);
popup.addEventListener("click", (event) => event.stopPropagation());