import { motion } from "framer-motion"; import { useState, useEffect } from "react"; export default function TeamModal({ isOpen, onClose, playPressSound, playSfx, }: { isOpen: boolean; onClose: () => void; playPressSound: () => void; playSfx: (sound: string) => void; }) { const [focusIndex, setFocusIndex] = useState(0); const team = [ { name: "neoapps", url: "https://github.com/neoapps-dev" }, { name: "KayJann", url: "https://github.com/KayJannOnGit" }, { name: "Santiago Fisela", url: "https://github.com/PinkLittleKitty" }, { name: "Leon", url: "https://github.com/hornyalcoholic" }, { name: "Criador_Mods", url: "https://github.com/CriadorMods" }, ]; useEffect(() => { if (!isOpen) { setFocusIndex(0); return; } const handleKey = (e: KeyboardEvent) => { if (e.key === "Escape") { playSfx("close_click.wav"); onClose(); } else if (e.key === "ArrowDown" || e.key === "Tab") { e.preventDefault(); setFocusIndex((prev) => (prev + 1) % (team.length + 1)); } else if (e.key === "ArrowUp") { e.preventDefault(); setFocusIndex((prev) => (prev - 1 + (team.length + 1)) % (team.length + 1)); } else if (e.key === "Enter") { if (focusIndex === team.length) { playSfx("close_click.wav"); onClose(); } else { playPressSound(); window.open(team[focusIndex].url, "_blank", "noopener,noreferrer"); } } }; window.addEventListener("keydown", handleKey); return () => window.removeEventListener("keydown", handleKey); }, [isOpen, focusIndex]); if (!isOpen) return null; return (

Emerald Team

{team.map((dev, idx) => ( playPressSound()} onMouseEnter={() => setFocusIndex(idx)} className={`w-56 h-10 flex items-center justify-center mc-text-shadow text-xl transition-all outline-none border-none bg-transparent ${focusIndex === idx ? "text-[#FFFF55]" : "text-white"}`} style={{ backgroundImage: focusIndex === idx ? "url('/images/button_highlighted.png')" : "url('/images/Button_Background.png')", backgroundSize: "100% 100%", imageRendering: "pixelated", }} > {dev.name} ))}
); }