-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
78 lines (71 loc) · 1.89 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title> WebGL - Game of Life </title>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript" src="main.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)
},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-41676236-2', 'auto');
ga('send', 'pageview');
</script>
</head>
<style>
* {
margin: 0;
padding: 0;
}
body {
height: 100%;
width: 100%;
}
.game-of-life-container {
position: relative;
}
#game-of-life {
display: block;
margin: 0 auto;
cursor: crosshair;
}
.control-bar {
text-align: center;
margin: 0 auto;
}
.footer {
margin: 0 auto;
padding: 50px 0;
text-align: center;
}
</style>
<body>
<div class="game-of-life-container">
<canvas id="game-of-life" width="1024" height="512">
Your browser doesn't support WebGL
</canvas>
<div id="fps" style="text-align: center">FPS</div>
</div>
<!--
<div class="control-bar">
<button onclick="width *= 2; height *= 2;"> Zoom in</button>
<button onclick="width /= 2; height /= 2;"> Zoom out</button>
</div>
-->
<div class="footer">
<p> Conway's Game of Life in WebGL</p>
<p> Copyright © 2014 <a href="http://mingplusplus.com">Zhiming Guo</a> </p>
</div>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/gl-matrix/2.1.0/gl-matrix-min.js"> </script>
<script>
//gameOfLife();
life = new GameOfLife(1024, 512,
document.getElementById("game-of-life"));
life.run();
life.fpsElement = document.getElementById("fps");
</script>
</body>
</html>