"use client"; import { useRef, useState } from "react"; import Link from "next/link"; import { AnimatePresence, motion, useMotionValue, useSpring } from "framer-motion"; import { ArrowRight } from "@/components/ui/icons"; /** * "Our Capabilities" — hover-reveal list. Six big capability rows; on * desktop a floating image preview follows the cursor and crossfades per * row. Mobile gets clean tappable rows. Brand-strict. */ const CAPABILITIES = [ { name: "Web Development", desc: "Fast, scalable web apps & platforms", href: "/services/web-development", image: "/images/opt/HeroBanner1.webp", }, { name: "Mobile App Development", desc: "Native & cross-platform experiences", href: "/services/mobile-app-development", image: "/images/opt/HeroBanner2.webp", }, { name: "Game Development", desc: "2D, 3D, multiplayer & live ops", href: "/services/game-development", image: "/images/opt/Pillar1.webp", }, { name: "AI Solutions", desc: "GenAI, agents & machine learning", href: "/services/ai-development", image: "/images/opt/HeroBanner3.png", }, { name: "Data Analytics", desc: "Pipelines, dashboards & insight", href: "/services", image: "/images/opt/Pillar2.webp", }, { name: "Cloud & DevOps", desc: "Infrastructure, CI/CD & reliability", href: "/services/cloud-solutions", image: "/images/opt/HeroBanner2.webp", }, ]; const container = { hidden: {}, show: { transition: { staggerChildren: 0.1 } } }; const word = { hidden: { yPercent: 120 }, show: { yPercent: 0, transition: { duration: 0.7, ease: [0.21, 0.47, 0.32, 0.98] } }, }; const rise = { hidden: { opacity: 0, y: 36 }, show: { opacity: 1, y: 0, transition: { duration: 0.6, ease: [0.21, 0.47, 0.32, 0.98] } }, }; export default function Capabilities() { const listRef = useRef(null); const [active, setActive] = useState(null); // Cursor-following preview (springy). const mx = useMotionValue(0); const my = useMotionValue(0); const x = useSpring(mx, { stiffness: 220, damping: 28 }); const y = useSpring(my, { stiffness: 220, damping: 28 }); const onMove = (e) => { const r = listRef.current?.getBoundingClientRect(); if (!r) return; mx.set(e.clientX - r.left); my.set(e.clientY - r.top); }; return (
{/* Header */} Our capabilities

What we build, {" "} end to end.

{/* Hover-reveal list */} setActive(null)} className="relative mt-14" > {/* floating preview (desktop) */} {active !== null && (
)}
{CAPABILITIES.map(({ name, desc, href }, i) => ( setActive(i)} className="group relative flex items-center gap-5 border-t border-border py-6 transition-colors last:border-b sm:gap-8 sm:py-7" > {/* left accent grows on hover */} {String(i + 1).padStart(2, "0")} {name} {desc} ))}
); }