Modal and such!
This commit is contained in:
parent
0a757dd500
commit
e40807b623
7 changed files with 95 additions and 26 deletions
|
|
@ -123,7 +123,6 @@ img {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
.divider {
|
||||
width: 70vw;
|
||||
height: 10px;
|
||||
|
|
@ -155,3 +154,14 @@ img {
|
|||
transform: translateY(-15px);
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-inline-start: 0;
|
||||
padding-inline-end: 40px;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-top: 0.75rem;
|
||||
margin-bottom: 0.75rem;
|
||||
line-height: 1.75;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
.modal {
|
||||
display: none; /* Hidden by default */
|
||||
position: fixed; /* Stay in place */
|
||||
z-index: 1; /* Sit on top */
|
||||
padding-top: 100px; /* Location of the box */
|
||||
display: none;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
padding-top: 100px;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%; /* Full width */
|
||||
height: 100%; /* Full height */
|
||||
overflow: auto; /* Enable scroll if needed */
|
||||
background-color: $background; /* Fallback color */
|
||||
background-color: rgba($background, 0.4); /* Black w/ opacity */
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background-color: $background;
|
||||
background-color: rgba($background, 0.4);
|
||||
}
|
||||
|
||||
/* Modal Content */
|
||||
|
|
@ -20,6 +20,11 @@
|
|||
border: 1px solid lighten($background, 10%);
|
||||
width: 80%;
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* The Close Button */
|
||||
.close {
|
||||
color: #aaaaaa;
|
||||
|
|
|
|||
|
|
@ -314,25 +314,16 @@ body {
|
|||
|
||||
.modal {
|
||||
display: none;
|
||||
/* Hidden by default */
|
||||
position: fixed;
|
||||
/* Stay in place */
|
||||
z-index: 1;
|
||||
/* Sit on top */
|
||||
padding-top: 100px;
|
||||
/* Location of the box */
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
/* Full width */
|
||||
height: 100%;
|
||||
/* Full height */
|
||||
overflow: auto;
|
||||
/* Enable scroll if needed */
|
||||
background-color: #252525;
|
||||
/* Fallback color */
|
||||
background-color: rgba(37, 37, 37, 0.4);
|
||||
/* Black w/ opacity */
|
||||
}
|
||||
|
||||
/* Modal Content */
|
||||
|
|
@ -345,6 +336,11 @@ body {
|
|||
/* The Close Button */
|
||||
}
|
||||
|
||||
.modal-content .container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.modal-content .close {
|
||||
color: #aaaaaa;
|
||||
float: right;
|
||||
|
|
@ -560,4 +556,17 @@ img.large {
|
|||
transform: translateY(-15px);
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
-webkit-padding-start: 0;
|
||||
padding-inline-start: 0;
|
||||
-webkit-padding-end: 40px;
|
||||
padding-inline-end: 40px;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-top: 0.75rem;
|
||||
margin-bottom: 0.75rem;
|
||||
line-height: 1.75;
|
||||
}
|
||||
/*# sourceMappingURL=all.css.map */
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -42,10 +42,8 @@ const toggleMenu = () => {
|
|||
|
||||
if (visible) {
|
||||
document.body.classList.add("no-scroll");
|
||||
console.log("not visible");
|
||||
} else {
|
||||
document.body.classList.remove("no-scroll");
|
||||
console.log("visible");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
$(document).ready(() => {
|
||||
// Close when clicking on *not* the modal-contents
|
||||
window.onclick = (event) => {
|
||||
if (event.target.classList.contains("modal")) {
|
||||
$(event.target).slideUp(150);
|
||||
document.body.classList.remove("no-scroll");
|
||||
}
|
||||
};
|
||||
|
||||
document.querySelectorAll(".modal .close").forEach((closeBtn) => {
|
||||
closeBtn.addEventListener('click', (evt) => {
|
||||
$(closeBtn.parentElement.parentElement).slideUp(150);
|
||||
// closeBtn.parentElement.parentElement.style.display = 'none';
|
||||
document.body.classList.remove("no-scroll");
|
||||
});
|
||||
});
|
||||
|
||||
document.querySelectorAll("[for-modal]").forEach((modalTrigerEl) => {
|
||||
modalTrigerEl.addEventListener('click', (evt) => {
|
||||
$(`#${modalTrigerEl.getAttribute("for-modal")}`).slideDown(150);
|
||||
// document.getElementById().style.display = "block";
|
||||
document.body.classList.add("no-scroll");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in a new issue