338c190ae8
Enhance the navigation with a modern floating glass design, new Browse and Community dropdown links, and improved theme/blur toggles that now handle multiple instances. Update dropdown components with rounded styling and support for wider widths, refine nav-link active states, and add navigation feature tests.
39 lines
1.4 KiB
PHP
39 lines
1.4 KiB
PHP
@props(['align' => 'right', 'width' => '48', 'contentClasses' => 'p-2 rounded-2xl border border-gray-200/70 dark:border-white/10 bg-white/95 dark:bg-neutral-900/80 backdrop-blur-2xl shadow-2xl shadow-black/10 dark:shadow-black/50'])
|
|
|
|
@php
|
|
$alignmentClasses = match ($align) {
|
|
'left' => 'ltr:origin-top-left rtl:origin-top-right start-0',
|
|
'top' => 'origin-top',
|
|
default => 'ltr:origin-top-right rtl:origin-top-left end-0',
|
|
};
|
|
|
|
$width = match ($width) {
|
|
'48' => 'w-48',
|
|
'56' => 'w-56',
|
|
'64' => 'w-64',
|
|
'72' => 'w-72',
|
|
default => $width,
|
|
};
|
|
@endphp
|
|
|
|
<div class="relative" x-data="{ open: false }" @click.outside="open = false" @close.stop="open = false">
|
|
<div @click="open = ! open">
|
|
{{ $trigger }}
|
|
</div>
|
|
|
|
<div x-show="open"
|
|
x-transition:enter="transition ease-out duration-200"
|
|
x-transition:enter-start="opacity-0 scale-95"
|
|
x-transition:enter-end="opacity-100 scale-100"
|
|
x-transition:leave="transition ease-in duration-75"
|
|
x-transition:leave-start="opacity-100 scale-100"
|
|
x-transition:leave-end="opacity-0 scale-95"
|
|
class="absolute z-50 mt-2 {{ $width }} rounded-2xl shadow-lg {{ $alignmentClasses }}"
|
|
style="display: none;"
|
|
@click="open = false">
|
|
<div class="rounded-2xl ring-1 ring-black/5 {{ $contentClasses }}">
|
|
{{ $content }}
|
|
</div>
|
|
</div>
|
|
</div>
|