-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
118 lines (108 loc) · 3.33 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
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
<html>
<head>
<title>Conway's Game of Life</title>
<script type="text/javascript" src="jquery.js"></script>
<style>
body {
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
font-family: helvetica;
}
#gContainer {
position: relative;
display: inline-block;
margin-right: 1px;
padding: 5px;
padding-bottom: 10px;
border: 1px solid #888;
box-shadow: 0 0 2px 2px #ccc;
}
#container {
line-height: 69%;
display: inline-block;
padding: 1px 0;
padding-right: 1px;
margin: 0 auto;
border: 1px dashed #444;
}
#cell {
width: 19px;
height: 19px;
border: 1px solid #000;
float: left;
margin:0;
margin-left: 1px;
}
div.true {
background-color: #000;
}
div.false {
background-color: #fff;
}
hr {
background-color: #555;
width: 70%;
}
#resizeButton img {
width: 20px;
float: right;
margin-right: 10px;
margin-top: 10px;
}
#resizePanel {
position: absolute;
background-color: #fff;
right: 5px;
top: 5px;
width: 150px;
height: 80px;
border: 1px solid black;
box-shadow: 0 4px 2px 4px rgba(0, 0, 0, 0.1);
}
#resizePanel input {
display: inline-block;
margin-left: auto;
margin-right: auto;
}
#memoryAmount {
display: inline-block;
width: 100px;
margin-top: 3px;
float: right;
}
</style>
</head>
<body>
<center>
<div id="gContainer">
<a id="resizeButton"><img src="img/resize.png"></a>
<div id="resizePanel">
<center style="margin: 10px 0">
<input type="text" id="widthField" size="2">
<input type="text" id="heightField" size="2">
</center>
<center>
<input type="button" value="set" onclick="setGridDimensions()">
</center>
</div>
<center>
<h1>Conway's Game of Life</h1>
<hr noshade>
</center>
<div id="container">
</div>
<center style="margin-top: 5px">
<input type="button" id="randomStartButton" value="random start" onclick="grid.randomStart(rsPercent)">
<input type="button" id="advanceButton" value="advance" onclick="grid.advance()">
<input type="button" id="playButton" value="play" onclick="play()">
<input type="button" id="stopButton" value="stop" onclick="stop()">
<input type="button" id="clearButton" value="clear" onclick="grid.clear(); stop()">
<div id="memoryAmount">4096 bytes</div>
</center>
</div>
</center>
<script type="text/javascript" src="conway.js"></script>
</body>
</html>