feat: Popup

This commit is contained in:
Sweetbread 2025-01-24 23:22:45 +03:00
parent bf94146675
commit db3eb73bc0
3 changed files with 27 additions and 14 deletions

View File

@ -5,6 +5,7 @@
#popup-overlay { #popup-overlay {
top: 0;
position: absolute; position: absolute;
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -180,7 +181,7 @@
flex-wrap: wrap; flex-wrap: wrap;
} }
.helpimg { #help {
max-width: 100%; max-width: 100%;
width: 3vw; width: 3vw;
height: auto; height: auto;
@ -195,7 +196,7 @@
} }
.helpimg:hover { #help:hover {
box-shadow: 0.7em 0.7em 0em 0px rgba(0, 0, 0, 0.8); box-shadow: 0.7em 0.7em 0em 0px rgba(0, 0, 0, 0.8);
transform: translate(0, 0.2em); transform: translate(0, 0.2em);
} }

View File

@ -1,6 +1,13 @@
(function(window, document, undefined) {
// code that should be taken care of right away
window.onload = init;
function init(){
const popupOverlay = document.getElementById("popup-overlay"); const popupOverlay = document.getElementById("popup-overlay");
const popup = document.getElementById("popup"); const popup = document.getElementById("popup");
const help = document.getElementById("help");
function showPopup() { function showPopup() {
popupOverlay.style.display = "block"; popupOverlay.style.display = "block";
@ -10,5 +17,10 @@ function hidePopup() {
popupOverlay.style.display = "none"; popupOverlay.style.display = "none";
} }
help.addEventListener("click", showPopup);
popupOverlay.addEventListener("click", hidePopup); popupOverlay.addEventListener("click", hidePopup);
popup.addEventListener("click", (event) => event.stopPropagation()); popup.addEventListener("click", (event) => event.stopPropagation());
}
})(window, document, undefined);

View File

@ -25,5 +25,5 @@
</div> </div>
</div> </div>
<img class="helpimg" src="{{ url_for('static', filename='imgs/icon.png') }}"> <img id="help" src="{{ url_for('static', filename='imgs/icon.png') }}">
</body> </body>