This commit is contained in:
oitsjustjose 2020-02-27 11:56:49 -05:00
commit 13aede1519
5 changed files with 139 additions and 42 deletions

View file

@ -83,10 +83,12 @@ a:hover {
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
text-align: center;
}
.masthead p.content .subheader {
font-size: 32px;
text-align: center;
}
.masthead .down {
@ -149,7 +151,7 @@ img.large {
background-color: #2a2a2a;
color: #eeeeee;
position: fixed;
z-index: 10000000;
z-index: 1;
top: 0;
left: 0;
width: 100vw;
@ -164,6 +166,8 @@ img.large {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.5);
box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.5);
}
.masthead {
@ -180,10 +184,9 @@ body {
}
.titlebar.top .item {
background-color: #3a3a3a;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
@ -191,12 +194,19 @@ body {
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
background-color: #3a3a3a;
font-family: "Spartan";
padding: 0px 1rem;
height: 100%;
cursor: pointer;
}
.titlebar.top .item span {
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
}
.titlebar.top .item:hover {
background-color: #2a2a2a;
-webkit-transition: all ease-in 150ms;
@ -214,6 +224,11 @@ body {
width: 100vw;
}
.dropdown.item {
position: relative;
display: inline-block;
}
.dropdown.item:hover .dropdown-content {
max-height: 100vh;
display: block;
@ -222,28 +237,43 @@ body {
.dropdown.item .dropdown-content {
max-height: 0px;
overflow-y: hidden;
top: 100%;
left: 0;
-webkit-transition: max-height 0.5s ease-in-out;
transition: max-height 0.5s ease-in-out;
position: absolute;
background-color: #3a3a3a;
min-width: 160px;
margin-left: -1rem;
margin-top: 5.45em;
}
.dropdown.item .dropdown-content a {
.dropdown.item .dropdown-content .item {
color: #eeeeee;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropdown.item .dropdown-content a:hover {
.dropdown.item .dropdown-content .item:hover {
background-color: #252525;
-webkit-transition: all ease-in 150ms;
transition: all ease-in 150ms;
}
.dropdown.item .dropdown-content .dropdown.item {
position: relative;
display: inline-block;
overflow: visible;
}
.dropdown.item .dropdown-content .dropdown.item .dropdown-content {
max-width: 100vw;
max-height: 100vh;
}
.dropdown.item .dropdown.item .dropdown-content {
top: 0;
left: 100%;
}
button {
padding: 0.75rem 1rem;
border-radius: 8px;
@ -385,4 +415,17 @@ button:active {
transform: translateY(-15px);
}
}
@media (min-width: 767px) {
.dropdown.item.compact > *,
.dropdown.item.compact {
display: none;
}
}
@media (max-width: 767px) {
.titlebar.top .item:not(.compact) {
display: none;
}
}
/*# sourceMappingURL=main.css.map */

File diff suppressed because one or more lines are too long

View file

@ -71,7 +71,6 @@ a {
justify-content: center;
p.content {
// height: 100%;
font-size: 64px;
font-weight: 900;
@ -79,9 +78,11 @@ a {
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
.subheader {
font-size: 32px;
text-align: center;
}
}
@ -143,7 +144,7 @@ img {
background-color: map-get($dark, "background");
color: map-get($dark, "foreground");
position: fixed;
z-index: 10000000;
z-index: 1;
top: 0;
left: 0;
width: 100vw;
@ -151,7 +152,7 @@ img {
display: flex;
flex-direction: row;
align-items: center;
box-shadow: 0px 2px 0px 0px rgba(0, 0, 0, 0.5);
@at-root .masthead {
height: calc(100vh - 3rem);
}
@ -166,15 +167,20 @@ img {
}
.item {
background-color: map-get($dark, "item");
display: flex;
display: inline-flex;
flex-direction: column;
justify-content: center;
background-color: map-get($dark, "item");
font-family: "Spartan";
padding: 0px 1rem;
height: 100%;
cursor: pointer;
span {
display: inline-flex;
}
&:hover {
background-color: map-get($dark, "background");
transition: all ease-in 150ms;
@ -193,6 +199,9 @@ img {
}
.dropdown.item {
position: relative;
display: inline-block;
&:hover .dropdown-content {
max-height: 100vh;
display: block;
@ -201,17 +210,16 @@ img {
& .dropdown-content {
max-height: 0px;
overflow-y: hidden;
top: 100%;
left: 0;
-webkit-transition: max-height 0.5s ease-in-out;
-moz-transition: max-height 0.5s ease-in-out;
-o-transition: max-height 0.5s ease-in-out;
transition: max-height 0.5s ease-in-out;
position: absolute;
background-color: map-get($dark, "item");
min-width: 160px;
margin-left: -1rem;
margin-top: 5.45em;
& a {
& .item {
color: $foreground;
padding: 12px 16px;
text-decoration: none;
@ -222,6 +230,22 @@ img {
transition: all ease-in 150ms;
}
}
& .dropdown.item {
position: relative;
display: inline-block;
overflow: visible;
& .dropdown-content {
max-width: 100vw;
max-height: 100vh;
}
}
}
& & .dropdown-content {
top: 0;
left: 100%;
}
}
@ -339,3 +363,18 @@ button {
transform: translateY(-15px);
}
}
// Desktop Titlebar Logic
@media (min-width: 767px) {
.dropdown.item.compact > *,
.dropdown.item.compact {
display: none;
}
}
// Mobile Titlebar Logic
@media (max-width: 767px) {
.titlebar.top .item:not(.compact) {
display: none;
}
}

View file

@ -1,18 +1,7 @@
const isMobile = () => {
return window.innerWidth < 767;
};
$(document).ready(() => {
if (isMobile()) {
// alert("'Detected' mobile device; fixing things up");
let titlebars = document.querySelectorAll(".titlebar");
titlebars.forEach((titlebar) => {
// TODO: Auto-convert to mobile-friendly bar
});
}
});
$(document).ready(function () {
$('.dropdown-submenu a.test').on("click", function (e) {
$(this).next('ul').toggle();
e.stopPropagation();
e.preventDefault();
});
});

View file

@ -21,6 +21,28 @@
<body>
<div class="top titlebar">
<!-- Mobile friendly menu -->
<div class="dropdown item compact">
<span>
<i class="fa fa-bars"></i>&nbsp;Menu
</span>
<div class="dropdown-content">
<div class="dropdown item">
<span>
Support&nbsp;<i class="fa fa-caret-right"></i>
</span>
<div class="dropdown-content">
<div class="item compact">Link 1</div>
<div class="item compact">Link 2</div>
<div class="item compact">Link 3</div>
</div>
</div>
</div>
</div>
<div class="item">
About
</div>
@ -30,16 +52,20 @@
<div class="item">
Reddit
</div>
<div class="dropdown item slidedown">
<div class="item">
YouTube
</div>
<div class="dropdown item">
<span>
Support&nbsp;<i class="fa fa-caret-down"></i>
</span>
<div class="dropdown-content">
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
<div class="item">Link 1</div>
<div class="item">Link 2</div>
<div class="item">Link 3</div>
</div>
</div>
</div>