{
redrawButton;
const context = DOM.context2d(width, height);
const data = clearImage.context.getImageData(0, 0, width, height);
d3.blurImage(data, blurDense);
context.putImageData(data, 0, 0);
function draw() {
context.putImageData(data, 0, 0);
drops.map((drop) => {
const { x, y, size, speed, length } = drop;
const px = x * width,
py = y * height;
context.save();
{
context.beginPath();
for (let i = 0; i < 1; ++i) {
context.save(),
context.translate(px, py),
context.rotate(0.5),
context.rotate(Math.PI),
context.scale(1, 1.4),
context.arc(0, 0, size, 0, Math.PI * 2, true),
context.restore();
}
context.closePath();
}
{
context.clip(),
context.save(),
context.translate(px, py),
context.scale(-1, -1),
context.drawImage(clearImage.img, -px, -py, width, height),
context.restore();
}
context.restore();
});
}
function loop() {
if (animation2State.animation) {
requestAnimationFrame(loop);
}
updateDrops();
draw();
}
if (animation2Toggle) {
loop();
} else {
updateDrops();
draw();
}
return context.canvas;
}