// Hero const { useState: useStateH, useEffect: useEffectH, useMemo: useMemoH } = React; function ConnectivityMatrix() { const nodes = ["office-server", "dev-laptop", "ci-runner", "edge-sg", "home-nas", "staging-01", "prod-eu-1", "prod-us-2"]; const [tick, setTick] = useStateH(0); const base = useMemoH(() => { const n = nodes.length; const m = Array.from({ length: n }, () => Array(n).fill(0)); for (let i = 0; i < n; i++) for (let j = 0; j < n; j++) { if (i === j) { m[i][j] = 0; continue; } const h = (i * 31 + j * 17) % 10; m[i][j] = h < 6 ? 1 : h < 8 ? 2 : h < 9 ? 3 : 4; } return m; }, []); useEffectH(() => { const t = setInterval(() => setTick(x => x + 1), 1400); return () => clearInterval(t); }, []); // v: 0=self, 1=direct, 2=user_relay, 3=managed_relay, 4=unreachable // color = reachability (green connected, red unreachable); letter = transport const bgFor = (v, pulse) => { if (v === 0) return "var(--bg)"; if (v === 4) return "color-mix(in oklab, var(--bad) 30%, var(--bg))"; return pulse ? "var(--accent)" : "color-mix(in oklab, var(--accent) 75%, var(--bg))"; }; const letterFor = (v) => v === 2 ? "U" : v === 3 ? "M" : ""; const cell = 28; return (
{t.hero.body}{t.hero.body2 && <>{" "}{t.hero.body2}>}