'use client'; import React, { useState, useEffect, useRef } from 'react'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { Menu, X, Smartphone, Layers, ArrowUpRight } from 'lucide-react'; import { SiteConfig, resolveLocalised } from '@/types'; import { BrandLogo } from './BrandLogo'; interface NavbarProps { config: SiteConfig; currentLocale: string; } export function Navbar({ config, currentLocale }: NavbarProps) { const [isScrolled, setIsScrolled] = useState(false); const [mobileMenuOpen, setMobileMenuOpen] = useState(false); const pathname = usePathname(); const navRef = useRef(null); const glintRef = useRef(null); useEffect(() => { const handleScroll = () => { setIsScrolled(window.scrollY > 20); }; window.addEventListener('scroll', handleScroll, { passive: true }); return () => window.removeEventListener('scroll', handleScroll); }, []); useEffect(() => { if (!mobileMenuOpen) return; const closeOnEscape = (event: KeyboardEvent) => { if (event.key === 'Escape') setMobileMenuOpen(false); }; document.addEventListener('keydown', closeOnEscape); return () => document.removeEventListener('keydown', closeOnEscape); }, [mobileMenuOpen]); const handleMouseMove = (e: React.MouseEvent) => { if (!glintRef.current) return; const rect = e.currentTarget.getBoundingClientRect(); const x = ((e.clientX - rect.left) / rect.width) * 100; const y = ((e.clientY - rect.top) / rect.height) * 100; glintRef.current.style.opacity = '0.6'; glintRef.current.style.background = `radial-gradient(ellipse 260px 80px at ${x.toFixed(1)}% ${y.toFixed(1)}%, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.08) 40%, transparent 70%)`; }; const handleMouseLeave = () => { if (glintRef.current) { glintRef.current.style.opacity = '0'; } }; return (
{/* Optical Glass Caustic Reflection Sheen */}
); }