This commit is contained in:
Vula Builder
2026-06-27 09:51:13 +00:00
parent 2e58c99639
commit 72445f4bf8
+65
View File
@@ -0,0 +1,65 @@
'use client';
import { useState, useEffect } from 'react';
import { Leaf, Menu, 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 > 40);
window.addEventListener('scroll', onScroll, { passive: true });
return () => window.removeEventListener('scroll', onScroll);
}, []);
return (
<header className={cn("fixed top-0 left-0 right-0 z-50 transition-all duration-300", scrolled && "bg-background/95 backdrop-blur shadow-sm border-b border-border/40")}>
<style>{`html { scroll-behavior: smooth; }`}</style>
<div className="container mx-auto px-4 sm:px-6 lg:px-8">
<div className="flex h-16 items-center justify-between">
{/* Logo */}
<Link href="/" className="flex items-center gap-2 hover:opacity-90 transition-opacity">
<div className="w-8 h-8 rounded-lg bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0">
<Leaf className="h-4 w-4" />
</div>
<span className={cn("font-serif text-xl font-bold transition-colors", scrolled ? "text-foreground" : "text-white")}>Bona Vista</span>
</Link>
{/* Desktop nav */}
<nav className="hidden md:flex items-center gap-6">
<Link href="/" className={cn("transition-colors text-sm font-medium", scrolled ? "text-foreground/80 hover:text-primary" : "text-white/90 hover:text-white")}>Home</Link>
<a href="#menu" className={cn("transition-colors text-sm font-medium", scrolled ? "text-foreground/80 hover:text-primary" : "text-white/90 hover:text-white")}>Menu</a>
<a href="#about" className={cn("transition-colors text-sm font-medium", scrolled ? "text-foreground/80 hover:text-primary" : "text-white/90 hover:text-white")}>About</a>
<a href="#gallery" className={cn("transition-colors text-sm font-medium", scrolled ? "text-foreground/80 hover:text-primary" : "text-white/90 hover:text-white")}>Gallery</a>
<a href="#team" className={cn("transition-colors text-sm font-medium", scrolled ? "text-foreground/80 hover:text-primary" : "text-white/90 hover:text-white")}>Team Profiles</a>
<a href="#contact" className={cn("transition-colors text-sm font-medium", scrolled ? "text-foreground/80 hover:text-primary" : "text-white/90 hover:text-white")}>Contact Form</a>
</nav>
{/* Mobile toggle */}
<button
className={cn("md:hidden p-2 rounded-md 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-6 w-6" /> : <Menu className="h-6 w-6" />}
</button>
</div>
{/* Mobile nav */}
{isOpen && (
<div className="md:hidden border-t border-border/40 bg-background/95 backdrop-blur py-4 space-y-1 px-2">
<Link href="/" className="block px-3 py-2 rounded-lg text-foreground hover:bg-muted transition-colors" onClick={() => setIsOpen(false)}>Home</Link>
<a href="#menu" className="block px-3 py-2 rounded-lg text-foreground hover:bg-muted transition-colors" onClick={() => setIsOpen(false)}>Menu</a>
<a href="#about" className="block px-3 py-2 rounded-lg text-foreground hover:bg-muted transition-colors" onClick={() => setIsOpen(false)}>About</a>
<a href="#gallery" className="block px-3 py-2 rounded-lg text-foreground hover:bg-muted transition-colors" onClick={() => setIsOpen(false)}>Gallery</a>
<a href="#team" className="block px-3 py-2 rounded-lg text-foreground hover:bg-muted transition-colors" onClick={() => setIsOpen(false)}>Team Profiles</a>
<a href="#contact" className="block px-3 py-2 rounded-lg text-foreground hover:bg-muted transition-colors" onClick={() => setIsOpen(false)}>Contact Form</a>
</div>
)}
</div>
</header>
);
}