(function(){ window.HPX = window.HPX || {}; window.HPX['chain-react'] = function(el){ const U = window.HPX._u; const k = U.canvas(el), ctx = k.ctx; const ac = U.accent(el,'#7c5cff'), ac2 = U.accent2(el,'#22d3ee'); const N = 8; const stop = U.loop((t) => { ctx.clearRect(0,0,k.w,k.h); const cy = k.h/2; const pad = 60; const dx = (k.w - pad*2)/(N-1); const period = 2.4; const phase = (t % period) / period; // 0..1 for (let i=0;i0.1 ? ac2 : ac; ctx.beginPath(); ctx.arc(x,cy,r,0,Math.PI*2); ctx.fill(); ctx.strokeStyle='rgba(255,255,255,0.4)'; ctx.lineWidth=2; ctx.stroke(); // connectors if (i