Skip to content

Instantly share code, notes, and snippets.

@apkostka
Last active September 2, 2015 23:21
Show Gist options
  • Save apkostka/fd109837390acb396164 to your computer and use it in GitHub Desktop.
Save apkostka/fd109837390acb396164 to your computer and use it in GitHub Desktop.
Train Window

This is a train window.

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Train Window</title>
<style>
/* http://qfox.nl/notes/333 */
body,html,iframe{margin:0;padding:0;border:0;width:100%;height:100%}
iframe{position:absolute;top:0;left:0;box-sizing:border-box}
header{display:none;position:relative;z-index:1;height:47px;padding-top:2px;border-bottom:1px solid #000;box-shadow:0 -10px 25px #ccc inset;background-color:#eee}
aside,div,h1,p{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:center;font-size:16px;font-weight:inherit;line-height:22px;padding:0;margin:0;cursor:default}
aside,h1{display:inline}
a{color:#000;text-decoration:none;border-bottom:1px dashed #000}
a:hover{border-bottom:1px solid red}
a[href="0"]{text-decoration:line-through;pointer-events:none;border-bottom:0;color:#ccc}
.button{float:left;width:40px;height:40px;line-height:40px;text-align:center;padding:0;margin:2px 0 0 10px;border:1px solid #888;border-color:#ddd #888 #888 #ddd;font-family:sans-serif;font-size:30px;font-weight:700;cursor:pointer}
.button:hover{color:red;border-bottom-color:#888}
.r{margin-right:10px}
time{display:none}
</style>
</head>
<body>
<script type="demo">
for(_='[fB40@sBl$](k$ckjfor(``f=_0)+K6^iJa[wt]H0*Gf/1e4Fb[~~lE]+B[D/LZ30Y(7-i)/X0,Wo/2Vi*VWU--;)T]=S&&R);QMath.P),OPrandom()N*N,0%",e+2GN+"%)"],80"10*Psin(f*Pcos(fs[lekjMoNjWWM,o$ySC(r/l%1*E=u=a[cnokO[dwak"#eee",s[gbAS[i]w=s[caLikWWWoOr=M;0<(r-=s=u[gCtk"2d" i=-1;6>i++;) ,I-d*b-NZ *(1-F="hsl("+[200function(l){Ow[aCok1e4;fTc[tnakWo+IOc[slk1,-1)Q)d=o/8G(5K5*20K1G@0)O,oWh1,mO)t=WA=`f in l)selfB[0]+f[3D6]D16]]Sf},A(aOA(cOC=return E]-]++1]},setInterval(if(!t)`e=5+@n=.6h+l"5e*=4,m+1 {_bBSN;`M=H+@G(C=i*i/(J?8:2)OL=8GX(o=a[hg]Og=N,pu[hgSu[wtS6W OA(120)Wm1,hO!iRw,f=Y0;fT`r=Y;f/9<rTjY+r))OY+rO.9,.9Q`a ),f=,80>eRNQ_g*bOsp,Y*N*o/b-2GV,F*V-VWV+N*VON*V)/4Qif(i){`u[wtSM,I=V+UJ||(I=.2ZYKg/2<NRJRsp,r-NZ *3-3Z,6Z,YZQ_n>.5Rl=Z,NQ`M,5r QWoO$kOs[gbCpS"source-atop",n,l,OX9}}` ca,-t*C,0OI=V-Un<.5Rb>.8Ri%2R(,ca,W2*UH,I,WI,H,IOQcBlckH*@-H*++t/1WWH,oOt%=@0},16)';g=/[-N-ZD-HJK_`jk$@B]/.exec(_);)with(_.split(g))_=join(shift());eval(_)
</script>
<script>
(function reload(fullscreen) {
var doc = document;
var header = doc.getElementsByTagName("header")[0];
var iframe = doc.createElement("iframe");
doc.body.appendChild(iframe);
var iwin = iframe.contentWindow;
var idoc = iframe.contentDocument;
idoc.open();
idoc.close();
idoc.write("<!doctype html>" + '<html style="margin: 0; padding: 0; border: 0;' + (true ? ' width: 100%; height: 100%;' : '') + '">' + "<head>" + '<meta charset="utf-8">' + '<body style="margin: 0; padding: 0; border: 0;' + (true ? ' width: 100%; height: 100%;' : '') + '">' + (true ? '<canvas style="display: block;' +
(false ? " margin: auto;" : "") + '"></canvas>' : "") + "");
if (true) {
var canvas = idoc.getElementsByTagName("canvas")[0];
var cs = canvas.style;
idoc.body.clientWidth;
cs.width = (canvas.width = Math.max(Math.min(0 || innerWidth, innerWidth), 0) || 0) + "px";
cs.height = (canvas.height = Math.max(Math.min(0 || innerHeight, innerHeight), 0) || 0) + "px"
}
iwin.AudioContext = iwin.AudioContext ||
iwin.webkitAudioContext;
iwin.requestAnimationFrame = iwin.requestAnimationFrame || iwin.mozRequestAnimationFrame || iwin.webkitRequestAnimationFrame || iwin.msRequestAnimationFrame || function(f) {
iwin.setTimeout(f, 1E3 / 30)
};
if (true) canvas.requestPointerLock = canvas.requestPointerLock || canvas.mozRequestPointerLock || canvas.webkitRequestPointerLock;
idoc.body.requestPointerLock = idoc.body.requestPointerLock || idoc.body.mozRequestPointerLock || idoc.body.webkitRequestPointerLock;
navigator.getUserMedia = navigator.getUserMedia ||
navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
if (true) iwin.a = canvas;
iwin.b = idoc.body;
if (true) {
if (!false) iwin.c = canvas.getContext("2d");
if (false) iwin.g = function() {
iwin.onorientationchange = iwin.onresize = null;
try {
var o = {
antialias: true,
stencil: true
};
var gl = canvas.getContext("webgl", o) || canvas.getContext("experimental-webgl", o);
iwin.__glExts = ["OES_texture_float", "OES_texture_float_linear", "OES_standard_derivatives", "EXT_texture_filter_anisotropic",
"MOZ_EXT_texture_filter_anisotropic", "WEBKIT_EXT_texture_filter_anisotropic", "WEBGL_compressed_texture_s3tc", "MOZ_WEBGL_compressed_texture_s3tc", "WEBKIT_WEBGL_compressed_texture_s3tc"
].map(function(ext) {
return gl.getExtension(ext)
})
} catch (e) {
idoc.body.innerHTML = "WebGL not supported.";
iwin.a = iwin.b = iwin.c = iwin.d = null;
throw e;
}
return gl
}()
}
var demo = idoc.createElement("script");
demo.textContent = doc.querySelector('script[type="demo"]').textContent;
idoc.body.appendChild(demo);
idoc.close();
iframe.contentWindow.focus();
var firstLine = doc.getElementsByTagName("div")[0];
})();
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment