import { useState } from 'react'; import Logo from '../components/Logo.jsx'; import PlatformScene from '../components/PlatformScene.jsx'; import { BRAND, PLATFORM_MAP } from '../data.js'; import { guideHref } from '../guide/nav.js'; // The flow is drawn in a fixed space, x in thousandths of the width and y in pixels, so the curves // meet the nodes without measuring them and the prerendered page already shows them. const FLOW_HEIGHT = 460; const NODE_HEIGHT = 56; const EDGES = { sourceEnd: 260, hubStart: 370, hubEnd: 630, outputStart: 740 }; const nodeCentres = (count, gap) => { const top = (FLOW_HEIGHT - (count * NODE_HEIGHT + (count - 1) * gap)) / 2; return Array.from({ length: count }, (_, i) => top + i * (NODE_HEIGHT + gap) + NODE_HEIGHT / 2); }; // The curves reach the hub in a narrow fan around its middle rather than at a single point. const fan = (index, count, spread) => FLOW_HEIGHT / 2 + (index - (count - 1) / 2) * spread; const inPath = (y, index, count) => { const mid = (EDGES.sourceEnd + EDGES.hubStart) / 2; const end = fan(index, count, 12); return `M${EDGES.sourceEnd} ${y}C${mid} ${y} ${mid} ${end} ${EDGES.hubStart} ${end}`; }; const outPath = (y, index, count) => { const mid = (EDGES.hubEnd + EDGES.outputStart) / 2; const start = fan(index, count, 10); return `M${EDGES.hubEnd} ${start}C${mid} ${start} ${mid} ${y} ${EDGES.outputStart} ${y}`; }; const accentLine = (tokens) => `color-mix(in srgb, ${tokens.accent} 45%, transparent)`; const percent = (thousandths) => `${thousandths / 10}%`; const rowHref = ({ href, guide, anchor }) => { if (!guide) return href; return anchor ? `${guideHref(guide)}#${anchor}` : guideHref(guide); }; function RowLink({ row, style, children, ...events }) { const href = rowHref(row); if (!href) return
{row.chip}
)}
/>
))}
{lede}