"use client"; import { AnimatePresence, motion, useInView, useScroll, useTransform, } from "framer-motion"; import { Plus } from "lucide-react"; import React from "react"; import { useRef, useState } from "react"; import { cn } from "@/lib/utils"; const projects = [ { id: 1, title: "بهینه‌سازی گردش کار طراحی", category: "رابط و تجربه کاربری", date: "۲۰ خرداد ۱۴۰۴", image: "/block-media/shadcnblocks/block/photos/studio-republic-fotKKqWNMQ4-unsplash.jpg", }, { id: 2, title: "دسترسی یکپارچه جهانی", category: "فناوری ابری", date: "۱۸ خرداد ۱۴۰۴", image: "/block-media/shadcnblocks/block/photos/israel-andrade-YI_9SivVt_s-unsplash.jpg", }, ]; const ProjectItem = ({ project, index, containerRef, hoveredIndex, setHoveredIndex, mousePos, setMousePos, }: { project: { id: number; title: string; category: string; date: string; image: string; }; index: number; containerRef: React.RefObject; hoveredIndex: number | null; setHoveredIndex: (index: number | null) => void; mousePos: { x: number; y: number }; setMousePos: (pos: { x: number; y: number }) => void; }) => { const { scrollYProgress } = useScroll({ target: containerRef, offset: ["start end", "end start"], }); const scrollScale = useTransform( scrollYProgress, [0, 0.5, 1], [0.95, 1, 1.05], ); const scrollY = useTransform(scrollYProgress, [0, 1], [50, -50]); const scrollOpacity = useTransform( scrollYProgress, [0, 0.2, 0.8, 1], [0.7, 1, 1, 0.7], ); const handleMouseMove = (e: React.MouseEvent) => { const rect = (e.currentTarget as HTMLElement).getBoundingClientRect(); setMousePos({ x: e.clientX - rect.left, y: e.clientY - rect.top, }); setHoveredIndex(index); }; const handleMouseLeave = () => { setHoveredIndex(null); }; return (

{project.date}

|

{project.category}

{project.title}
{hoveredIndex === index && ( )}
); }; interface Projects3Props { className?: string; } const Projects3 = ({ className }: Projects3Props) => { const [hoveredIndex, setHoveredIndex] = useState(null); const [mousePos, setMousePos] = useState({ x: 0, y: 0 }); const containerRef = useRef(null); const isInView = useInView(containerRef, { once: true, margin: "-100px" }); return (

پروژه‌های ما

{projects.map((project, index) => ( ))}
); }; export { Projects3 };