"use client"; import { useEffect, useRef, useState } from "react"; import { useRouter } from "next/navigation"; import { Mail } from "lucide-react"; import { CONTACT_EMAIL } from "../types"; const HANDLE = "getspaced"; // Discord presence via SHSF (drives the avatar ring + name dot colour). const STATUS_URL = "https://shsf.reversed.dev/api/exec/6/c084ec4a-1b20-491e-ab2e-67c5fa8881e6"; type Presence = "online" | "idle" | "dnd" | "offline"; const PRESENCE: Record = { online: { ring: "border-emerald-400/70", glow: "bg-emerald-500/30", dot: "bg-emerald-400 shadow-[0_0_12px_rgba(52,211,153,0.8)]", label: "Online", }, idle: { ring: "border-amber-400/70", glow: "bg-amber-500/30", dot: "bg-amber-400 shadow-[0_0_12px_rgba(251,191,36,0.8)]", label: "Idle", }, dnd: { ring: "border-red-500/70", glow: "bg-red-500/30", dot: "bg-red-500 shadow-[0_0_12px_rgba(239,68,68,0.8)]", label: "Do Not Disturb", }, offline: { ring: "border-gray-500/60", glow: "bg-gray-500/20", dot: "bg-gray-500", label: "Offline", }, }; function isPresence(value: unknown): value is Presence { return value === "online" || value === "idle" || value === "dnd" || value === "offline"; } export function Hero() { const router = useRouter(); const [presence, setPresence] = useState("offline"); // Hidden easter egg: rapidly shake the mouse back and forth over the avatar // (10 quick direction changes) to jump to the admin panel. const lastX = useRef(null); const lastDir = useRef<"left" | "right" | null>(null); const lastTime = useRef(0); const shakeCount = useRef(0); const resetTimeout = useRef | null>(null); const handleAvatarMouseMove = (e: React.MouseEvent) => { const currentX = e.clientX; const currentTime = Date.now(); if (lastX.current !== null) { const deltaX = currentX - lastX.current; const velocity = Math.abs(deltaX) / (currentTime - lastTime.current || 1); const direction = deltaX > 0 ? "right" : "left"; if (velocity > 2 && direction !== lastDir.current) { shakeCount.current += 1; lastDir.current = direction; if (shakeCount.current >= 10) { shakeCount.current = 0; setTimeout(() => router.push("/admin"), 0); } if (resetTimeout.current) clearTimeout(resetTimeout.current); resetTimeout.current = setTimeout(() => { shakeCount.current = 0; }, 1000); } } lastX.current = currentX; lastTime.current = currentTime; }; useEffect(() => { let cancelled = false; fetch(STATUS_URL) .then((r) => r.json()) .then((d) => { if (!cancelled && isPresence(d?.status)) setPresence(d.status); }) .catch(() => { /* keep offline on failure */ }); return () => { cancelled = true; }; }, []); const style = PRESENCE[presence]; return (
{/* Left: identity */}

Paul W.

{HANDLE}

Full-stack developer & open-source author. Building server infrastructure, developer tools, and web applications.

Europe/Berlin

{/* Right: avatar with live status ring */}
Paul W.
); }