"use client"; import { motion, AnimatePresence, useScroll, useTransform, useMotionValue, useSpring, } from "framer-motion"; import { useRef, useState, useEffect, useCallback } from "react"; import Header from "@/components/Header"; import type { Locale } from "@/i18n-config"; import dynamic from "next/dynamic"; const HomeClientBelowFold = dynamic(() => import('./HomeClientBelowFold')); // ── EASING ── const expo: [number, number, number, number] = [0.16, 1, 0.3, 1]; // ── SVG ICONS ── const IconAI = () => ( ); const IconChain = () => ( ); const IconMobile = () => ( ); const IconWeb = () => ( ); const IconArrow = () => ( ); const IconArrowUpRight = () => ( ); const IconPlus = () => ( ); const IconCheck = () => ( ); // ── ANIMATED COUNTER ── function Counter({ target, suffix = "" }: { target: number; suffix?: string }) { const [count, setCount] = useState(0); const ref = useRef(null); const [started, setStarted] = useState(false); useEffect(() => { const observer = new IntersectionObserver( ([entry]) => { if (entry.isIntersecting) setStarted(true); }, { threshold: 0.5 } ); if (ref.current) observer.observe(ref.current); return () => observer.disconnect(); }, []); useEffect(() => { if (!started) return; let cur = 0; const steps = 50; const inc = target / steps; const iv = setInterval(() => { cur += inc; if (cur >= target) { setCount(target); clearInterval(iv); } else setCount(Math.floor(cur)); }, 1600 / steps); return () => clearInterval(iv); }, [started, target]); return {count.toLocaleString()}{suffix}; } // ── MAGNETIC BUTTON ── function MagneticBtn({ children, className, href }: { children: React.ReactNode; className?: string; href?: string }) { const ref = useRef(null); const x = useMotionValue(0); const y = useMotionValue(0); const sx = useSpring(x, { stiffness: 200, damping: 20 }); const sy = useSpring(y, { stiffness: 200, damping: 20 }); const handleMouse = useCallback((e: React.MouseEvent) => { if (!ref.current) return; const { left, top, width, height } = ref.current.getBoundingClientRect(); x.set((e.clientX - left - width / 2) * 0.3); y.set((e.clientY - top - height / 2) * 0.3); }, [x, y]); const handleLeave = useCallback(() => { x.set(0); y.set(0); }, [x, y]); const Tag = href ? "a" : "div"; return ( {children} ); } // ── MARQUEE TEXT ── function Marquee({ text, reverse = false }: { text: string; reverse?: boolean }) { const repeated = Array(8).fill(text).join(" · "); return (
{[0, 1].map(i => ( {repeated} ))}
); } // ── SPLIT TEXT ANIMATION ── function SplitReveal({ text, className, delay = 0 }: { text: string; className?: string; delay?: number }) { const words = text.split(" "); return ( {words.map((word, i) => ( {word} ))} ); } // ── SECTION LABEL ── function Label({ children }: { children: React.ReactNode }) { return (
{children}
); } // ── MAIN COMPONENT ── export default function HomeClient({ lang, dict }: { lang: Locale; dict: any }) { const heroRef = useRef(null); const { scrollYProgress } = useScroll({ target: heroRef, offset: ["start start", "end start"] }); const heroY = useTransform(scrollYProgress, [0, 1], ["0%", "25%"]); const heroOpacity = useTransform(scrollYProgress, [0, 0.7], [1, 0]); return (
{/* Noise overlay */}
{/* ──────────────── HERO ──────────────── */}
{/* Dot grid bg */} {/* Big watermark letters */} AT {/* Yellow right accent */}
{/* Meta bar */}
{dict.hero.badge}
EST. 2025 — MUĞLA
{/* Headline */}

{dict.hero.titleLine1} {dict.hero.titleLine2}

{/* Bottom bar */}

{dict.hero.desc}

{dict.hero.ctaQuote} {dict.hero.ctaWork}
); }