"use client"; import { motion, useScroll, useTransform, AnimatePresence } from "framer-motion"; import { useRef, useState, useEffect } from "react"; import Link from "next/link"; import Header from "@/components/Header"; import Footer from "@/components/Footer"; import type { Locale } from "@/i18n-config"; const expo: [number, number, number, number] = [0.16, 1, 0.3, 1]; const IconArrowLeft = () => ( ); const IconArrowRight = () => ( ); const IconCheck = () => ( ); // Tag colors per category const accentFor = (tag: string): string => { if (/ai|yz|ml/i.test(tag)) return "#FFE600"; if (/web3|blockchain|chain/i.test(tag)) return "#FF4500"; if (/mobile|mobil/i.test(tag)) return "#0A0A0A"; return "#00CC77"; }; interface Props { lang: Locale; dict: any; project: any; prev: any | null; next: any | null; } const screenshotsFor = (slug: string): string[] => { const mapping: Record = { "financeai-dashboard": [ "https://images.unsplash.com/photo-1551288049-bebda4e38f71?auto=format&fit=crop&w=1200&q=80", "https://images.unsplash.com/photo-1460925895917-afdab827c52f?auto=format&fit=crop&w=1200&q=80", "https://images.unsplash.com/photo-1551836022-d5d88e9218df?auto=format&fit=crop&w=1200&q=80", ], "chainsupply-network": [ "https://images.unsplash.com/photo-1508873535684-277a3cbcc4e8?auto=format&fit=crop&w=1200&q=80", "https://images.unsplash.com/photo-1639762681485-074b7f938ba0?auto=format&fit=crop&w=1200&q=80", "https://images.unsplash.com/photo-1504384308090-c894fdcc538d?auto=format&fit=crop&w=1200&q=80", ], "meditrack-mobile": [ "https://images.unsplash.com/photo-1576091160399-112ba8d25d1d?auto=format&fit=crop&w=1200&q=80", "https://images.unsplash.com/photo-1584982751601-97dcc096659c?auto=format&fit=crop&w=1200&q=80", "https://images.unsplash.com/photo-1530026405186-ed1ea0ac7a63?auto=format&fit=crop&w=1200&q=80", ], "novamart-platform": [ "https://images.unsplash.com/photo-1460925895917-afdab827c52f?auto=format&fit=crop&w=1200&q=80", "https://images.unsplash.com/photo-1556742049-0cfed4f6a45d?auto=format&fit=crop&w=1200&q=80", "https://images.unsplash.com/photo-1523474253046-8cd2748b5fd2?auto=format&fit=crop&w=1200&q=80", ], }; return mapping[slug] || []; }; export default function WorkDetailClient({ lang, dict, project, prev, next }: Props) { const heroRef = useRef(null); const { scrollYProgress } = useScroll({ target: heroRef, offset: ["start start", "end start"] }); const heroY = useTransform(scrollYProgress, [0, 1], ["0%", "30%"]); const [activeImage, setActiveImage] = useState(null); useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { if (e.key === "Escape") setActiveImage(null); }; window.addEventListener("keydown", handleKeyDown); return () => window.removeEventListener("keydown", handleKeyDown); }, []); const accent = accentFor(project.tag); let screenshots = screenshotsFor(project.slug); if (project.gallery && project.gallery.length > 0) { screenshots = project.gallery; } return (
{/* ── HERO ── */}
{/* Dot grid */} {project.image ? ( <>
) : (
)} {/* Accent left vertical bar */}
{/* Big number watermark */} {project.num}
{/* Breadcrumb */} {dict.nav.work} / {project.num} {/* Tag badge */} {project.tag} {/* Title */}
{project.title}
{/* Meta row */} {[ { label: lang === "tr" ? "Yıl" : "Year", value: project.year }, { label: lang === "tr" ? "Süre" : "Duration", value: project.duration }, { label: lang === "tr" ? "Sektör" : "Sector", value: project.tag }, { label: lang === "tr" ? "Müşteri" : "Client", value: project.client }, ].map((m, i) => (
{m.label}
{m.value}
))} {project.website && (
{lang === "tr" ? "Canlı Proje" : "Live Project"}
{lang === "tr" ? "SİTEYE GİT" : "VISIT SITE"}
)}
{/* ── CONTENT ── */}
{/* Left column: main content */}
{/* Overview */}
{lang === "tr" ? "Genel Bakış" : "Overview"}

{project.desc}

{/* Challenge */}
{lang === "tr" ? "Problem" : "The Challenge"}

{lang === "tr" ? "Ne Sorununu Çözdük?" : "What Problem Did We Solve?"}

{project.challenge}

{/* Solution */}
{lang === "tr" ? "Çözüm" : "Our Solution"}

{lang === "tr" ? "Nasıl İnşa Ettik?" : "How Did We Build It?"}

{project.solution}

{/* Results */}
{lang === "tr" ? "Sonuçlar" : "Results"}
{project.results.map((r: string, idx: number) => (

{r}

))}
{/* Right column: sidebar */}
{/* ── PROJECT SCREENSHOTS GALLERY ── */} {screenshots.length > 0 && (
{dict.work.galleryTitle || "EKRAN GÖRÜNTÜLERİ"}
{screenshots.map((src, idx) => ( setActiveImage(src)} whileHover={{ y: -6, boxShadow: `4px 4px 0px 0px ${accent}` }} >
{`${project.title}
SCREEN // 0{idx + 1} [ ZOOM ]
))}
)} {/* Lightbox Modal */} {activeImage && ( setActiveImage(null)} > e.stopPropagation()} > Enlarged project screenshot )} {/* ── PREV / NEXT NAVIGATION ── */}
{/* Prev */}
{prev ? (
{lang === "tr" ? "Önceki Proje" : "Previous Project"}
{prev.title}
{prev.tag}
) : (
)}
{/* Next */}
{next ? (
{lang === "tr" ? "Sonraki Proje" : "Next Project"}
{next.title}
{next.tag}
) : (
{lang === "tr" ? "Tüm Projeler" : "All Projects"}
{lang === "tr" ? "Portfolyo" : "Portfolio"}
)}
); }