"use client"; import { useEffect, useRef, useCallback } from "react"; import Link from "next/link"; import gsap from "gsap"; const GRID_COLS = 20; const GRID_ROWS = 12; function TileGrid() { const gridRef = useRef(null); const tilesRef = useRef<(HTMLDivElement | null)[]>([]); const handleMouseEnter = useCallback((index: number) => { const tile = tilesRef.current[index]; if (tile) { gsap.killTweensOf(tile); gsap.to(tile, { rotateY: 180, duration: 0.5, ease: "power2.inOut", overwrite: true, }); } }, []); const handleMouseLeave = useCallback((index: number) => { const tile = tilesRef.current[index]; if (tile) { gsap.killTweensOf(tile); gsap.to(tile, { rotateY: 0, duration: 0.5, ease: "power2.inOut", overwrite: true, }); } }, []); return (
{Array.from({ length: GRID_COLS * GRID_ROWS }).map((_, index) => (
handleMouseEnter(index)} onMouseLeave={() => handleMouseLeave(index)} className="cursor-pointer" style={{ perspective: "500px" }} >
{ tilesRef.current[index] = el; }} className="w-full h-full relative" style={{ transformStyle: "preserve-3d", willChange: "transform", }} > {/* Front - Black */}
{/* Back - White */}
))}
); } export default function Hero() { const headingRef = useRef(null); const contentRef = useRef(null); useEffect(() => { // Animate heading on mount if (headingRef.current) { gsap.fromTo( headingRef.current, { opacity: 0, y: 50 }, { opacity: 1, y: 0, duration: 1, ease: "power3.out", delay: 0.3 } ); } if (contentRef.current) { gsap.fromTo( contentRef.current.children, { opacity: 0, y: 30 }, { opacity: 1, y: 0, duration: 0.8, stagger: 0.15, ease: "power3.out", delay: 0.5 } ); } }, []); return (
{/* Tile Grid Background */}
{/* Center Content */}
FEBRUARY 2026

UNLEASH YOUR ART

From canvas to screen, showcase your creativity and let your artwork speak to the world.

JOIN COMPETITION EXPLORE GALLERY
{/* Scroll Indicator */}
Scroll
{/* Bottom Marquee */}
{Array(8) .fill(null) .map((_, i) => (
ArtSplash SJEC 2026
))}
); }