- Author:
- Remco Veldkamp
- Twitter:
- @
- GitHub:
- Facebook:
- Google+:
- +
- Reddit:
- /r/
- Pouet:
- Website:
- Compo:
- classic
- Demo link:
- https://js1k.com/2010-first/demo/763
- Shortlink:
- https://js1k.com/763
- Blog post:
- please update here!
- Bytes:
- 972
- Chars:
- 972
- Submission
a="lt=\"leTo\",b=Mh,i=s,j=cos,k=docume,bs=k.body.style,n=k.g!ElemeById#c\"),og!Coext#2d\"bs.marg=8bs.overflow=\"hidden\";pwidthWidth,qheightHeight,r=-p/2,s=-q/2;o.transle(-r,-su=qv=[\" 1 F\",\"9F 999 1\"w=-2x=2*PI/3y=;function C(b,a,cr!urn\"rgb#b+a+c+\")\"}s!Ierval#'black';Rect(r,s,p,qg=+new De;y-=.0625;if(y<0y+=;w++}for@=h=31;h--;l=h*+y,z=200-200/(3+y)*l,m=z/2;C(m,m,mfor(A=i17GB=jGc=[a=8a<128a+=4t=af=t*x+PI+J37,e=u/l;c[a 1 2+x 3+x)*e;f=(w+h)%48e=z/4;C(+(v[f]?v[f][t-3]:0)?max(150(105*J1),e):mt%16==0&&(h+w)%12?255:e,eif@o.begPh(o.moveTo(c[ac1(c2cK2dK[ad1](()}}d=c}\",50";for(b in c="K3@Ji(g/G*7F @(d980;#(\"!etntat(l+g/=ner/4,=n.){1b.],0,in]=B+i(f]=A+j(f00)+~~11o.stroke.1875); )*e;cStyle= ]);o[lt]o.fill[a+\",\" 1".split(""))a=a.replace(RegExp(c[b][0],"g"),c[b].slice(1));eval(a)
- Description
- /* WipeOut 1k */
A classic tunnel effect in bright colors, reminiscent of the old WipeOut game for the PS1 :-)
Thanks to: Google for making the Closure Compiler, Microsoft for the Ajax Minifier, Aivo Paas for jscrush. Couldn't have done it w/o those brilliant tools!
- Base64 encoded
YT0ibHQ9XCJsFGVUb1wiLGI9TR5oLGk9F3MULGo9F2NvcyxrPWRvY3VtZR8sYnM9ay5ib2R5LnN0eWxlLG49ay5nIUVsZW1lH0J5SWQjY1wiKSxv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5maWxsAQRbYSsBA1wiLFwiAQIgIDEiLnNwbGl0KCIBIikpYT1hLnJlcGxhY2UoUmVnRXhwKGNbYl1bMF0sImciKSxjW2JdLnNsaWNlKDEpKTtldmFsKGEp
- Original source
/* Wipeout 1k */
var M = Math;
var sin = M.sin;
var cos = M.cos;
var d = document;
var canvas = d.getElementById("c");
var ctx = canvas.getContext("2d");
d.body.style.margin = 0;
d.body.style.overflow = "hidden";
var width = canvas.width = innerWidth;
var height = canvas.height = innerHeight;
var left = -width/2;
var ttop = -height/2;
ctx.translate(-left,-ttop);
var scale = height/4;
// inefficient, I know, but hey we have the bytes :-)
var text = ["1111 111",
" 1 1",
" 1 11",
" 1 1",
"1 1 1",
" 11 111",
0,
" 1 1 1",
" 11 1 1",
" 1 11",
" 1 11",
" 1 1 1",
" 111 1 1"];
var textscroll = -20;
var textoffset = 3;
var rings = 32;
var ringsize = 30;
var zmax = 3;
var zstep = 2*zmax / rings;
var tstep = 2*M.PI/ringsize;
var zshift = zstep;
function rgb(r,g,b) { return "rgb("+ ~~r +","+ ~~g +","+ ~~b +")" }
setInterval(function() {
ctx.fillStyle = "black";
ctx.fillRect(left,ttop,width,height);
var date = +new Date;
zshift-=zstep/3;
if (zshift < 0)
{
zshift += zstep;
textscroll++;
};
var ringb = 0;
var zr=rings-1;
while ( zr--)
{
var z = zr * zstep + zshift;
var color = 200-200/(zmax+zshift) * z;
var color2 = color/2;
ctx.strokeStyle = rgb(color2,color2,color2)
var posx = sin(z+date/1700) * 70;
var posy = cos(z+date/1100) * 70;
var ringf = []
for (var r=0 ; r<ringsize*4 ; r+=4)
{
var column = r/4;
var t = column*tstep + M.PI + sin(date/3700); // includes roll
var multiplier = scale / z;
ringf[r] = posx + cos(t) * multiplier;
ringf[r+1] = posy + sin(t) * multiplier;
ringf[r+2] = posx + cos(t+tstep) * multiplier;
ringf[r+3] = posy + sin(t+tstep) * multiplier;
var textindex = (textscroll + zr) % (40);
var textcolor1 = text[textindex] ? text[textindex][column-textoffset] : 0;
var dark = color/4;
ctx.fillStyle= rgb(
+textcolor1 ? M.max(150 +~~(105*sin(date/100)), dark) : color2/4,
column % 16 == 0 && (zr + textscroll) % 12 ? 255 : dark,
dark);
if (ringb)
{
ctx.beginPath();
ctx.moveTo(ringf[r], ringf[r+1]);
ctx.lineTo(ringf[r+2], ringf[r+3]);
ctx.lineTo(ringb[r+2], ringb[r+3]);
ctx.lineTo(ringb[r], ringb[r+1]);
ctx.fill();
ctx.stroke();
}
}
ringb = ringf;
}
}, 50);