This commit is contained in:
Vula Builder
2026-08-05 18:14:36 +00:00
parent c3c7b061c7
commit 42dfa68305
+69
View File
@@ -0,0 +1,69 @@
'use client';
import { useState, useEffect } from 'react';
import { Menu, Scale, X } from 'lucide-react';
import Link from 'next/link';
import { cn } from '@/lib/utils';
export default function Navigation() {
const [isOpen, setIsOpen] = useState(false);
const [scrolled, setScrolled] = useState(false);
useEffect(() => {
const onScroll = () => setScrolled(window.scrollY > 80);
window.addEventListener('scroll', onScroll, { passive: true });
return () => window.removeEventListener('scroll', onScroll);
}, []);
return (
<>
<div className="fixed top-4 left-0 right-0 z-50 flex justify-center px-4">
<style>{`html { scroll-behavior: smooth; }`}</style>
<header className={cn("flex items-center gap-6 px-6 py-3 rounded-full backdrop-blur-md border shadow-lg transition-all duration-300", scrolled ? "bg-white/90 border-border" : "bg-background/10 border-white/20")}>
{/* Logo */}
<Link href="/" className="flex items-center gap-2 hover:opacity-90 transition-opacity">
<div className="w-7 h-7 rounded-lg bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0">
<Scale className="h-4 w-4" />
</div>
<span className={cn("font-serif text-base font-bold transition-colors", scrolled ? "text-foreground" : "text-white")}>Gumede & Partners</span>
</Link>
{/* Desktop nav */}
<nav className="hidden md:flex items-center gap-5">
<Link href="/" className={cn("transition-colors text-sm font-medium", scrolled ? "text-foreground/70 hover:text-foreground" : "text-white/80 hover:text-white")}>Home</Link>
<a href="#practice-areas" className={cn("transition-colors text-sm font-medium", scrolled ? "text-foreground/70 hover:text-foreground" : "text-white/80 hover:text-white")}>Practice Areas</a>
<a href="#about-firm" className={cn("transition-colors text-sm font-medium", scrolled ? "text-foreground/70 hover:text-foreground" : "text-white/80 hover:text-white")}>About</a>
<Link href="/our-team" className={cn("transition-colors text-sm font-medium", scrolled ? "text-foreground/70 hover:text-foreground" : "text-white/80 hover:text-white")}>Team</Link>
<a href="/gallery" className={cn("transition-colors text-sm font-medium", scrolled ? "text-foreground/70 hover:text-foreground" : "text-white/80 hover:text-white")}>Gallery</a>
<a href="#firm-contact" className={cn("transition-colors text-sm font-medium", scrolled ? "text-foreground/70 hover:text-foreground" : "text-white/80 hover:text-white")}>Contact</a>
<Link href="/booking" className="bg-primary text-primary-foreground px-3 py-1.5 rounded-full hover:bg-primary/90 transition-colors text-sm font-medium">Book Consultation</Link>
</nav>
{/* Mobile toggle */}
<button
className={cn("md:hidden p-1.5 rounded-full transition-colors", scrolled ? "text-foreground hover:bg-muted" : "text-white hover:bg-white/10")}
onClick={() => setIsOpen(!isOpen)}
aria-label="Toggle menu"
>
{isOpen ? <X className="h-5 w-5" /> : <Menu className="h-5 w-5" />}
</button>
</header>
</div>
{/* Mobile nav */}
{isOpen && (
<div className="fixed top-[72px] left-4 right-4 z-50 rounded-2xl bg-background/95 backdrop-blur border border-border shadow-lg py-3 md:hidden">
<Link href="/" className="block px-3 py-2 rounded-lg text-foreground hover:bg-muted transition-colors" onClick={() => setIsOpen(false)}>Home</Link>
<a href="#practice-areas" className="block px-3 py-2 rounded-lg text-foreground hover:bg-muted transition-colors" onClick={() => setIsOpen(false)}>Practice Areas</a>
<a href="#about-firm" className="block px-3 py-2 rounded-lg text-foreground hover:bg-muted transition-colors" onClick={() => setIsOpen(false)}>About</a>
<a href="#legal-team" className="block px-3 py-2 rounded-lg text-foreground hover:bg-muted transition-colors" onClick={() => setIsOpen(false)}>Team</a>
<a href="#office-gallery" className="block px-3 py-2 rounded-lg text-foreground hover:bg-muted transition-colors" onClick={() => setIsOpen(false)}>Gallery</a>
<a href="#firm-contact" className="block px-3 py-2 rounded-lg text-foreground hover:bg-muted transition-colors" onClick={() => setIsOpen(false)}>Contact</a>
<Link href="/booking" className="block px-3 py-2 rounded-lg bg-primary text-primary-foreground font-medium" onClick={() => setIsOpen(false)}>Book Consultation</Link>
</div>
)}
</>
);
}