getIllo = () => {
const w = width + 28,
h = 250;
const context = DOM.context2d(w, h, 1);
const getRandomColor = () => `hsl(${Math.random() * 360},50%,50%)`;
context.canvas.style.margin = "0 -14px 0 -14px";
context.canvas.style.position = "relative";
context.canvas.style.zIndex = "-1";
context.canvas.style.imageRendering = "pixelated";
context.globalCompositeOperation = "xor";
const data = d3.range(3).map(d => ({
cx: d3.randomUniform(w * 0.7, w * 0.9)(),
cy: d3.randomUniform(h * 0.2, h * 0.8)(),
r: (Math.random() * h) / 6,
c: getRandomColor(),
t0: 0
}));
let dr = 4;
d3.timer(t => {
if (t > 2000) return true;
data.forEach(d => {
if (t < d.t0) return;
context.strokeStyle = d.c;
context.beginPath();
context.arc(d.cx, d.cy, d.r, 0, Math.PI * 2);
context.stroke();
d.r += dr;
dr *= 0.95;
});
});
return context.canvas;
}