ese-website/_includes/header.njk

44 lines
1.4 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 {{year}} Logo" src="/static/ESELogo24.svg">
</a>
2024-09-15 14:58:59 +02:00
<nav id="mainNav">
<button id="menu-toggle" onclick="toggleMenu()" aria-expanded="false"
aria-label="{{ 'toggle menu' if lang == 'en' else 'Menü ausklappen' }}">
{% 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 %}