'use client' import { useState, useEffect } from 'react' import { useTranslations } from 'next-intl' import Link from 'next/link' import Image from 'next/image' import { Menu, X, Phone } from 'lucide-react' import { cn } from '@/lib/utils' import { SITE } from '@/lib/constants' interface NavigationProps { locale: string } export default function Navigation({ locale }: NavigationProps) { const t = useTranslations('nav') const [menuOpen, setMenuOpen] = useState(false) const [scrolled, setScrolled] = useState(false) const [visible, setVisible] = useState(false) useEffect(() => { const handleScroll = () => { // Hero section 500vh — navbar scroll bittikten sonra görünür const heroEnd = window.innerHeight * 4.5 setVisible(window.scrollY > heroEnd) setScrolled(window.scrollY > heroEnd + 80) } window.addEventListener('scroll', handleScroll, { passive: true }) return () => window.removeEventListener('scroll', handleScroll) }, []) const otherLocale = locale === 'tr' ? 'en' : 'tr' const links = [ { key: 'about', href: '#proje' }, { key: 'location', href: '#lokasyon' }, { key: 'units', href: '#daireler' }, { key: 'gallery', href: '#galeri' }, { key: 'contact', href: '#iletisim' }, ] return (
{/* Logo */} {SITE.name} {/* Desktop nav */} {/* Right side */}
{/* Dil seçici */} {otherLocale} {/* Telefon */} {t('phone')}
{/* Mobile hamburger */}
{/* Mobile menu */} {menuOpen && (
{links.map((link) => ( setMenuOpen(false)} className="text-white/80 hover:text-white text-base py-2 border-b border-white/10 transition-colors" > {t(link.key as keyof ReturnType)} ))}
{t('phone')} setMenuOpen(false)} > {otherLocale}
)}
) }