// Home page — centered chooser between Papers and Projects. const { useState, useEffect, useRef, useMemo } = React; function Tile({ to, kana, label, count, blurb, items }) { const [hover, setHover] = useState(false); return ( setHover(true)} onMouseLeave={() => setHover(false)} >
{String(count).padStart(2, "0")} {label}
{kana}
{items.slice(0, 3).map((it, i) => (
{it}
))}
{blurb}
); } function Portrait() { // Check whether portrait.jpg exists in the project; only render if it does. // Until then, show a styled placeholder with no network request. const [src, setSrc] = useState(null); useEffect(() => { const probe = new Image(); probe.onload = () => setSrc("portrait.jpg"); probe.onerror = () => setSrc(null); probe.src = "portrait.jpg"; }, []); return (
{src && Sam McLeod}
SM drop portrait.jpg in project root
); } function Home() { const { PAPERS, PROJECTS, SOCIALS } = window.SITE_DATA; const paperPreview = PAPERS.slice(0, 3).map((p) => p.title); const projectPreview = PROJECTS.slice(0, 3).map((p) => `${p.name} — ${p.tag}`); return (

Sam McLeod

Student / Builder / Writer

{SOCIALS.map((s) => ( {s.label} {s.handle} ))}
); } ReactDOM.createRoot(document.getElementById("root")).render();