/* global React */ // OrangeCat — the reader's guide. Variants: "sit" | "nap" | "peek". // `riso` flag shifts the palette to the duotone realm. const { useState: _useStateCat } = React; function OrangeCat({ variant = "sit", size = 150, riso = false, blink = true, style = {} }) { // palette const c = riso ? { fur: "#F2503B", deep: "#c93722", cream: "#F4ECDC", stripe: "#2BBFB3", nose: "#2BBFB3", line: "#23201d" } : { fur: "var(--cat-orange)", deep: "var(--cat-orange-deep)", cream: "var(--cat-cream)", stripe: "var(--cat-stripe)", nose: "#c96a55", line: "#3a2414" }; const [closed, setClosed] = _useStateCat(variant === "nap"); React.useEffect(() => { if (!blink || variant === "nap") return; let t; const loop = () => { const next = 2200 + Math.random() * 3500; t = setTimeout(() => { setClosed(true); setTimeout(() => setClosed(false), 150); loop(); }, next); }; loop(); return () => clearTimeout(t); }, [blink, variant]); const napping = variant === "nap"; const eyesShut = napping || closed; return ( {napping ? ( // curled, sleeping {/* tail wrapping */} {/* head resting */} {/* closed eyes */} {/* zzz */} z Z ) : ( // sitting upright {/* tail curling around front-right */} {/* body */} {/* front paws */} {/* head */} {/* ears */} {/* forehead stripes */} {/* muzzle */} {/* eyes */} {eyesShut ? ( ) : ( )} {/* nose + mouth */} {/* whiskers */} )} ); } window.OrangeCat = OrangeCat;