// ── NAVIGATION ────────────────────────────────────────────────── function Nav({ activeSection, mode = 'home' }) { const [scrolled, setScrolled] = useState(false); const [menuOpen, setMenuOpen] = useState(false); const [scrollDir, setScrollDir] = useState('up'); const [isMobile, setIsMobile] = useState(false); useEffect(() => { const handleResize = () => setIsMobile(window.innerWidth <= 768); handleResize(); // Init window.addEventListener('resize', handleResize); return () => window.removeEventListener('resize', handleResize); }, []); useEffect(() => { let lastScrollY = window.scrollY; const onScroll = () => { const currentScrollY = window.scrollY; setScrolled(currentScrollY > 60); if (currentScrollY > lastScrollY && currentScrollY > 80) { setScrollDir('down'); } else if (currentScrollY < lastScrollY) { setScrollDir('up'); } lastScrollY = currentScrollY; }; window.addEventListener('scroll', onScroll, { passive: true }); onScroll(); return () => window.removeEventListener('scroll', onScroll); }, []); const links = [ { id: 'koleksiyonlar', label: 'Koleksiyonlar' }, { id: 'hakkimizda', label: 'Hakkımızda' }, { id: 'iletisim', label: 'İletişim' }, ]; const hrefFor = (id) => mode === 'home' ? `#${id}` : `/#${id}`; const ctaHref = mode === 'home' ? '#iletisim' : '/#iletisim'; const logoClick = () => { if (mode === 'home') window.scrollTo({top:0, behavior:'smooth'}); else window.location.href = '/'; }; const forceSolid = mode === 'product' || menuOpen; const isSolid = scrolled || forceSolid; const navStyle = { position: 'fixed', top: 0, left: 0, right: 0, zIndex: 1000, width: '100%', padding: isSolid ? '12px clamp(20px, 5vw, 60px)' : '20px clamp(20px, 5vw, 60px)', display: 'flex', alignItems: 'center', justifyContent: 'space-between', background: isSolid ? 'rgba(26,25,24,0.97)' : 'transparent', borderBottom: isSolid ? '1px solid rgba(201,168,76,0.15)' : '1px solid transparent', transition: 'transform 0.4s ease, background 0.5s ease, padding 0.5s ease', transform: (scrollDir === 'down' && !menuOpen && scrolled && !isMobile) ? 'translateY(-100%)' : 'translateY(0)', backdropFilter: isSolid ? 'blur(12px)' : 'none', }; return ( {/* Logo */} {/* Desktop links */} {links.map(l => ( e.target.style.color = 'var(--gold-light)'} onMouseLeave={e => e.target.style.color = activeSection === l.id ? 'var(--gold)' : 'rgba(242,235,224,0.6)'} >{l.label} ))} e.target.style.background = 'var(--gold-light)'} onMouseLeave={e => e.target.style.background = 'var(--gold)'} >Teklif Alın {/* Mobile hamburger */} setMenuOpen(!menuOpen)} style={{ background:'none', border:'none', cursor:'pointer', alignItems:'center', justifyContent:'center', position:'relative', flexDirection:'column', gap:6, padding:10, zIndex:1001, width: 46, height: 46, }} aria-label="Menu"> {/* Mobile menu */} {menuOpen && ( setMenuOpen(false)}> {links.map(l => ( {l.label} ))} Teklif Alın )} ); } // ── FOOTER ────────────────────────────────────────────────────── function Footer() { return ( ); } Object.assign(window, { Nav, Footer });