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"
|
||||
@htmx:after-on-load.window="mobileMenuOpen = false"
|
||||
class="hidden">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
@@ -6,15 +6,19 @@
|
||||
x-transition:leave="transition ease-in duration-300"
|
||||
x-transition:leave-start="translate-x-0"
|
||||
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>
|
||||
<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}}
|
||||
<img src="{{@site.logo}}" alt="{{@site.title}}" class="h-10 w-auto site-logo">
|
||||
{{else}}
|
||||
{{> "icons/logo" class="h-10 w-auto site-logo"}}
|
||||
{{/if}}
|
||||
<span class="ml-3 text-xl font-bold">{{@site.title}}</span>
|
||||
</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">
|
||||
<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>
|
||||
</button>
|
||||
</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"}}
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user