import React, { useEffect, useRef, useState } from "react"; import ContentCarousel from "../components/ContentCarousel"; import Header from "../components/Header"; import ChatWindow from "../components/ChatWindow"; import TeamSection from "../components/TeamSection"; import SplineViewer from "../components/SplineViewer"; import { useCategories } from "@/hooks/useUrdfData"; import { Skeleton } from "@/components/ui/skeleton"; const IndexCopy: React.FC = () => { // const parallaxRef = useRef(null); const sectionRefs = useRef<(HTMLElement | null)[]>([]); const ticking = useRef(false); const [scrollY, setScrollY] = useState(0); const { data: categories, isLoading } = useCategories(); // Add parallax effect on scroll using requestAnimationFrame for better performance useEffect(() => { const handleScroll = () => { if (!ticking.current) { window.requestAnimationFrame(() => { setScrollY(window.scrollY); ticking.current = false; }); ticking.current = true; } }; // Initialize section references const categoryElements = document.querySelectorAll(".category-section"); sectionRefs.current = Array.from(categoryElements); window.addEventListener("scroll", handleScroll); return () => window.removeEventListener("scroll", handleScroll); }, []); // Only get the trending category const trendingCategory = categories?.find( (category) => category.id === "trending" ); return (
{/* Cosmic background wrapper for the entire page */}
{/* Cosmic background with stars */}
{/* Subtle animated gradient overlay */}
{/* Random stars */}
{/* Cosmic hero section with parallax text */}
{/* Parallax text container */}

PROMPT SPATIAL AGENTS

{/* Spline 3D Asset with increased height and no overflow cutting */}
{/* Chat Window Section - Moved right below the title */}
{/* Content sections with glass panels */}
{/* Team Section */} {/* Only display trending category */} {isLoading ? (
) : trendingCategory ? (

{trendingCategory.name}

) : null}
); }; export default IndexCopy;