To replace my previous vomit inducing demo, this one generates a cellular texture, which changes color and moves around. Larger windows have performance issues when using Firefox.
(function(){var j,b=h=128,k=Math,q=k.random,w=k.ceil(window.innerWidth/b)*b,x=k.ceil(window.innerHeight/h)*h,e,a,c=[],y=[],f,g,o,r,l,m,n=0,p=k.abs;function A(){n-=0.04;if(4==p(~~n))n=-n;for(f=0;f<b;f+=4)for(g=0;g<h;g+=4){o=0;r=b*h;for(a=0;a<9;a++){l=p(f-c[a].x);m=p(g-c[a].y);if(l>b/2)l=b-l;if(m>h/2)m=h-m;o=k.sqrt(l*l+m*m);if(o<r)r=y[g*b+f]=o}for(var t=0;t<4;t++)for(var u=0;u<4;u++){e=(f+t+(g+u)*j.width)*4;var B=y[g*b+f];j.data[e]=~~(B*4);j.data[e+2]=~~(B*p(n));j.data[e+3]=255}}for(f=0;f<w;f+=b)for(g=
0;g<x;g+=h)C.putImageData(j,f,g);for(a=0;a<9;a++){e=k.sin(c[a].a);c[a].x+=e;c[a].y+=e;if(c[a].x>b)c[a].x=0;if(c[a].x<0)c[a].x=b;if(c[a].y>h)c[a].y=0;if(c[a].y<0)c[a].y=h}setTimeout(function(){A()},20)}d=document;z=d.body;s=z.style;s.overflow="hidden";s.margin=0;var i=d.createElement("canvas");i.width=i.height=b;i=i.getContext("2d");var v=d.getElementById("c");v.width=w;v.height=x;var C=v.getContext("2d");j=i.getImageData(0,0,b,h);for(e=0;e<9;e++){i=[];i.x=~~(q()*b);i.y=~~(q()*h);i.a=q()*360;c[e]=
i}A()})();
KGZ1bmN0aW9uKCl7dmFyIGosYj1oPTEyOCxrPU1hdGgscT1rLnJhbmRvbSx3PWsuY2VpbCh3aW5kb3cuaW5uZXJXaWR0aC9iKSpiLHg9ay5jZWlsKHdpbmRvdy5pbm5lckhlaWdodC9oKSpoLGUsYSxjPVtdLHk9W10sZixnLG8scixsLG0sbj0wLHA9ay5hYnM7ZnVuY3Rpb24gQSgpe24tPTAuMDQ7aWYoND09cCh+fm4pKW49LW47Zm9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CkqMzYwO2NbZV09DQppfUEoKX0pKCk7
// Texture generator and better commented (less hacked up source) located at http://somethinghitme.com/projects/cell/
// MIT license, do whatever you please.
(function(){
var imageData,
w = h = 128,
m=Math,
r=m.random,
wW = m.ceil(window.innerWidth/w) * w,
wH = m.ceil(window.innerHeight/h) * h,
i,p,rP=[],points=[],x,y,dist,curMinDist,dx,dy,
g=0,a=m.abs,
draw = function(){
// Check distance with all other points
g-=.04;if(4==a(~~g)){g=-g};
for(x = 0; x < w; x+=4){
for(y = 0; y < h; y+=4){
dist = 0;
curMinDist = w * h;
for(p=0; p < 9; p++){
dx = a(x-rP[p].x);
dy = a(y-rP[p].y);
if (dx > w/2){ dx = w-dx;}
if (dy > h/2){ dy = h-dy;}
dist = m.sqrt(dx * dx + dy * dy);
if(dist < curMinDist){
points[y * w + x] = dist;
curMinDist = dist;
}
}
for(var pix = 0; pix < 4; pix++){
for(var piy = 0; piy < 4; piy++){
i = ((x + pix) + (y + piy) * imageData.width) * 4;
var val = points[y * w + x];
imageData.data[i] = ~~(val * 4);
imageData.data[i+2] = ~~(val * a(g));
imageData.data[i+3] = 255;
}
}
}
}
for(x = 0; x<wW; x+= w){
for(y = 0; y<wH; y+= h){
ctxCopy.putImageData(imageData, x, y);
}
}
for(p=0; p < 9; p++){
//rP[p].a+= .1;
i = m.sin(rP[p].a);
rP[p].x+=i;
rP[p].y+=i;
if(rP[p].x > w){
rP[p].x = 0;
}
if(rP[p].x < 0){
rP[p].x = w;
}
if(rP[p].y > h){
rP[p].y = 0;
}
if(rP[p].y < 0){
rP[p].y = h;
}
}
var to = setTimeout(function(){draw()}, 20);
};
d=document;
z=d.body;
s=z.style;
s.overflow = "hidden";
s.margin = 0;
var canvas = d.createElement("canvas");
canvas.width = canvas.height = w;
var ctx = canvas.getContext("2d");
var canvasCopy = d.getElementById("c");
canvasCopy.width = wW;
canvasCopy.height = wH;
var ctxCopy = canvasCopy.getContext("2d");
imageData = ctx.getImageData(0,0,w,h);
// Setup the points
for(i = 0; i < 9; i++){
var t = [];
t.x = ~~(r()* w);
t.y = ~~(r()* h);
t.a = r()*360;
rP[i]=t;
}
draw();
})();