"use client"; import { motion, AnimatePresence, useSpring, useMotionValue } from "framer-motion"; import { useState, useRef, useEffect, useCallback } from "react"; import type { Locale } from "@/i18n-config"; import Link from "next/link"; import { blogPosts } from "@/data/blog"; import Footer from "@/components/Footer"; // ── 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}; } // ── 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} ); } export default function HomeClientBelowFold({ lang, dict }: { lang: Locale; dict: any }) { const [activeFaq, setActiveFaq] = useState(null); const [formSent, setFormSent] = useState(false); const [hoverCase, setHoverCase] = useState(null); const serviceIcons = [, , , ]; const serviceCodes = ["AI / ML", "BC / WEB3", "MOB / DART", "WEB / NEXT"]; const services = dict.services.items ? Object.entries(dict.services.items as Record).map(([, val], idx) => ({ icon: serviceIcons[idx], code: serviceCodes[idx], title: val.title, desc: val.desc, items: [ ["Predictive Models", "NLP Pipelines", "Computer Vision", "Agentic Workflows"], ["Smart Contract Audit", "DeFi Architecture", "Tokenomics Design", "Cross-chain Bridges"], ["Universal Codebase", "Offline Syncing", "Biometric Protocols", "Core Bundle Optimization"], ["Next.js App Router", "Server Components", "Headless Commerce", "Modular API Mesh"], ][idx], })) : []; const caseStudies = (dict.work.items as any[]).map((item: any, idx: number) => ({ ...item, tech: [ ["Python", "TensorFlow", "Next.js", "PostgreSQL"], ["Solidity", "React", "IPFS", "Node.js"], ["Flutter", "Firebase", "Django", "AWS"], ["Next.js", "Stripe", "Redis", "Vercel"], ][idx] || ["React", "TypeScript", "Node.js"], accent: ["#FFE600", "#FF4500", "#0A0A0A", "#00CC77"][idx] || "#FFE600", })); const processes = dict.process.items as any[]; const featuredPosts = blogPosts; const faqs = dict.faq.items as any[]; return ( <> {/* ──────────────── MARQUEE 1 ──────────────── */} {/* ──────────────── STATS ──────────────── */} {[ { val: 48, suffix: "+", label: dict.stats.deliveries }, { val: 98, suffix: "%", label: dict.stats.retention }, { val: 12, suffix: "+", label: dict.stats.regions }, { val: 1, suffix: "wk", label: lang === "tr" ? "MVP Süresi" : "Avg Cycle To MVP" }, ].map((s, idx) => ( {s.label} ))} {/* ──────────────── SERVICES ──────────────── */} {dict.services.badge} {dict.services.desc} {services.map((s, idx) => ( {/* Hover accent left bar */} {s.icon} {s.code} {s.title} {s.desc} {s.items?.map((item: string) => ( {item} ))} {/* Number watermark */} {String(idx + 1).padStart(2, "0")} ))} {/* ──────────────── MARQUEE 2 ──────────────── */} {/* ──────────────── CASE STUDIES ──────────────── */} {dict.work.badge} {caseStudies.map((study: any, idx: number) => ( setHoverCase(idx)} onHoverEnd={() => setHoverCase(null)} initial={{ opacity: 0, y: 20 }} whileInView={{ opacity: 1, y: 0 }} viewport={{ once: true }} transition={{ delay: idx * 0.08 }} > {/* Index */} {study.num} {/* Title */} ↗ {study.title} {/* Tag */} {study.tag} {/* Description */} {study.desc} {/* Arrow */} {/* Expanded tech stack */} {hoverCase === idx && ( STACK: {study.tech.map((t: string) => ( {t} ))} )} ))} {dict.work.analyzeBtn} {/* ──────────────── PROCESS ──────────────── */} {dict.process.badge} {processes.map((p: any, idx: number) => ( {p.num} {p.timeframe} {p.title} {p.desc} ))} {/* ──────────────── BLOG FEATURED ──────────────── */} {dict.blog.badge} {dict.blog.viewAll} → {featuredPosts.map((post, idx) => { const content = post[lang] || post.en; const accent = ["#FFE600", "#FF4500", "#00CC77"][idx] || "#FFE600"; return ( {content.category} {post.date} {content.title} {content.excerpt} {post.author} {post.authorRole} {/* Top line category accent */} ); })} {/* ──────────────── FAQ ──────────────── */} {dict.faq.badge} {faqs.map((faq: any, idx: number) => ( setActiveFaq(activeFaq === idx ? null : idx)} > {faq.q} {activeFaq === idx && ( {faq.a} )} ))} {/* ──────────────── CONTACT ──────────────── */} {dict.contact.badge} {dict.contact.desc} {/* Form */} {!formSent ? ( { e.preventDefault(); setFormSent(true); }} exit={{ opacity: 0, y: -10 }} transition={{ duration: 0.3 }} > {[ { label: dict.contact.formName, placeholder: dict.contact.formNamePlaceholder, type: "text" }, { label: dict.contact.formEmail, placeholder: dict.contact.formEmailPlaceholder, type: "email" }, { label: dict.contact.formCompany, placeholder: dict.contact.formCompanyPlaceholder, type: "text" }, { label: dict.contact.formTrack, type: "select", options: ["$5k – $20k", "$20k – $50k", "$50k – $100k", "$100k+"] }, ].map((field, fi) => ( {field.label} {field.type === "select" ? ( {field.options?.map(opt => {opt})} ) : ( )} ))} {dict.contact.formScope} {dict.contact.formSubmit} ) : ( {dict.contact.submittedTitle} {dict.contact.submittedText} setFormSent(false)} className="btn-brutal px-6 py-3 font-display font-black text-[11px] tracking-widest uppercase cursor-pointer" > {lang === "tr" ? "Yeni Talep" : "New Request"} )} {/* Sidebar info */} {dict.contact.infoDirect} hello@ayristech.com {dict.contact.infoBlueprint} +90 532 000 00 00 {lang === "tr" ? "Genel Merkez" : "HQ Coordinates"} {dict.contact.infoBaseText} {/* Yellow CTA block */} {lang === "tr" ? "Teknik ekibimiz 12 saat içinde geri döner." : "Our team responds within 12 operational hours."} > ); }
{dict.services.desc}
{s.desc}
{study.desc}
{p.desc}
{content.excerpt}
{faq.a}
{dict.contact.desc}
{dict.contact.submittedText}
{lang === "tr" ? "Teknik ekibimiz 12 saat içinde geri döner." : "Our team responds within 12 operational hours."}