-
Notifications
You must be signed in to change notification settings - Fork 0
/
demojs_shim.html
46 lines (40 loc) · 1.33 KB
/
demojs_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
<!doctype html>
<html>
<head>
<title>DemoJS submission template</title>
<meta charset="utf-8" />
</head>
<body>
<canvas id="c"></canvas>
<script>
var a = document.body;
var b = document.getElementsByTagName('canvas')[0];
function getContext(s) {
try {
return b.getContext(s);
} catch(e) {
return null;
}
}
function c() {
return getContext('2d');
}
function d() {
return getContext('webgl') || getContext('experimental-webgl') || getContext('webkit-3d') || getContext('moz-webgl');
}
document.body.clientWidth; // fix bug in webkit: http://qfox.nl/weblog/218
</script>
<script>
// insert your entry here
// RULES (thx to @kuvos for inspiration)
// 1. Submissions may be up to 1k (1024 bytes). Fill those damn bytes.
// 2. Submissions must consist of only js.
// 3. Any and all externals are strictly forbidden.
// 4. Must work on Mozilla Firefox 4 and Google Chrome 12 (more support appreciated of course :)
// 5. It should look roughly similar under both browsers.
// 6. As you might have seen, you get canvas object and context creation for FREE!
// 7. Your demo must work in this shim, tell us if there are problems with context creation.
// 8. GO MAD, audio, eval and WebGL allowed!
</script>
</body>
</html>