'use client' import React from "react"; import { motion } from "framer-motion"; import Image from "next/image"; import { useState, useEffect } from "react"; import { Inter } from 'next/font/google'; const inter = Inter({ subsets: ['latin'] }); type CardProps = { title: string; description: string; image: string; isHovered: boolean; }; const Card: React.FC = ({ title, description, image, isHovered }) => ( {title}

{title}

{description}

); type CardStackProps = { cards: Array<{ title: string; description: string; image: string; }>; offset?: number; }; const GlowCard: React.FC = ({ cards, offset = 40 }) => { const [hoveredIndex, setHoveredIndex] = useState(null); const [isClient, setIsClient] = useState(false); useEffect(() => { setIsClient(true); }, []); return (
{cards.map((card, index) => { const yOffset = index * offset; const xOffset = index * offset; const isHovered = hoveredIndex === index; return ( = 768 ? { x: xOffset, y: 0 } : {}), }} transition={{ type: "spring", stiffness: 300, damping: 20 }} style={{ zIndex: isHovered ? 100 : cards.length - index, }} onMouseEnter={() => setHoveredIndex(index)} onMouseLeave={() => setHoveredIndex(null)} > ); })}
); }; export default GlowCard; Package