Heart shaped metablobs! Click to randomly create new ones, middle-mouse-click (or right, but that opens a context menu) to fling every blob in a new direction.
T=10;D="onmousedown";M="onmousemove";Z=16;w=c.width=h=c.height=200;m=Math;d=m.abs;r=m.random;l=4;c.setAttribute("style","position:absolute;top:0;left:0;width:100%;height:100%;");q=window;function s(b,f,j,g){b-=j;f-=g;return b*b+f*f}c[M]=function(b){e[0][0]=b.pageX/q.innerWidth*w;e[0][1]=b.pageY/q.innerHeight*h};q.setInterval(function(b,f,j,g,t,k){a.fillStyle="#"+(Z+120*(m.sin((new Date).getTime()/1e3)+1)<<Z).toString(Z);a.fillRect(0,0,w,h);for(b=0;b<w;b++)for(f=0;f<h;f++){for(i=j=k=0;i<l;i++){g=b;var n=f,o=e[i][0],p=e[i][1];g=m.min(2,T/(d(o-g)+d(p-n))+m.max(100/s(g,n,o-13,p-T),100/s(g,n,o+13,p-T)));g>k&&(t=i,k=g);j+=g}a.fillStyle="#"+e[t][4].toString(Z);0.9<j&&a.fillRect(b,f,1,1)}for(i=1;i<l;i++){b=e[i];b[0]+=b[2];b[1]+=b[3];if(0>b[0]||b[0]>w)b[2]*=-1;if(0>b[1]||b[1]>h)b[3]*=-1}},40);q[D]=function(b){b.stopPropagation();var f=0;if(1<b.which)for(f=0;f<l;f++)e[f][2]=T*r(),e[f][3]=T*r();else{e=[];for(f=0;f<l;f++)e[f]=[r()*w,r()*h,T*r(),T*r(),Z+240*r()<<Z]}return!1};q.onload=function(b){q[D](b);c[M](b)};
VD0xMDtEPSJvbm1vdXNlZG93biI7TT0ib25tb3VzZW1vdmUiO1o9MTY7dz1jLndpZHRoPWg9Yy5oZWlnaHQ9MjAwO209TWF0aDtkPW0uYWJzO3I9bS5yYW5kb207bD00O2Muc2V0QXR0cmlidXRlKCJzdHlsZSIsInBvc2l0aW9uOmFic29sdXRlO3RvcDowO2xlZnQ6MDt3aWR0aDoxMDAlO2hlaWdodDoxMDAlOyIpO3E9d2luZG93O2Z1bmN0aW9uIHMoYixmLGosZ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XtxW0RdKGIpO2NbTV0oYil9Ow==
w = c.width = 200;
h = c.height = 200;
m = Math;
d = m.abs;
r = m.random;
l = 4;
c.setAttribute("style","position:absolute;top:0;left:0;width:100%;height:100%;");
q = window;
e = [];
function sqDist(x1, y1, x2, y2) {
var x = x1 - x2, y = y1 - y2;
return x*x + y*y;
}
function getValue(hx, hy, x, y) {
return m.min(2, 10 / (d(hx - x)+d(hy - y)) + m.max(100/sqDist(x,y,hx-13,hy-10), 100/sqDist(x,y,hx+13,hy-10)));
}
function draw() {
var x,y,value,g,v,closest,max;
a.fillStyle = "#"+((16+120*(m.sin((new Date().getTime())/900)+1))<<16).toString(16);
a.fillRect(0,0,w,h);
for(x=0;x<w;x++) {
for(y=0;y<h;y++) {
value = max = 0;
for(i=0;i<l;i++) {
v = getValue(e[i][0],e[i][1],x,y);
if(v > max) {
closest = i;
max = v;
}
value += v;
}
a.fillStyle = "#"+e[closest][4].toString(16);
if(value > 0.9) a.fillRect(x,y,1,1);
}
}
for(i=1;i<l;i++) {
g = e[i];
g[0] += g[2];
g[1] += g[3];
if(g[0] < 0 || g[0] > w) g[2] *= -1;
if(g[1] < 0 || g[1] > h) g[3] *= -1;
}
}
c.onmousemove = function(v){
e[0][0] = v.pageX / q.innerWidth * w;
e[0][1] = v.pageY / q.innerHeight * h;
};
q.setInterval(draw, 40);
q.onmousedown = function(v) {
v.stopPropagation();
var b = v.which?v.which:v.button,i=0;
if(b > 1) {
for(i=0;i<l;i++) {
e[i][2] = r()*10; e[i][3] = r()*10;
}
} else {
e = [];
for(i=0;i<l;i++)
e[i] = [r()*w,r()*h,r()*10,r()*10,(16+240*r())<<16];
}
return false;
}
q.onload = function(v) {q.onmousedown(v); c.onmousemove(v);}