Grid fixes and such.

This commit is contained in:
oitsjustjose 2020-03-02 23:22:36 -05:00
commit c020aa9b78
10 changed files with 387 additions and 275 deletions

View file

@ -2,26 +2,36 @@ $(document).ready(() => {
// Close when clicking on *not* the modal-contents
window.onclick = (event) => {
if (event.target.classList.contains("modal")) {
event.target.style.visibility = 'hidden';
event.target.style.opacity = 0;
$(event.target).hide("fade", {
direction: "out",
}, 300);
document.body.classList.remove("no-scroll");
}
};
document.querySelectorAll(".modal .close").forEach((closeBtn) => {
closeBtn.addEventListener('click', (evt) => {
closeBtn.parentElement.parentElement.style.visibility = 'hidden';
closeBtn.parentElement.parentElement.style.opacity = 0;
$(closeBtn.parentElement.parentElement).hide("fade", {
direction: "out",
}, 300);
document.body.classList.remove("no-scroll");
});
});
document.querySelectorAll("[for-modal]").forEach((modalTrigerEl) => {
modalTrigerEl.addEventListener('click', (evt) => {
document.getElementById(modalTrigerEl.getAttribute("for-modal")).style.visibility = "visible";
document.getElementById(modalTrigerEl.getAttribute("for-modal")).style.opacity = 1;
// document.getElementById(modalTrigerEl.getAttribute("for-modal")).style.display = "flex";
$(`#${modalTrigerEl.getAttribute("for-modal")}`).show("fade", {
direction: "in",
}, 300);
document.body.classList.add("no-scroll");
});
});
});
$(document).ready(() => {
document.querySelectorAll("[for-modal]").forEach((modalTrigerEl) => {
$(`#${modalTrigerEl.getAttribute("for-modal")}`).hide();
});
});