fix(mobile-menu): fix close behavior, navigation, and vertical centering
All checks were successful
Deploy Theme / deploy (push) Successful in 14s
All checks were successful
Deploy Theme / deploy (push) Successful in 14s
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
}
|
}
|
||||||
}"
|
}"
|
||||||
:data-theme="theme"
|
:data-theme="theme"
|
||||||
|
@htmx:after-on-load.window="mobileMenuOpen = false"
|
||||||
class="hidden">
|
class="hidden">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
|
|||||||
@@ -6,15 +6,19 @@
|
|||||||
x-transition:leave="transition ease-in duration-300"
|
x-transition:leave="transition ease-in duration-300"
|
||||||
x-transition:leave-start="translate-x-0"
|
x-transition:leave-start="translate-x-0"
|
||||||
x-transition:leave-end="-translate-x-full"
|
x-transition:leave-end="-translate-x-full"
|
||||||
class="fixed inset-0 z-40 bg-[var(--bg-primary)] transform md:hidden"
|
class="fixed inset-0 z-50 bg-[var(--bg-primary)] flex flex-col md:hidden"
|
||||||
|
@click.away="mobileMenuOpen = false"
|
||||||
x-cloak>
|
x-cloak>
|
||||||
<div class="flex justify-between items-center p-5">
|
|
||||||
<a href="{{@site.url}}" class="site-logo-container">
|
<!-- Mobile Menu Header -->
|
||||||
|
<div class="flex justify-between items-center p-5 flex-none">
|
||||||
|
<a href="{{@site.url}}" class="flex items-center text-[var(--text-primary)]">
|
||||||
{{#if @site.logo}}
|
{{#if @site.logo}}
|
||||||
<img src="{{@site.logo}}" alt="{{@site.title}}" class="h-10 w-auto site-logo">
|
<img src="{{@site.logo}}" alt="{{@site.title}}" class="h-10 w-auto site-logo">
|
||||||
{{else}}
|
{{else}}
|
||||||
{{> "icons/logo" class="h-10 w-auto site-logo"}}
|
{{> "icons/logo" class="h-10 w-auto site-logo"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
<span class="ml-3 text-xl font-bold">{{@site.title}}</span>
|
||||||
</a>
|
</a>
|
||||||
<button @click="mobileMenuOpen = false" class="p-2 rounded-full bg-[var(--bg-secondary)] text-[var(--text-primary)] hover:bg-[var(--bg-tertiary)] transition-colors duration-200">
|
<button @click="mobileMenuOpen = false" class="p-2 rounded-full bg-[var(--bg-secondary)] text-[var(--text-primary)] hover:bg-[var(--bg-tertiary)] transition-colors duration-200">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||||
@@ -22,7 +26,11 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<nav class="flex flex-col items-center justify-center h-full space-y-8 text-2xl" @click="mobileMenuOpen = false">
|
|
||||||
|
<!-- Mobile Menu Navigation -->
|
||||||
|
<nav class="flex-grow flex flex-col items-center justify-center p-10 overflow-y-auto" @click="mobileMenuOpen = false">
|
||||||
|
<div class="w-full">
|
||||||
{{navigation type="primary"}}
|
{{navigation type="primary"}}
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user