Merge pull request #27 from traeblain/feature-burger

Added Hamburger Menu for small screens per Bulma spec.
This commit is contained in:
Bastien Wirtz 2020-03-17 22:17:07 -07:00 committed by GitHub
commit 2cf93f3881
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 389 additions and 272 deletions

301
app.css
View File

@ -1,189 +1,259 @@
@charset "UTF-8";
/* raleway-regular - latin */
@font-face {
font-family: 'Raleway';
font-family: "Raleway";
font-style: normal;
font-weight: 400;
font-display: swap;
src: local("Raleway"), local("Raleway-Regular"), url("./webfonts/raleway/raleway-v14-latin-regular.woff2") format("woff2"), url("./webfonts/raleway/raleway-v14-latin-regular.woff") format("woff");
/* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ }
/* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* lato-regular - latin */
@font-face {
font-family: 'Lato';
font-family: "Lato";
font-style: normal;
font-weight: 400;
font-display: swap;
src: local("Lato Regular"), local("Lato-Regular"), url("./webfonts/lato/lato-v16-latin-regular.woff2") format("woff2"), url("./webfonts/lato/lato-v16-latin-regular.woff") format("woff");
/* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ }
/* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
html {
height: 100%; }
height: 100%;
}
body {
font-family: 'Raleway', sans-serif;
height: 100%; }
font-family: "Raleway", sans-serif;
height: 100%;
}
body #app {
min-height: 100%;
transition: background-color cubic-bezier(0.165, 0.84, 0.44, 1) 300ms;
background-color: #f5f5f5;
color: #363636; }
color: #363636;
}
body #app a:hover {
color: #363636; }
color: #363636;
}
body #app .title {
color: #303030; }
color: #303030;
}
body #app .subtitle {
color: #424242; }
color: #424242;
}
body #app .card {
background-color: #ffffff;
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.1); }
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.1);
}
body #app .card:hover {
background-color: #ffffff; }
background-color: #ffffff;
}
body #app .footer {
background-color: #ffffff;
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.1); }
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.1);
}
@media (prefers-color-scheme: light), (prefers-color-scheme: no-preference) {
body #app {
background-color: #f5f5f5;
color: #363636; }
color: #363636;
}
body #app a:hover {
color: #363636; }
color: #363636;
}
body #app .title {
color: #303030; }
color: #303030;
}
body #app .subtitle {
color: #424242; }
color: #424242;
}
body #app .card {
background-color: #ffffff;
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.1); }
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.1);
}
body #app .card:hover {
background-color: #ffffff; }
background-color: #ffffff;
}
body #app .footer {
background-color: #ffffff;
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.1); } }
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.1);
}
}
@media (prefers-color-scheme: dark) {
body #app {
background-color: #131313;
color: #eaeaea; }
color: #eaeaea;
}
body #app a:hover {
color: #ffdd57; }
color: #ffdd57;
}
body #app .title {
color: #fafafa; }
color: #fafafa;
}
body #app .subtitle {
color: #f5f5f5; }
color: #f5f5f5;
}
body #app .card {
background-color: #2b2b2b;
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.4); }
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.4);
}
body #app .card:hover {
background-color: #2b2b2b; }
background-color: #2b2b2b;
}
body #app .footer {
background-color: #2b2b2b;
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.4); } }
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.4);
}
}
body #app.is-light {
background-color: #f5f5f5;
color: #363636; }
color: #363636;
}
body #app.is-light a:hover {
color: #363636; }
color: #363636;
}
body #app.is-light .title {
color: #303030; }
color: #303030;
}
body #app.is-light .subtitle {
color: #424242; }
color: #424242;
}
body #app.is-light .card {
background-color: #ffffff;
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.1); }
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.1);
}
body #app.is-light .card:hover {
background-color: #ffffff; }
background-color: #ffffff;
}
body #app.is-light .footer {
background-color: #ffffff;
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.1); }
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.1);
}
body #app.is-dark {
background-color: #131313;
color: #eaeaea; }
color: #eaeaea;
}
body #app.is-dark a:hover {
color: #ffdd57; }
color: #ffdd57;
}
body #app.is-dark .title {
color: #fafafa; }
color: #fafafa;
}
body #app.is-dark .subtitle {
color: #f5f5f5; }
color: #f5f5f5;
}
body #app.is-dark .card {
background-color: #2b2b2b;
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.4); }
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.4);
}
body #app.is-dark .card:hover {
background-color: #2b2b2b; }
background-color: #2b2b2b;
}
body #app.is-dark .footer {
background-color: #2b2b2b;
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.4); }
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.4);
}
body h1, body h2, body h3, body h4, body h5, body h6 {
font-family: 'Lato', sans-serif; }
font-family: "Lato", sans-serif;
}
body h1 {
font-size: 2rem; }
font-size: 2rem;
}
body h2 {
font-size: 1.7rem;
margin-top: 2rem;
margin-bottom: 1rem; }
margin-bottom: 1rem;
}
body h2 .fas, body h2 .fab, body h2 .far {
margin-right: 10px; }
margin-right: 10px;
}
body h2 span {
font-weight: bold;
color: #4285f4; }
color: #4285f4;
}
body [v-cloak] {
display: none; }
display: none;
}
body #bighead {
color: #ffffff; }
color: #ffffff;
}
body #bighead .dashboard-title {
padding: 6px 0 0 80px; }
padding: 6px 0 0 80px;
}
body #bighead .first-line {
height: 100px;
vertical-align: center;
background-color: #3367d6; }
background-color: #3367d6;
}
body #bighead .first-line h1 {
margin-top: -12px;
font-size: 2rem; }
font-size: 2rem;
}
body #bighead .first-line .headline {
margin-top: 5px;
font-size: 0.9rem; }
font-size: 0.9rem;
}
body #bighead .first-line .container {
height: 80px;
padding: 10px 0; }
padding: 10px 0;
}
body #bighead .first-line .logo {
float: left; }
float: left;
}
body #bighead .first-line .logo i {
vertical-align: top;
padding: 8px 15px;
font-size: 50px; }
font-size: 50px;
}
body #bighead .first-line .logo img {
padding: 10px;
max-height: 70px;
max-width: 70px; }
body #bighead .navbar {
background-color: #4285f4; }
body #bighead .navbar a {
color: #ffffff; }
body #bighead .navbar a:hover, body #bighead .navbar a:focus {
max-width: 70px;
}
body #bighead .navbar, body #bighead .navbar-menu {
background-color: #4285f4;
}
body #bighead .navbar a, body #bighead .navbar-menu a {
color: #ffffff;
background-color: #5a95f5; }
}
body #bighead .navbar a:hover, body #bighead .navbar a:focus, body #bighead .navbar-menu a:hover, body #bighead .navbar-menu a:focus {
color: #ffffff;
background-color: #5a95f5;
}
body #bighead .navbar-end {
text-align: right;
}
body #main-section {
margin-bottom: 2rem;
padding: 0; }
padding: 0;
}
body #main-section h2 {
border-bottom: 1px dashed #ccc;
padding-bottom: 10px; }
padding-bottom: 10px;
}
body #main-section .title {
font-size: 1.1em; }
font-size: 1.1em;
}
body #main-section .subtitle {
font-size: .9em;
font-size: 0.9em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis; }
text-overflow: ellipsis;
}
body #main-section .container {
padding: 1.2rem .75rem; }
padding: 1.2rem 0.75rem;
}
body #main-section .message {
margin-top: 45px;
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.1); }
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.1);
}
body #main-section .message .message-header {
font-weight: bold; }
font-weight: bold;
}
body #main-section .message .message-body {
border: none; }
border: none;
}
body .media-content {
overflow: inherit; }
overflow: inherit;
}
body .tag {
color: #4285f4;
background-color: #4285f4;
@ -193,33 +263,44 @@ body {
width: 3px;
overflow: hidden;
transition: all 0.2s ease-out;
padding: 0; }
padding: 0;
}
body .tag .tag-text {
display: none; }
display: none;
}
body .card {
border-radius: 5px;
border: none;
box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.1);
transition: cubic-bezier(0.165, 0.84, 0.44, 1) 300ms; }
transition: cubic-bezier(0.165, 0.84, 0.44, 1) 300ms;
}
body .card a {
outline: none; }
outline: none;
}
body .card:hover {
transform: translate(0, -3px); }
transform: translate(0, -3px);
}
body .card:hover .tag {
width: auto;
color: #ffffff;
padding: 0 0.75em; }
padding: 0 0.75em;
}
body .card:hover .tag .tag-text {
display: block; }
display: block;
}
body .card-content {
height: 85px;
padding: 1.3rem; }
padding: 1.3rem;
}
body .layout-vertical .card {
border-radius: 0; }
border-radius: 0;
}
body .layout-vertical .column div:first-of-type .card {
border-radius: 5px 5px 0 0; }
border-radius: 5px 5px 0 0;
}
body .layout-vertical .column div:last-child .card {
border-radius: 0 0 5px 5px; }
border-radius: 0 0 5px 5px;
}
body .footer {
position: fixed;
left: 0;
@ -229,49 +310,63 @@ body {
text-align: left;
color: #676767;
font-size: 0.85rem;
transition: background-color cubic-bezier(0.165, 0.84, 0.44, 1) 300ms; }
transition: background-color cubic-bezier(0.165, 0.84, 0.44, 1) 300ms;
}
body .no-footer #main-section {
margin-bottom: 0; }
margin-bottom: 0;
}
body .no-footer .footer {
display: none; }
display: none;
}
body .search-bar {
position: relative;
display: inline-block; }
display: inline-block;
}
body .search-bar #search {
border: none;
background-color: #5f98f6;
border-radius: 5px;
padding: 2px 12px 2px 30px;
margin: 10px 0;
margin: 0 0 0 12px;
transition: all 100ms linear;
color: #ffffff;
height: 30px;
width: 100px; }
width: 100px;
}
body .search-bar #search:focus {
color: #000000;
width: 250px;
background-color: #ffffff; }
background-color: #ffffff;
}
body .search-bar .search-label::before {
font-family: 'Font Awesome 5 Free';
font-family: "Font Awesome 5 Free";
position: absolute;
top: 12px;
left: 8px;
content: "\f002";
top: 4px;
left: 16px;
content: "";
font-weight: 900;
width: 20px;
height: 20px; }
height: 20px;
color: #ffffff;
}
body .search-bar:focus-within .search-label::before {
color: #4a4a4a; }
color: #4a4a4a;
}
body .icon-button {
display: inline-block; }
display: inline-block;
padding: 0 12px;
}
body .offline-message {
text-align: center;
margin: 35px 0; }
margin: 35px 0;
}
body .offline-message i {
font-size: 2rem; }
font-size: 2rem;
}
body .offline-message i.fa-redo-alt {
font-size: 1.3rem;
line-height: 1rem;
vertical-align: middle;
cursor: pointer;
color: #3273dc; }
color: #3273dc;
}

6
app.js
View File

@ -5,7 +5,8 @@ const app = new Vue({
offline: false,
filter: '',
vlayout: true,
isDark: null
isDark: null,
showMenu: false
},
created: async function () {
let that = this;
@ -81,6 +82,9 @@ const app = new Vue({
this.vlayout = !this.vlayout;
localStorage.vlayout = this.vlayout;
},
toggleMenu: function() {
this.showMenu = !this.showMenu;
}
}
});

View File

@ -175,7 +175,7 @@ body {
}
}
}
.navbar {
.navbar, .navbar-menu {
background-color: $secondary-color;
a {
@ -186,6 +186,9 @@ body {
}
}
}
.navbar-end {
text-align: right;
}
}
#main-section {
@ -320,7 +323,7 @@ body {
background-color: lighten( $secondary-color, 6% );
border-radius: 5px;
padding: 2px 12px 2px 30px;
margin: 10px 0;
margin: 0 0 0 12px;
transition: all 100ms linear;
color: #ffffff;
height: 30px;
@ -337,12 +340,13 @@ body {
.search-label::before {
font-family: 'Font Awesome 5 Free';
position: absolute;
top: 12px;
left: 8px;
top: 4px;
left: 16px;
content: "\f002";
font-weight: 900;
width: 20px;
height: 20px;
color: #ffffff;
}
&:focus-within .search-label::before {
@ -352,6 +356,7 @@ body {
.icon-button {
display: inline-block;
padding: 0 12px;
}
.offline-message {

View File

@ -30,20 +30,32 @@
<div v-cloak v-if="config.links" class="container-fluid">
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="container">
<div class="navbar-menu">
<div class="navbar-brand">
<a role="button"
class="navbar-burger" :class="{ 'is-active': showMenu }"
aria-label="menu" aria-expanded="false"
v-on:click="toggleMenu()">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
<div class="navbar-menu" :class="{ 'is-active': showMenu }">
<div class="navbar-start">
<a v-for="link in config.links" class="navbar-item" :href="link.url" :target="link.target">
<i v-if="link.icon" style="margin-right: 6px;" :class="link.icon"></i>
{{ link.name }}
</a>
</div>
<div class="end">
<div class="navbar-end">
<div class="navbar-item">
<a
v-on:click="toggleTheme()"
aria-label="Toggle dark mode"
class="icon-button"
><i class="fas fa-adjust"></i>
</a>
<a v-on:click="toggleLayout()" class="icon-button navbar-item"><i
<a v-on:click="toggleLayout()" class="icon-button"><i
:class="['fas', vlayout ? 'fa-list' : 'fa-columns']"></i></a>
<div class="search-bar">
<label for="search" class="search-label"></label>
@ -52,6 +64,7 @@
</div>
</div>
</div>
</div>
</nav>
</div>
</div>