Skip to content

Instantly share code, notes, and snippets.

@alesanabv
Last active July 28, 2016 16:26
Show Gist options
  • Save alesanabv/fece057bb690b842409777313117dcbb to your computer and use it in GitHub Desktop.
Save alesanabv/fece057bb690b842409777313117dcbb to your computer and use it in GitHub Desktop.
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
c.width = 500;
c.height = 500;
function createCircles(x, y, r) {
ctx.fillStyle = "#012754";
ctx.beginPath();
ctx.arc(x,y,r,0,2*Math.PI);
ctx.closePath();
ctx.fill();
}
document.addEventListener('mousemove', function(e) {
createCircles(e.x, e.y, Math.random() * 5);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment