import { useState, useCallback, useEffect, useMemo } from "react"; import { motion } from "framer-motion"; import { useNavigate, Link } from "react-router-dom"; import IsometricRealmCard, { RealmData } from "./IsometricRealmCard"; const REALM_COLORS = ["#a855f7", "#22c55e", "#ef4444", "#eab308", "#3b82f6"]; interface ParticleData { id: number; left: number; top: number; size: number; color: string; duration: number; delay: number; xOffset: number; } function generateParticles(count: number): ParticleData[] { return Array.from({ length: count }, (_, i) => ({ id: i, left: 10 + Math.random() * 80, top: 10 + Math.random() * 80, size: 2 + Math.random() * 4, color: REALM_COLORS[Math.floor(Math.random() * REALM_COLORS.length)], duration: 4 + Math.random() * 4, delay: Math.random() * 4, xOffset: Math.sin(i) * 20, })); } const realms: RealmData[] = [ { id: "nexus", label: "NEXUS", color: "#a855f7", route: "/dashboard/nexus", icon: "🌐", description: "The marketplace hub. Find opportunities, contracts, and commissions.", features: ["Browse opportunities", "Submit proposals", "Track contracts"], }, { id: "gameforge", label: "GAMEFORGE", color: "#22c55e", route: "/gameforge", icon: "🎮", description: "Game development powerhouse. Build immersive experiences together.", features: ["Sprint management", "Team collaboration", "Asset pipeline"], }, { id: "foundation", label: "FOUNDATION", color: "#ef4444", route: "/foundation", icon: "🏛️", description: "Learn and grow. Courses, mentorship, and achievement tracking.", features: ["Structured courses", "1-on-1 mentorship", "Skill badges"], }, { id: "labs", label: "LABS", color: "#eab308", route: "/dashboard/labs", icon: "🔬", description: "Research & experimentation. Push the boundaries of what's possible.", features: ["Experimental features", "R&D projects", "Tech deep-dives"], }, { id: "corp", label: "CORP", color: "#3b82f6", route: "/corp", icon: "🏢", description: "Enterprise solutions. Managed services for teams and organizations.", features: ["Dedicated support", "Custom integrations", "SLA guarantees"], }, ]; export default function IsometricRealmSelector() { const navigate = useNavigate(); const [selectedRealm, setSelectedRealm] = useState(null); const [mousePosition, setMousePosition] = useState({ x: 0.5, y: 0.5 }); const particles = useMemo(() => generateParticles(20), []); useEffect(() => { let rafId: number; let lastUpdate = 0; const throttleMs = 50; const handleMouseMove = (e: MouseEvent) => { const now = Date.now(); if (now - lastUpdate < throttleMs) return; lastUpdate = now; rafId = requestAnimationFrame(() => { setMousePosition({ x: e.clientX / window.innerWidth, y: e.clientY / window.innerHeight, }); }); }; window.addEventListener("mousemove", handleMouseMove); return () => { window.removeEventListener("mousemove", handleMouseMove); if (rafId) cancelAnimationFrame(rafId); }; }, []); const handleRealmClick = useCallback( (realm: RealmData) => { setSelectedRealm(realm.id); setTimeout(() => navigate(realm.route), 400); }, [navigate] ); const backgroundGradient = ` radial-gradient( ellipse 80% 50% at ${mousePosition.x * 100}% ${mousePosition.y * 100}%, rgba(59, 130, 246, 0.08) 0%, transparent 50% ), radial-gradient( ellipse 60% 40% at ${100 - mousePosition.x * 100}% ${100 - mousePosition.y * 100}%, rgba(168, 85, 247, 0.06) 0%, transparent 50% ), linear-gradient(180deg, #030712 0%, #0f172a 50%, #030712 100%) `; return (
{/* Ambient particles */}
{particles.map((particle) => ( ))}
{/* Header */}
AeThex
OS v5.0
Connect Passport
{/* Main content */}

Select Your Realm

Each realm unlocks a unique experience tailored to your journey

{realms.map((realm, index) => ( ))}
Community Developers Roadmap All Realms
); }