import { useState, useEffect, useRef } from "react"; /* ── Win98 panel helpers ─────────────────────────────── */ const win98Panel = { background: "#c0c0c0", boxShadow: "inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px #808080, inset 2px 2px #dfdfdf", }; const win98Sunken = { background: "#fff", boxShadow: "inset 1px 1px #0a0a0a, inset -1px -1px #fff, inset 2px 2px #808080, inset -2px -2px #dfdfdf", }; const win98Button = { background: "#c0c0c0", boxShadow: "inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px #808080, inset 2px 2px #dfdfdf", border: "none", padding: "2px 8px", cursor: "pointer", fontFamily: '"Comic Neue", "Comic Sans MS", cursive', fontSize: "11px", }; /* ── Title bar ───────────────────────────────────────── */ function TitleBar({ title, icon }: { title: string; icon?: string }) { return (
{icon && {icon}} {title}
{["_", "□", "✕"].map((c, i) => ( ))}
); } /* ── Window wrapper ──────────────────────────────────── */ function Win98Window({ title, icon, children, style, }: { title: string; icon?: string; children: React.ReactNode; style?: React.CSSProperties; }) { return (
{children}
); } /* ── Hit counter ─────────────────────────────────────── */ function HitCounter({ count }: { count: number }) { const digits = String(count).padStart(7, "0").split(""); return (
{digits.map((d, i) => ( {d} ))}
); } /* ── Blinking text ───────────────────────────────────── */ function Blink({ children, color = "#ff00ff" }: { children: React.ReactNode; color?: string }) { const [vis, setVis] = useState(true); useEffect(() => { const id = setInterval(() => setVis((v) => !v), 600); return () => clearInterval(id); }, []); return ( {children} ); } /* ── Marquee ─────────────────────────────────────────── */ function Marquee({ text, color = "#ffff00" }: { text: string; color?: string }) { const ref = useRef(null); const innerRef = useRef(null); const [offset, setOffset] = useState(0); useEffect(() => { let raf: number; let pos = 0; const tick = () => { if (ref.current && innerRef.current) { const containerW = ref.current.offsetWidth; const textW = innerRef.current.offsetWidth; pos -= 1.2; if (pos < -textW) pos = containerW; setOffset(pos); } raf = requestAnimationFrame(tick); }; raf = requestAnimationFrame(tick); return () => cancelAnimationFrame(raf); }, []); return (
{text}
); } /* ── Music player ────────────────────────────────────── */ function MusicPlayer() { const [playing, setPlaying] = useState(false); const [track, setTrack] = useState(0); const tracks = [ { title: "Numa Numa - O-Zone", dur: "3:28" }, { title: "All Star - Smash Mouth", dur: "3:15" }, { title: "Never Gonna Give You Up", dur: "3:33" }, { title: "Dragostea Din Tei", dur: "3:39" }, ]; return (
♪ NOW PLAYING ♪
{tracks[track].title}
{playing ? "▶ PLAYING" : "⏸ PAUSED"} — {tracks[track].dur}
{[ { lbl: "⏮", act: () => setTrack((t) => (t - 1 + tracks.length) % tracks.length) }, { lbl: playing ? "⏸" : "▶", act: () => setPlaying((p) => !p) }, { lbl: "⏹", act: () => { setPlaying(false); } }, { lbl: "⏭", act: () => setTrack((t) => (t + 1) % tracks.length) }, ].map(({ lbl, act }, i) => ( ))}
{tracks.map((t, i) => (
{ setTrack(i); setPlaying(true); }} style={{ cursor: "pointer", color: i === track ? "#00ff00" : "#555", padding: "1px 0", }} > {i === track ? "▶" : " "} {i + 1}. {t.title}
))}
); } /* ── Guestbook ───────────────────────────────────────── */ const initialEntries = [ { name: "xXdarkangel99Xx", msg: "OMG ur site is so kewl!!!! add me on MSN!!! ^_^", date: "2003-08-14" }, { name: "StarlightDreamer", msg: "I luv ur backgrounds!! Where did u get them??", date: "2003-08-12" }, { name: "TechnoWizard2000", msg: "FIRST!!! great site lol ur the best", date: "2003-08-11" }, { name: "pinkbutterfli", msg: "added ur button 2 my site!! link me back plz :3", date: "2003-08-09" }, ]; function Guestbook() { const [entries, setEntries] = useState(initialEntries); const [name, setName] = useState(""); const [msg, setMsg] = useState(""); const [signed, setSigned] = useState(false); const submit = () => { if (!name.trim() || !msg.trim()) return; setEntries([{ name, msg, date: "2003-08-15" }, ...entries]); setName(""); setMsg(""); setSigned(true); }; return (
{signed && (
✓ ENTRY ADDED!! TY 4 SIGNING!!!
)}
setName(e.target.value)} style={{ ...win98Sunken, width: "100%", padding: "2px 4px", fontFamily: '"Comic Neue", cursive', fontSize: "11px", boxSizing: "border-box", marginBottom: 3 }} />