add responsive menu #1

Merged
tuxmain merged 3 commits from responsive-menu into main 2023-05-27 12:15:47 +00:00
2 changed files with 19 additions and 10 deletions
Showing only changes of commit 67921ddfaa - Show all commits

View file

@ -43,13 +43,13 @@ header {
}
}
@media (min-width: 1024px) {
@media (min-width: 768px) {
.phone-only {
display: none;
}
}
@media (max-width: 1023px) {
@media (max-width: 767px) {
.menu-phone {
position: absolute;
top: 0;
@ -81,4 +81,9 @@ header {
}
summary {
list-style: none;
}

View file

@ -28,7 +28,17 @@
<h1 class="sr-only">Librezo</h1>
</a>
<nav id="header-menu">
<ul id="menu" class="hidden-phone menu-phone ">
<ul class="hidden-phone">
<li><a href="/fonctionnement">Fonctionnement</a></li>
<li><a href="/tarifs">Services et tarifs</a></li>
<li><a href="/qui-sommes-nous">Qui sommes-nous</a></li>
<li><a href="/charte">Charte</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
<li><details class="phone-only hamburger-menu" >
<summary>&#9776;</summary>
<ul id="menu" class=" menu-phone ">
<li>
<picture class="phone-only">
<source srcset="/img/librezo-little-white.png" media="(prefers-color-scheme: dark)"/>
@ -42,14 +52,8 @@
<li><a href="/charte">Charte</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
<li><button class="phone-only hamburger-menu" onclick="toggleMenu()">&#9776;</button></li>
</details></li>
</nav>
<script>
var menu = document.getElementById('menu');
function toggleMenu() {
menu.classList.toggle('hidden-phone');
}
</script>
</header>
{% block body %}{% endblock body %}
<footer>