pouët.net

Go to bottom

jsplasma

<script>w=150;h=75;d=300;m=Math;s=m.sin;u=m.round;P=m.PI;r=[];g=[];z=[];p=0;for(y=d;y--;)for(x=d;x--;j=w-y,k=w-x,z[p++]=37+37*s(m.sqrt(j*j+k*k)*P/w));setInterval(function(){o=u(h+h*s(t/w+90))*d+h+u(h*s(t/w));O=u(h-h*s(t/h))*d+h-u(h*s(t/h+90));T=C.getContext('2d');I=T.createImageData(w,w);f=I.data;p=0;for(y=w;y--;){r[y]=128+127*s(y*P/h+t/h);g[y]=128+127*s(y*P/h+t/w);for(x=w;x--;c=u(z[o++]+z[O++]),f[p++]=r[c],f[p++]=g[c],f[p++]=c,f[p++]=255);o+=w;O+=w}T.putImageData(I,0,0);t+=6},t=25)</script><canvas id=C>
Go to top