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 {
|
.divider {
|
||||||
width: 70vw;
|
width: 70vw;
|
||||||
height: 10px;
|
height: 10px;
|
||||||
|
|
@ -155,3 +154,14 @@ img {
|
||||||
transform: translateY(-15px);
|
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 {
|
.modal {
|
||||||
display: none; /* Hidden by default */
|
display: none;
|
||||||
position: fixed; /* Stay in place */
|
position: fixed;
|
||||||
z-index: 1; /* Sit on top */
|
z-index: 1;
|
||||||
padding-top: 100px; /* Location of the box */
|
padding-top: 100px;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 100%; /* Full width */
|
width: 100%;
|
||||||
height: 100%; /* Full height */
|
height: 100%;
|
||||||
overflow: auto; /* Enable scroll if needed */
|
overflow: auto;
|
||||||
background-color: $background; /* Fallback color */
|
background-color: $background;
|
||||||
background-color: rgba($background, 0.4); /* Black w/ opacity */
|
background-color: rgba($background, 0.4);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Modal Content */
|
/* Modal Content */
|
||||||
|
|
@ -20,6 +20,11 @@
|
||||||
border: 1px solid lighten($background, 10%);
|
border: 1px solid lighten($background, 10%);
|
||||||
width: 80%;
|
width: 80%;
|
||||||
|
|
||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
/* The Close Button */
|
/* The Close Button */
|
||||||
.close {
|
.close {
|
||||||
color: #aaaaaa;
|
color: #aaaaaa;
|
||||||
|
|
|
||||||
|
|
@ -314,25 +314,16 @@ body {
|
||||||
|
|
||||||
.modal {
|
.modal {
|
||||||
display: none;
|
display: none;
|
||||||
/* Hidden by default */
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
/* Stay in place */
|
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
/* Sit on top */
|
|
||||||
padding-top: 100px;
|
padding-top: 100px;
|
||||||
/* Location of the box */
|
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* Full width */
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
/* Full height */
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
/* Enable scroll if needed */
|
|
||||||
background-color: #252525;
|
background-color: #252525;
|
||||||
/* Fallback color */
|
|
||||||
background-color: rgba(37, 37, 37, 0.4);
|
background-color: rgba(37, 37, 37, 0.4);
|
||||||
/* Black w/ opacity */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Modal Content */
|
/* Modal Content */
|
||||||
|
|
@ -345,6 +336,11 @@ body {
|
||||||
/* The Close Button */
|
/* The Close Button */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.modal-content .container {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
.modal-content .close {
|
.modal-content .close {
|
||||||
color: #aaaaaa;
|
color: #aaaaaa;
|
||||||
float: right;
|
float: right;
|
||||||
|
|
@ -560,4 +556,17 @@ img.large {
|
||||||
transform: translateY(-15px);
|
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 */
|
/*# sourceMappingURL=all.css.map */
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -42,10 +42,8 @@ const toggleMenu = () => {
|
||||||
|
|
||||||
if (visible) {
|
if (visible) {
|
||||||
document.body.classList.add("no-scroll");
|
document.body.classList.add("no-scroll");
|
||||||
console.log("not visible");
|
|
||||||
} else {
|
} else {
|
||||||
document.body.classList.remove("no-scroll");
|
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");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
27
index.html
27
index.html
|
|
@ -16,18 +16,18 @@
|
||||||
<script src="Libraries/js/jquery-3.4.1.min.js"></script>
|
<script src="Libraries/js/jquery-3.4.1.min.js"></script>
|
||||||
<script src="Libraries/js/jquery-ui.min.js"></script>
|
<script src="Libraries/js/jquery-ui.min.js"></script>
|
||||||
<script src="Libraries/js/themekit/menu.js"></script>
|
<script src="Libraries/js/themekit/menu.js"></script>
|
||||||
|
<script src="Libraries/js/themekit/modal.js"></script>
|
||||||
<title>Juice-UI</title>
|
<title>Juice-UI</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="top titlebar">
|
<div class="top titlebar">
|
||||||
|
|
||||||
<div class="mobile-menu">
|
<div class="mobile-menu">
|
||||||
<div class="close-mobile-menu" onclick='toggleMenu()'>
|
<div class="close-mobile-menu" onclick='toggleMenu()'>
|
||||||
<i class="fa fa-close"></i>
|
<i class="fa fa-close"></i>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="compact item">
|
<div class="compact item" for-modal="aboutModal">
|
||||||
About
|
About
|
||||||
</div>
|
</div>
|
||||||
<div class="compact item">
|
<div class="compact item">
|
||||||
|
|
@ -63,7 +63,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="item">
|
<div class="item" for-modal="aboutModal">
|
||||||
<span>About <i class="fa fa-info"></i></span>
|
<span>About <i class="fa fa-info"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<a href="https://github.com/oitsjustjose/ThemeKit" target="_blank" class="item">
|
<a href="https://github.com/oitsjustjose/ThemeKit" target="_blank" class="item">
|
||||||
|
|
@ -270,6 +270,27 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="aboutModal" class="modal">
|
||||||
|
<div class="modal-content">
|
||||||
|
<span class="close">
|
||||||
|
<i class="fa fa-close"></i>
|
||||||
|
</span>
|
||||||
|
<div class="container">
|
||||||
|
<h2>About This Page</h2>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
This page was written with mobile optimization first!
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
This ThemeKit is written from scratch with minimal JQuery (using DOM where possible)
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
This page not only shows you how these things work, but demo to me how they're turning out too!
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue