Last active
July 28, 2016 16:26
-
-
Save alesanabv/fece057bb690b842409777313117dcbb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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