start nav mobile

This commit is contained in:
isUnknown 2024-09-06 18:15:43 +02:00
parent e3680dcefb
commit a23a5ba06b
6 changed files with 95 additions and 14 deletions

View file

@ -49,9 +49,11 @@
</a>
<ul class="expanded-nav__columns">
<?php foreach($site->children()->listed() as $category): ?>
<li>
<h4 class="expanded-nav__category"><a href="<?= $category->url() ?>"><?= $category->title() ?></a></h4>
<ul>
<li x-data="{
open: false
}">
<h4 class="expanded-nav__category"><a href="<?= $category->url() ?>"><?= $category->title() ?></a><button class="toggle" :class="open ? 'open': ''" @click="open = !open">→</button></h4>
<ul class="expanded-nav__subcategories" :class="open ? 'open': ''">
<?php foreach($category->children() as $subcategory): ?>
<?php if ($subcategory->isIndexed() == 'true'): ?>
<li><a class="expanded-nav__subcategory" href="<?= $category->url() . '/#' . $subcategory->slug() ?>"><?= $subcategory->title() ?></a></li>