Merge latest changes #1

Merged
ArisuOngaku merged 1 commits from develop into master 2020-07-06 12:05:56 +02:00
4 changed files with 43 additions and 13 deletions

View File

@ -2,6 +2,7 @@ import './external_links';
import './message_icons'; import './message_icons';
import './forms'; import './forms';
import './copyable_text'; import './copyable_text';
import './main_menu';
import '../sass/app.scss'; import '../sass/app.scss';

17
assets/js/main_menu.js Normal file
View File

@ -0,0 +1,17 @@
document.addEventListener('DOMContentLoaded', () => {
const menuButton = document.getElementById('menu-button');
const mainMenu = document.getElementById('main-menu');
menuButton.addEventListener('click', (e) => {
e.stopPropagation();
mainMenu.classList.toggle('open');
});
mainMenu.addEventListener('click', (e) => {
e.stopPropagation();
});
document.addEventListener('click', () => {
mainMenu.classList.remove('open');
});
});

View File

@ -76,13 +76,13 @@ header {
} }
} }
a:hover { a:hover, a:active {
background-color: rgba(255, 255, 255, 0.07); background-color: rgba(255, 255, 255, 0.07);
} }
} }
} }
.hamburger { #menu-button {
display: none; display: none;
} }
} }
@ -90,17 +90,29 @@ header {
@media (max-width: $menuLayoutSwitchTreshold) { @media (max-width: $menuLayoutSwitchTreshold) {
flex-direction: row-reverse; flex-direction: row-reverse;
.logo {
padding: 0 16px 0 8px;
font-size: 24px;
img {
margin-right: 8px;
}
}
nav { nav {
flex: 1; #menu-button {
.hamburger {
display: block; display: block;
margin: 0;
padding: 0 16px; padding: 0 16px;
line-height: $headerHeight;
cursor: pointer; cursor: pointer;
background: transparent;
border-radius: 0;
width: max-content; .feather {
--icon-size: 28px;
&:hover { margin: 0 8px;
width: auto;
} }
} }
@ -112,14 +124,14 @@ header {
transition: transform ease-out 150ms; transition: transform ease-out 150ms;
background-color: $headerBackground; background-color: $headerBackground;
}
.hamburger:hover + ul, ul:hover { &.open {
transform: translateX(0%); transform: translateX(0%);
} }
} }
} }
} }
}
footer { footer {
padding: 8px; padding: 8px;

View File

@ -14,8 +14,8 @@
{% block header %} {% block header %}
<a href="/" class="logo"><img src="/img/logo.svg" alt="Logo"> {{ app.name }}</a> <a href="/" class="logo"><img src="/img/logo.svg" alt="Logo"> {{ app.name }}</a>
<nav> <nav>
<div class="hamburger"><i data-feather="menu"></i></div> <button id="menu-button"><i data-feather="menu"></i></button>
<ul> <ul id="main-menu">
<li><a href="{{ route('about') }}"><i data-feather="info"></i> About</a></li> <li><a href="{{ route('about') }}"><i data-feather="info"></i> About</a></li>
</ul> </ul>
</nav> </nav>