A Pen by Govind Lahoti on CodePen.
Created
August 27, 2019 01:37
-
-
Save govindlahoti/69016b797384796c123209e5f7440271 to your computer and use it in GitHub Desktop.
#1
This file contains 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 canvas = document.createElement('canvas'); | |
document.body.appendChild(canvas); | |
var w = window.innerWidth; | |
var h = window.innerHeight; | |
canvas.width = w; | |
canvas.height = h; | |
const ctx = canvas.getContext('2d'); | |
var randomX = () => Math.random() * w; | |
var randomY = () => Math.random() * h; | |
var randomR = () => Math.random() * 100; | |
ctx.globalCompositeOperation = 'xor'; | |
ctx.fillStyle = 'black'; | |
for(var i=0; i<500; i++) | |
{ | |
ctx.beginPath(); | |
ctx.arc(randomX(), randomY(), 100, 0, 2 * Math.PI); | |
ctx.fill(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment