Created
October 24, 2022 12:00
-
-
Save Lazerproof/9e55ec3fb7144696ad67a5263d797dff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="flex flex-col divide-y divide-primary-400"> | |
<?php foreach ($items as $index => $item): ?> | |
<div x-disclosure class=""> | |
<div | |
class="flex w-full items-center divide-x divide-primary-400" | |
> | |
<a href="<?= $item->url; ?>" class="block px-4 py-3 uppercase text-white grow font-serif"> | |
<?= $item->title; ?> | |
</a> | |
<?php if (count($item->children)): ?> | |
<div x-disclosure:button class="relative shrink text-2xl text-white px-4 py-2 cursor-pointer w-12 h-12"> | |
<span x-show="$disclosure.isOpen" x-cloak aria-hidden="true" class="absolute left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2 transform leading-none">−</span> | |
<span x-show="! $disclosure.isOpen" aria-hidden="true" class="absolute left-1/2 top-1/2 -translate-y-1/2 -translate-x-1/2 transform leading-none">+</span> | |
</div> | |
<?php endif; ?> | |
</div> | |
<?php if (count($item->children)): ?> | |
<div x-disclosure:panel x-collapse class="py-1 divide-y divide-primary-400" :class="$disclosure.isOpen ? 'border-t border-primary-400' : ''"> | |
<?php foreach ($item->children as $index => $item): ?> | |
<a href="<?= $item->url; ?>" class="block text-white font-serif px-4 py-3 uppercase"> | |
<?= $item->title; ?> | |
</a> | |
<?php endforeach; ?> | |
</div> | |
<?php endif; ?> | |
</div> | |
<?php endforeach; ?> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<nav x-data="{open: false, id: null}" x-on:m0ouseleave="open = false, id = null" class=""> | |
<ul class="flex justify-center divide-x divide-solid divide-slate-300"> | |
<?php foreach ($items as $item): ?> | |
<li x-data="{active: false}" class="first:pl-0 px-4 last:pr-0" x-on:mouseover="show = true, id = <?= $item->id; ?>"> | |
<a href="<?= $item->url; ?>" class=" leading-none block text-lg font-serif uppercase text-gray-900 hover:text-primary transition-colors"> | |
<?= $item->title; ?> | |
</a> | |
<?php if (count($item->children)): ?> | |
<div x-cloak x-show="id === <?= $item->id; ?>" x-on:mouseleave="id = null" class="absolute bg-white top-full left-0 right-0 z-30 shadow"> | |
<div class="container px-5"> | |
<div class="py-6"> | |
<ul class="grid gap-4 place-content-center grid-cols-4 xl:grid-cols-5"> | |
<?php foreach ($item->children as $child): ?> | |
<li> | |
<a href="<?= $child->url; ?>" class="block hover:text-primary text-center font-serif uppercase p-3 bg-gray-50 hover:bg-gray-100 dark:hover:bg-gray-700"> | |
<?= $child->title; ?> | |
</a> | |
</li> | |
<?php endforeach; ?> | |
</ul> | |
</div> | |
</div> | |
</div> | |
<?php endif; ?> | |
</li> | |
<?php endforeach; ?> | |
</ul> | |
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="flex justify-center divide-x divide-solid divide-slate-300"> | |
<?php foreach ($items as $index => $item): ?> | |
<a href="<?= $item->url; ?>" class="first:pl-0 px-3 leading-none last:pr-0 block font-serif text-xs uppercase text-slate-300 hover:text-primary transition-colors"> | |
<?= $item->title; ?> | |
</a> | |
<?php endforeach; ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment