ese-website/_includes/header.njk

44 lines
1.3 KiB
Plaintext
Raw Normal View History

2024-09-13 17:18:41 +02:00
<header>
<div id="header-veil"></div>
2024-09-23 14:37:40 +02:00
<div class="header-container content">
2024-09-20 18:39:35 +02:00
<a id="header-logo" href="{{ "/" | locale_url }}" title="home">
<img alt="ESE {{ese.year}} Logo" src="/ESELogo.svg">
2024-09-20 18:39:35 +02:00
</a>
2024-09-15 14:58:59 +02:00
<nav id="mainNav">
<button id="menu-toggle" onclick="toggleMenu()" aria-expanded="false"
2024-10-06 15:48:11 +02:00
aria-label="{{ 'menu' if lang == 'en' else 'Menü' }}">
{% icon "solid:bars" %}
</button>
2024-09-24 15:39:40 +02:00
{% set navPages = collections.mainNav | pageLang | eleventyNavigation %}
<ul>
{%- for entry in navPages -%}
2024-09-24 16:28:54 +02:00
<li>
<a class="nav-item {%- if entry.url == page.url %} active{% endif %}"
href="{{ entry.url }}">{{ entry.title }}</a>
2024-09-24 15:39:40 +02:00
</li>
{%- endfor %}
2024-09-24 16:33:50 +02:00
<li>
<a class="nav-item-stream" href="https://stream.ifsr.de/" target="_blank" rel="noopener">Stream</a>
</li>
2024-09-24 15:39:40 +02:00
</ul>
2024-09-15 14:58:59 +02:00
</nav>
</div>
2024-09-13 17:18:41 +02:00
</header>
2024-09-15 14:58:59 +02:00
{% css %}
2024-09-20 17:10:24 +02:00
{% include "header.css" %}
2024-09-15 14:58:59 +02:00
{% endcss %}
{% js %}
function toggleMenu() {
const menuToggle = document.getElementById("menu-toggle");
const mainNav = document.getElementById("mainNav");
const expanded = menuToggle.getAttribute("aria-expanded") === "true";
menuToggle.setAttribute("aria-expanded", !expanded);
mainNav.classList.toggle("open");
document.body.classList.toggle("noscroll");
}
{% endjs %}