viewof area = {
const context = DOM.context2d(width, height);
const canvas = context.canvas;
const barHeights = [height];
const barWidth = 500;
const stepWidth = 2;
const stepHeight = 3;
const dotWidth = 2;
const dotHeight = 2;
function render() {
context.clearRect(0, 0, width, height);
for(let [i, barHeight] of barHeights.entries()) {
for(let x = 0; x < barWidth; x+= stepWidth) {
for(let y = 0; y < barHeight; y+= stepHeight) {
const draw = Math.random() > 1 - y / height;
if(draw) {
const yPos = height - y;
context.fillStyle = y > barHeight / 2 || i === 0 ? `rgba(93, 111, 176, .4)` : `rgba(93, 111, 176, .15)`;
context.fillRect(
x + barWidth * barHeights.length / barHeights.length * i + 40 * i,
yPos,
dotWidth,
dotHeight
);
}
}
}
}
}
render();
return canvas;
}