var d = document,
canvas = d.body.appendChild( d.createElement( 'canvas' ) ),
context = canvas.getContext( '2d' ),
time = 0,
w = canvas.width = d.width,
h = canvas.height = d.height,
cos = Math.cos,
sin = Math.sin,
PI = Math.PI
setInterval( function() {
// Clear
canvas.width = canvas.width;
time += .1
// Particle count
i = 1e4
while( i-- ) {
// The magic
r = (w+h)/2 * ( cos( ( time + i ) * ( .05 + ( sin(time/1e5) / PI * .2 ) ) ) / PI )
context.fillRect( sin(i) * r + w/2,
cos(i) * r + h/2,
1.5,
1.5 )
}
}, 16 )