@@ -31,57 +31,68 @@ const isDocs = !isHome;
3131 </a >
3232 </div >
3333
34- <!-- Mobile hamburger -->
35- <button id =" mobile-menu-btn" class =" md:hidden text-on-surface-variant hover:text-on-surface" aria-label =" Menu" >
36- <svg class =" w-6 h-6" fill =" none" stroke =" currentColor" viewBox =" 0 0 24 24" ><path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M4 6h16M4 12h16M4 18h16" /></svg >
37- </button >
3834 </div >
35+ </nav >
3936
40- <!-- Mobile menu -->
41- <div id =" mobile-menu" class =" hidden md:hidden border-t border-outline-variant bg-surface/95 backdrop-blur-md" >
42- <div class =" px-6 py-4 flex flex-col gap-3" >
43- <a href ={ ` ${prefix }#how-it-works ` } class =" text-sm text-on-surface-variant hover:text-on-surface transition-colors" >How It Works</a >
44- <a href ={ ` ${prefix }#connectors ` } class =" text-sm text-on-surface-variant hover:text-on-surface transition-colors" >Connectors</a >
45- <a href ={ ` ${prefix }#comparison ` } class =" text-sm text-on-surface-variant hover:text-on-surface transition-colors" >Compare</a >
46- <a href =" /docs/getting-started" class:list ={ [" text-sm transition-colors" , isDocs ? " text-primary font-medium" : " text-on-surface-variant hover:text-on-surface" ]} >Docs</a >
47- <a href ={ ` ${prefix }#get-started ` } class =" inline-flex justify-center px-4 py-2 bg-primary text-on-primary text-sm font-medium mt-2" >Get Started</a >
48- </div >
37+ <!-- Mobile bottom navigation bar -->
38+ <nav id =" mobile-bottom-nav" class =" fixed bottom-0 left-0 right-0 z-50 md:hidden border-t border-outline-variant bg-surface/95 backdrop-blur-md" >
39+ <div class =" flex items-center justify-around h-14 px-2" >
40+ <a href =" /" class:list ={ [" bottom-nav-item flex flex-col items-center gap-0.5 px-3 py-1 text-[11px] transition-colors" , isHome ? " text-primary" : " text-on-surface-variant hover:text-on-surface" ]} >
41+ <svg class =" w-5 h-5" fill =" none" stroke =" currentColor" stroke-width =" 1.5" viewBox =" 0 0 24 24" ><path stroke-linecap =" round" stroke-linejoin =" round" d =" M2.25 12l8.954-8.955a1.126 1.126 0 011.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" /></svg >
42+ <span >Home</span >
43+ </a >
44+ { isDocs && (
45+ <button id = " bottom-nav-docs-btn" class = " bottom-nav-item flex flex-col items-center gap-0.5 px-3 py-1 text-[11px] text-on-surface-variant hover:text-on-surface transition-colors" aria-label = " Documentation menu" >
46+ <svg class = " w-5 h-5" fill = " none" stroke = " currentColor" stroke-width = " 1.5" viewBox = " 0 0 24 24" ><path stroke-linecap = " round" stroke-linejoin = " round" d = " M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5" /></svg >
47+ <span >Menu</span >
48+ </button >
49+ )}
50+ <a href =" /docs/getting-started" class:list ={ [" bottom-nav-item flex flex-col items-center gap-0.5 px-3 py-1 text-[11px] transition-colors" , isDocs ? " text-primary" : " text-on-surface-variant hover:text-on-surface" ]} >
51+ <svg class =" w-5 h-5" fill =" none" stroke =" currentColor" stroke-width =" 1.5" viewBox =" 0 0 24 24" ><path stroke-linecap =" round" stroke-linejoin =" round" d =" M12 6.042A8.967 8.967 0 006 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 016 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 016-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0018 18a8.967 8.967 0 00-6 2.292m0-14.25v14.25" /></svg >
52+ <span >Docs</span >
53+ </a >
54+ <a href =" https://github.com/dvflw/mantle" class =" bottom-nav-item flex flex-col items-center gap-0.5 px-3 py-1 text-[11px] text-on-surface-variant hover:text-on-surface transition-colors" aria-label =" GitHub" >
55+ <svg class =" w-5 h-5" fill =" currentColor" viewBox =" 0 0 24 24" ><path d =" M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" /></svg >
56+ <span >GitHub</span >
57+ </a >
4958 </div >
5059</nav >
5160
5261<style >
5362 .nav-inner {
5463 transition: max-width 0.3s ease;
5564 }
65+ #mobile-bottom-nav {
66+ padding-bottom: env(safe-area-inset-bottom, 0px);
67+ }
68+ .bottom-nav-item {
69+ -webkit-tap-highlight-color: transparent;
70+ min-width: 3.5rem;
71+ }
72+ .bottom-nav-item:active {
73+ opacity: 0.7;
74+ }
5675</style >
5776
5877<script is:inline >
5978function initNav() {
60- const btn = document.getElementById('mobile-menu-btn');
61- const menu = document.getElementById('mobile-menu');
79+ const btn = document.getElementById('bottom-nav-docs-btn');
6280 const docsSidebar = document.getElementById('docs-sidebar-mobile');
6381 const overlay = document.getElementById('sidebar-overlay');
64- if (!btn) return;
82+ if (!btn || !docsSidebar || !overlay ) return;
6583
6684 // Remove old listeners by cloning
6785 const newBtn = btn.cloneNode(true);
6886 btn.parentNode?.replaceChild(newBtn, btn);
6987
7088 newBtn.addEventListener('click', () => {
71- if (docsSidebar && overlay) {
72- // On docs pages, toggle the sidebar drawer instead of the dropdown
73- const isOpen = !docsSidebar.classList.contains('-translate-x-full');
74- if (isOpen) {
75- docsSidebar.classList.add('-translate-x-full');
76- overlay.classList.add('hidden');
77- } else {
78- docsSidebar.classList.remove('-translate-x-full');
79- overlay.classList.remove('hidden');
80- }
81- // Keep dropdown hidden
82- if (menu) menu.classList.add('hidden');
83- } else if (menu) {
84- menu.classList.toggle('hidden');
89+ const isOpen = !docsSidebar.classList.contains('-translate-x-full');
90+ if (isOpen) {
91+ docsSidebar.classList.add('-translate-x-full');
92+ overlay.classList.add('hidden');
93+ } else {
94+ docsSidebar.classList.remove('-translate-x-full');
95+ overlay.classList.remove('hidden');
8596 }
8697 });
8798}
0 commit comments