Use the same hamburger-triggered menu on desktop and mobile
The nav links no longer show inline on desktop - clicking the hamburger icon now opens the same fullscreen overlay menu on every screen size, instead of only on mobile. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
b3c1f68581
commit
3cc84c6c06
1 changed files with 2 additions and 9 deletions
|
|
@ -86,17 +86,10 @@ export default function Navbar() {
|
||||||
|
|
||||||
<div className="mx-auto grid max-w-6xl grid-cols-[1fr_auto_1fr] items-center gap-3 px-4 py-3 sm:px-6">
|
<div className="mx-auto grid max-w-6xl grid-cols-[1fr_auto_1fr] items-center gap-3 px-4 py-3 sm:px-6">
|
||||||
<div className="flex items-center justify-self-start">
|
<div className="flex items-center justify-self-start">
|
||||||
<nav className="hidden items-center gap-6 text-sm font-medium text-neutral-600 dark:text-neutral-300 md:flex">
|
|
||||||
<Link to="/fahrzeuge" className="hover:text-brand-500">Fahrzeuge</Link>
|
|
||||||
<Link to="/leistungen" className="hover:text-brand-500">Leistungen</Link>
|
|
||||||
<Link to="/galerie" className="hover:text-brand-500">Galerie</Link>
|
|
||||||
<Link to="/kontakt" className="hover:text-brand-500">Kontakt</Link>
|
|
||||||
</nav>
|
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onClick={() => setOpen(true)}
|
onClick={() => setOpen(true)}
|
||||||
aria-label="Menü öffnen"
|
aria-label="Menü öffnen"
|
||||||
className="rounded-md p-2 text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800 md:hidden"
|
className="rounded-md p-2 text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"
|
||||||
>
|
>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" className="h-6 w-6">
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" className="h-6 w-6">
|
||||||
<path strokeLinecap="round" strokeLinejoin="round" d="M4 6h16M4 12h16M4 18h16" />
|
<path strokeLinecap="round" strokeLinejoin="round" d="M4 6h16M4 12h16M4 18h16" />
|
||||||
|
|
@ -117,7 +110,7 @@ export default function Navbar() {
|
||||||
{mounted &&
|
{mounted &&
|
||||||
createPortal(
|
createPortal(
|
||||||
<div
|
<div
|
||||||
className="fixed inset-0 z-[100] flex flex-col items-end justify-center gap-5 overflow-y-auto px-8 py-24 text-right backdrop-blur-xl md:hidden"
|
className="fixed inset-0 z-[100] flex flex-col items-end justify-center gap-5 overflow-y-auto px-8 py-24 text-right backdrop-blur-xl"
|
||||||
style={{ background: 'linear-gradient(135deg, #f1f5f9 0%, #e3f0cf 50%, #f8fafc 100%)' }}
|
style={{ background: 'linear-gradient(135deg, #f1f5f9 0%, #e3f0cf 50%, #f8fafc 100%)' }}
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue