!function(o,a,t,r,e,l){function i(o,a){return parseInt(w[o]*a+h[o]*(1-a))}var n=9,s=1.5,f=500,d=1,h=[255,170,51],w=[8,71,207],c="#000",v=["10^-43s","10^-35s","10^-10s","0.001s","3 min","300000 yrs","1 billion yrs","now"];o.onload=function(){var o,h,w=1,b=1,g=24,u=24;for(l.fillStyle=c,l.fillRect(0,0,r,e),o=0;n>o;o++){b=e/2-u/2;var y=o/n,S=[i(0,y),i(1,y),i(2,y)],p="rgb("+S[0]+","+S[1]+","+S[2]+")";for(n-1>o&&(l.beginPath(),l.moveTo(w+g,0),l.lineTo(w+g,e),l.strokeStyle="#222",l.stroke()),h=0;f>h;h++){var m=o>1&&h%20==1?o:1,C="rgba("+S[0]+","+S[1]+","+S[2]+","+(1==m&&h%2==1?.5:1)+")",P=a()*g+w-w+w,T=a()*u+b-b+b;l.beginPath(),m>1&&(l.save(),l.shadowColor=p,l.shadowBlur=10,l.shadowOffsetX=l.shadowOffsetY=1,C=l.createRadialGradient(P,T,1,P,T,9),C.addColorStop(0,p),C.addColorStop(1,c)),l.arc(P,T,d*m,2*t,!1),l.fillStyle=C,l.fill(),l.restore()}n-1>o&&(l.save(),l.translate(0,0),l.rotate(t/2),l.font="15px Arial",l.fillText(v[o],10,-w-g),l.restore()),w+=g,g=u*=s}}}(window,Math.random,Math.PI,a.width,a.height,c);
(function(w, rnd, pi, aw, ah, c) {
var maxStages = 9,
stageExp = 1.5,
objsInStage = 500,
objSize = 1,
beginColor = [255,170,51],
endColor = [8,71,207],
colorBlack = "#000",
stageDesc = [
"10^-43s",
"10^-35s",
"10^-10s",
"0.001s",
"3 min",
"300000 yrs",
"1 billion yrs",
"now"
];
function _grad(part, perc) {
return parseInt(endColor[part] * perc + beginColor[part] * (1 - perc));
}
w.onload = function() {
var sx = 1,
sy = 1,
sw = 24,
sh = 24,
i,
j;
// Render background.
c.fillStyle = colorBlack;
c.fillRect(0, 0, aw, ah);
// Render stages.
for(i = 0; i < maxStages; i++) {
sy = ah / 2 - sh / 2;
var perc = i / maxStages,
// Calculate linear gradient.
color = [_grad(0, perc),
_grad(1, perc),
_grad(2, perc)],
// Save color for reuse.
gradColor = "rgb(" + color[0] + "," + color[1] + "," + color[2] + ")";
// Draw stage separator.
if(i < maxStages - 1) {
c.beginPath();
c.moveTo(sx + sw, 0);
c.lineTo(sx + sw, ah);
c.strokeStyle = "#222";
c.stroke();
}
// Render objects.
for(j = 0; j < objsInStage; j++) {
var objExp = i > 1 && j % 20 == 1 ? i : 1,
style = "rgba(" + color[0] + "," + color[1] + "," + color[2] + "," + (objExp == 1 && j % 2 == 1 ? 0.5 : 1) + ")",
x = rnd() * sw + sx - sx + sx,
y = rnd() * sh + sy - sy + sy;
c.beginPath();
if(objExp > 1) {
c.save();
c.shadowColor = gradColor;
c.shadowBlur = 10;
c.shadowOffsetX = c.shadowOffsetY = 1;
style = c.createRadialGradient(x, y, 1, x, y, 9);
style.addColorStop(0, gradColor);
style.addColorStop(1, colorBlack);
}
c.arc(x, y, objSize * objExp, 2 * pi, false);
c.fillStyle = style;
c.fill();
c.restore();
}
if(i < maxStages - 1) {
c.save();
c.translate(0, 0);
c.rotate(pi / 2);
c.font="15px Arial";
c.fillText(stageDesc[i], 10, -sx - sw);
c.restore();
}
// Calculations for next stage.
sx += sw;
sw = sh *= stageExp;
}
};
})(window, Math.random, Math.PI, a.width, a.height, c);