forked from paper/processing-snake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnake.html
35 lines (33 loc) · 1.01 KB
/
snake.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
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Snake</title>
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="icon" type="image/png" href="images/favicon.png" />
<style>
html,body{overflow:hidden; background:#000;}
canvas{
position:absolute;
left:50%;
top:50%;
transform:translate(-50%, -50%);
-moz-transform:translate(-50%, -50%);
-webkit-transform:translate(-50%, -50%);
-ms-transform:translate(-50%, -50%);
-o-transform:translate(-50%, -50%);
outline:none;
}
</style>
<!--<script src="https://raw.githubusercontent.com/processing-js/processing-js/v1.4.8/processing.min.js"></script>-->
<script src="processing.min.js"></script>
</head>
<body>
<canvas id="J-canvas" tabindex="-1" data-processing-sources="snake/snake.pde"></canvas>
<script>
var canvas = document.getElementById("J-canvas");
canvas.focus();
document.documentElement.onclick = function(){ canvas.focus(); }
</script>
</body>
</html>