feat: DropDown jetzt mit mehr hübsch.

This commit is contained in:
muli 2024-01-21 21:50:20 +01:00
parent 39d51fadbc
commit 4fd01e2eca
3 changed files with 8 additions and 8 deletions

View File

@ -122,11 +122,11 @@ body {
.primary_nav__sub_navlink { .primary_nav__sub_navlink {
color: var(--wtf-nearly-white); color: var(--wtf-nearly-white);
text-decoration: underline;
} }
.primary_nav__navlink:hover { .primary_nav__sub_navlink:hover {
color: var(--wtf-mid-grey); text-decoration: none;
text-decoration: underline;
} }
.primary_nav__sub_navlist.-closed { .primary_nav__sub_navlist.-closed {
@ -162,7 +162,7 @@ body {
} }
/* Malt bei vorhandenem Submenü den Pfeil */ /* Malt bei vorhandenem Submenü den Pfeil */
.primary_nav__navlist li a:first-child:nth-last-child(2):after { .primary_nav__navlist li span:first-child:nth-last-child(2):after {
content: ""; content: "";
position: relative; position: relative;
top: -0.125rem; top: -0.125rem;

View File

@ -10,7 +10,7 @@ document.getElementsByClassName('primary_nav__toggle')[0].addEventListener('clic
let primary_menu_items = document.getElementsByClassName('primary_nav__navitem'); let primary_menu_items = document.getElementsByClassName('primary_nav__navitem');
for (let i = 0; i < primary_menu_items.length; i++) { for (let i = 0; i < primary_menu_items.length; i++) {
primary_menu_items[i].addEventListener('click', function(event) { primary_menu_items[i].addEventListener('click', function(event) {
let dropdown = event.currentTarget.firstElementChild; let dropdown = event.currentTarget.children[1];
if (dropdown.classList.contains('-closed')) { if (dropdown.classList.contains('-closed')) {
dropdown.classList.remove('-closed'); dropdown.classList.remove('-closed');
dropdown.classList.add('-open'); dropdown.classList.add('-open');

View File

@ -13,11 +13,11 @@
{% for title, mapping in bag("navigation").items() %} {% for title, mapping in bag("navigation").items() %}
{% if mapping.visible|default(true) %} {% if mapping.visible|default(true) %}
<li id="{{ mapping.slug }}" class="primary_nav__navitem"> <li id="{{ mapping.slug }}" class="primary_nav__navitem">
{{ title }} <span>{{ title }}</span>
{% if mapping.list_childs %} {% if mapping.list_childs %}
<ul class="primary_nav__sub_navlist -closed"> <ul class="primary_nav__sub_navlist -closed">
<li> <li class="primary_nav__sub_navitem">
<a class="primary_nav__navlink {% if this._path == mapping.href or <a class="primary_nav__sub_navlink {% if this._path == mapping.href or
this._path in mapping['items'].values() or this._path in mapping['items'].values() or
title == 'Aktuelles' and title == 'Aktuelles' and
('blog' in this._path or 'podcast' in this._path) ('blog' in this._path or 'podcast' in this._path)