-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshim.html
122 lines (116 loc) · 7.09 KB
/
shim.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!doctype html>
<html>
<!--
(c) © js1k.com, 2010 - 2019
Note: submissions belong to their respective owner, do not copy without their consent
-->
<head>
<title>JS1k 2019 - Demo XXXX - "SUPERDISCO"</title>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content=" connect-src 'none' ; default-src 'none' ; font-src 'self' ; frame-src 'self' data: ; worker-src 'self' data: ; img-src 'self' data: ssl.google-analytics.com ; media-src data: ; object-src data: ; style-src 'self' data: 'unsafe-inline' ; script-src 'unsafe-inline' 'unsafe-eval' www.google-analytics.com ; " help="please report csp-related problems to valid demos!" >
<meta name="author" content="Alfons Nilsson">
<meta name="description" content="JS1k 2019 demo: "1k Pool game" -- Aim with the mouse and press and release to fire. Try to get all the blue balls into the black holes.">
<meta name="pubdate" content="20190325">
<link rel="icon" type="image/png" href="https://js1k.com/favicon.png">
<link rel="canonical" href="https://js1k.com/2019-x/demo/4193">
<link rel="alternate" type="application/rss+xml" title="New demo feed" href="https://js1k.com/feed.xml">
<link rel="shortlink" href="https://js1k.com/4193">
<script>
setTimeout(function(){
var ga = document.createElement('script');
ga.async = true;
ga.defer = true;
ga.src = 'https://www.google-analytics.com/ga.js';
ga.onload = function(){try{_gat._getTracker('UA-19882353-1')._trackPageview();}catch(e){window.console&&console.log("ga fail :'( ");};};
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
}, 10);
</script>
<style>
/* https://qfox.nl/notes/333 */
body,html,iframe{margin:0;padding:0;border:0;width:100%;height:100%}iframe{position:absolute;top:0;left:0;
padding-top:50px;box-sizing:border-box} header{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}
</style>
</head>
<body>
<header>
<div>
<h1>
<a href="https://js1k.com">JS1k</a>
<a href="https://js1k.com/2019-x">2019</a>
<strong></strong> demo
—
"SUPERDISCO"
</h1>
<p>
<em>
Description goes here.
</em>
</p>
<aside>
—
1024 bytes
—
<!-- -->
<a href="">demo details</a>
—
<a href="">list of demos</a>
<!--
<b><a href="https://js1k.com/2019-x/demo/">
Update available here!
</a></b>
<!-- -->
—
<a href="" title="short link for your mobile devices" rel="nofollow">js1k.com/XXXX</a>
</aside>
</div>
<a href="" class="button p">↞</a>
<a href="" class="button n">↠</a>
</header>
<script type="demo">
// Paste demo code here.
</script>
<script>
(function(){var m=document,b=m.getElementsByTagName("header")[0],h=b.firstChild,n=m.getElementsByClassName("p")[0],f=m
.getElementsByClassName("n")[0];b.insertBefore(n,h);b.insertBefore(f,h);b.appendChild(m.getElementsByTagName("p")[0])}
)();(function reload(){function h(a){g.body.removeChild(k);d.parentElement.removeChild(d);t=c=d=k=null;reload(a)}var
B=T_CANVAS_SHIM=true,
N=T_WEBGL=true,
F=T_MAX_WIDTH=0,
P=T_MAX_HEIGHT=0,
U=T_LOCK_RATIO=false,
Q=T_CENTER_CANVAS=false,
V=T_RELOAD_ONORIENTATIONCHANGE=true,
g=document,t=g.getElementsByTagName("header")[0],k=g.createElement("iframe");g.body.appendChild(k);var a=k.contentWindow
,c=k.contentDocument;c.open();c.close();c.write('<!doctype html><html style="margin: 0; padding: 0; border: 0;'+(B?" w"+
"idth: 100%; height: 100%;":"")+'"><head><meta charset="utf-8"><body style="margin: 0; padding: 0; border: 0;'+(B?" wi"+
"dth: 100%; height: 100%;":"")+'">'+(B?'<canvas style="display: block;'+(Q?" margin: auto;":"")+'"></canvas>':"")+"");if
(B){var e=c.getElementsByTagName("canvas")[0],q=e.style;c.body.clientWidth;var l=Math.max(Math.min(F||innerWidth,
innerWidth),1),r=Math.max(Math.min(P||innerHeight-50,innerHeight-50),1);(l<F||r<P)&&U&&(l<F?r=l/F*P:l=r/P*F);q.width=(e.
width=l)+"px";q.height=(e.height=r)+"px"}V&&(onorientationchange=h);a.AudioContext=a.AudioContext||a.webkitAudioContext;
a.requestAnimationFrame=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.
msRequestAnimationFrame||function(b){a.setTimeout(b,1E3/30)};B&&(e.requestPointerLock=e.requestPointerLock||e.
mozRequestPointerLock||e.webkitRequestPointerLock);c.body.requestPointerLock=c.body.requestPointerLock||c.body.
mozRequestPointerLock||c.body.webkitRequestPointerLock;var nav=a.navigator;nav.getUserMedia=nav.getUserMedia||N.
webkitGetUserMedia||nav.mozGetUserMedia||nav.msGetUserMedia;a.OscillatorNode&&a.OscillatorNode.prototype&&(a
.OscillatorNode.prototype.start=a.OscillatorNode.prototype.start||a.OscillatorNode.prototype.noteOn,a.OscillatorNode.
prototype.stop=a.OscillatorNode.prototype.stop||a.OscillatorNode.prototype.noteOff);B&&(a.a=e);a.b=c.body;a.d=c;B&&(N||(
a.c=e.getContext("2d")),N&&(a.g=function(){a.onorientationchange=a.onresize=null;try{var b={antialias:!0,stencil:!0},d=e
.getContext("webgl",b)||e.getContext("experimental-webgl",b);a.__glExts="OES_texture_float OES_texture_float_linear OE"+
"S_standard_derivatives EXT_texture_filter_anisotropic MOZ_EXT_texture_filter_anisotropic WEBKIT_EXT_texture_filter_an"+
"isotropic WEBGL_compressed_texture_s3tc MOZ_WEBGL_compressed_texture_s3tc WEBKIT_WEBGL_compressed_texture_s3tc".split(
" ").map(function(a){return d.getExtension(a)})}catch(f){throw c.body.innerHTML="WebGL not supported.",a.a=a.b=a.c=a.d=
null,f;}return d}()));B=c.createElement("script");B.textContent=g.querySelector('script[type="demo"]').textContent;c.
body.appendChild(B);c.close();k.contentWindow.focus();B=g.getElementsByTagName("div")[0];window.reload=h;var d=g.
createElement("div");d.innerHTML="↻";d.className="button r";d.title="restart just the demo (local, without remot"+
"e fetch)";d.onclick=h;t.insertBefore(d,B)})();
</script>
</body>
</html>