Mobile-friendly Menu UI
This commit is contained in:
parent
1a47e8143a
commit
1193d70d90
5 changed files with 135 additions and 20 deletions
|
|
@ -437,4 +437,46 @@ button:active {
|
|||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-menu {
|
||||
position: fixed;
|
||||
z-index: 1024;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: none;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: rgba(37, 37, 37, 0.95);
|
||||
color: #eeeeee;
|
||||
}
|
||||
|
||||
.mobile-menu .close-mobile-menu {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-orient: horizontal;
|
||||
-webkit-box-direction: reverse;
|
||||
-ms-flex-direction: row-reverse;
|
||||
flex-direction: row-reverse;
|
||||
justify-items: flex-end;
|
||||
width: 100vw;
|
||||
max-width: 100vw;
|
||||
font-size: 4rem;
|
||||
background-color: rgba(187, 49, 47, 0.5);
|
||||
}
|
||||
|
||||
.mobile-menu .close-mobile-menu:hover {
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.mobile-menu .item {
|
||||
width: 100vw;
|
||||
height: 10px;
|
||||
max-height: 4rem;
|
||||
}
|
||||
|
||||
.mobile-menu .sub.item {
|
||||
padding-left: 3rem;
|
||||
background-color: #404040;
|
||||
}
|
||||
/*# sourceMappingURL=main.css.map */
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -384,3 +384,40 @@ button {
|
|||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-menu {
|
||||
position: fixed;
|
||||
z-index: 1024;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: none;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background-color: rgba($background, 0.95);
|
||||
color: $foreground;
|
||||
|
||||
.close-mobile-menu {
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
justify-items: flex-end;
|
||||
width: 100vw;
|
||||
max-width: 100vw;
|
||||
font-size: 4rem;
|
||||
background-color: rgba($darkRed, 0.5);
|
||||
|
||||
&:hover {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
.item {
|
||||
width: 100vw;
|
||||
height: 10px;
|
||||
max-height: 4rem;
|
||||
// height: 2rem;
|
||||
}
|
||||
|
||||
.sub.item {
|
||||
padding-left: 3rem;
|
||||
background-color: map-get($dark, "buttonActive");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,23 @@
|
|||
$(document).ready(function () {
|
||||
$('.dropdown-submenu a.test').on("click", function (e) {
|
||||
$(this).next('ul').toggle();
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
const toggleSubMenu = (el) => {
|
||||
$(`[for="${el.getAttribute("from")}"`).toggle("slide", "down");
|
||||
|
||||
// TODO: do something with these
|
||||
};
|
||||
|
||||
const toggleMenu = () => {
|
||||
$(".mobile-menu").toggle("slide", "left");
|
||||
};
|
||||
|
||||
$(document).ready(() => {
|
||||
document.querySelectorAll(".compact.submenu.item").forEach((el) => {
|
||||
let id = `subMenu_${new Date().getMilliseconds()}`;
|
||||
el.setAttribute("from", id);
|
||||
|
||||
el.querySelectorAll(".compact.sub.item").forEach((child) => {
|
||||
child.setAttribute("for", id);
|
||||
child.style.display = "none";
|
||||
child.textContent = `${child.textContent}`;
|
||||
el.parentElement.appendChild(child);
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue