A Pen by Carl Calderon on CodePen.
Created
November 27, 2014 00:37
-
-
Save simudream/9cdfb6201aac62f58343 to your computer and use it in GitHub Desktop.
Nonsense 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
t=0 | |
cvs=document.createElement "canvas" | |
document.body.appendChild cvs | |
ctx=cvs.getContext "2d" | |
cvs.width=window.innerWidth | |
cvs.height=window.innerHeight | |
raf=requestAnimationFrame | |
db=(x,y,v) -> | |
p=(x*y)/4096 | |
pv=(v-80)/40 | |
ctx.fillStyle="rgb(#{parseInt (1-pv)*255},#{parseInt pv*255},#{parseInt (0.5-pv)*255})" | |
ctx.fillRect parseInt(x*10-parseInt(-window.innerWidth,10)/64*y+window.innerWidth/2+parseInt(-window.innerWidth*1.2,10),10),parseInt(y-v+Math.cos(t/3)*parseInt(window.innerHeight/3,10)/64*x+window.innerHeight/2,10),10,Math.pow(v,1.1) | |
return | |
raf r=-> | |
t+=0.1 | |
ctx.fillStyle="#000" | |
ctx.fillRect 0,0,window.innerWidth,window.innerHeight | |
for x in [0..64] then for y in [0..64] then db x,y,Math.sin(x*y/4096*Math.PI*10/2+t)*20+100 | |
raf r |
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
body { overflow: hidden; background: black } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment