import { useEffect, useState } from "react"; import { X, ExternalLink } from "lucide-react"; import { THEMES } from "@/lib/themes"; import { applyTheme, getStoredThemeId } from "@/lib/themes/engine"; import { ANIMATION_IDS, ANIMATION_LABELS, type AnimationId } from "@/lib/animations"; const footerLinks = [ { href: "mailto:contact@timmypidashev.dev", label: "Contact", color: "text-green" }, { href: "https://github.com/timmypidashev", label: "Github", color: "text-yellow" }, { href: "https://www.linkedin.com/in/timothy-pidashev-4353812b8", label: "LinkedIn", color: "text-blue" }, { href: "https://github.com/timmypidashev/web", label: "Source", color: "text-purple" }, ]; const themeOptions = [ { id: "darkbox", label: "classic", color: "text-yellow-bright", activeBg: "bg-yellow-bright/15", activeBorder: "border-yellow-bright/40" }, { id: "darkbox-retro", label: "retro", color: "text-orange-bright", activeBg: "bg-orange-bright/15", activeBorder: "border-orange-bright/40" }, { id: "darkbox-dim", label: "dim", color: "text-purple-bright", activeBg: "bg-purple-bright/15", activeBorder: "border-purple-bright/40" }, ]; const animOptions = [ { id: "shuffle", color: "text-red-bright", activeBg: "bg-red-bright/15", activeBorder: "border-red-bright/40" }, { id: "game-of-life", color: "text-green-bright", activeBg: "bg-green-bright/15", activeBorder: "border-green-bright/40" }, { id: "lava-lamp", color: "text-orange-bright", activeBg: "bg-orange-bright/15", activeBorder: "border-orange-bright/40" }, { id: "confetti", color: "text-yellow-bright", activeBg: "bg-yellow-bright/15", activeBorder: "border-yellow-bright/40" }, { id: "asciiquarium", color: "text-aqua-bright", activeBg: "bg-aqua-bright/15", activeBorder: "border-aqua-bright/40" }, { id: "pipes", color: "text-blue-bright", activeBg: "bg-blue-bright/15", activeBorder: "border-blue-bright/40" }, ]; export function SettingsSheet({ open, onClose }: { open: boolean; onClose: () => void }) { const [currentTheme, setCurrentTheme] = useState(getStoredThemeId()); const [currentAnim, setCurrentAnim] = useState("shuffle"); useEffect(() => { setCurrentAnim(localStorage.getItem("animation") || "shuffle"); }, [open]); const handleTheme = (id: string) => { applyTheme(id); setCurrentTheme(id); onClose(); }; const handleAnim = (id: string) => { localStorage.setItem("animation", id); document.documentElement.dataset.animation = id; document.dispatchEvent(new CustomEvent("animation-changed", { detail: { id } })); setCurrentAnim(id); onClose(); }; return ( <> {/* Backdrop */}
{/* Sheet */}
Settings
{/* Theme */}
Theme
{themeOptions.map((opt) => ( ))}
{/* Animation */}
Animation
{animOptions.map((opt) => ( ))}
{/* Links */}
Links
{footerLinks.map((link) => ( {link.label} ))}
); }