-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
163 lines (146 loc) · 4.04 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html>
<head>
<title>Game Of Life</title>
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="bootstrap.min.css">
<script type="text/javascript" src="mechanics.js"></script>
<style type="text/css">
.cell{
cursor: pointer;
cursor: hand;
border: 1px solid black;
}
.live{
background-color: grey;
}
.centerBlock {
display: table;
margin: auto;
}
.cell_grid {
border: 3px solid black;
table-layout: fixed;
width: 55vw;
height: 90vh;
margin-top: 5vh;
}
h1, h3, h4{
color: #F5F5F5;
}
body {
color: #E8E8E8;
}
.left_panel {
background-color: #606060;
height: 100vh;
}
@media (max-width: 770px) {
.left_panel{
background-color: #606060;
height: inherit !important;
padding-top: 10px;
padding-bottom: 20px;
}
.cell_grid {
width: 80vw;
height: 90vh;
margin-top: 5vh;
}
}
.bannerimg {
top: 0;
right: 0;
}
@media (max-width: 1024px) {
.bannerimg {
transform: scale(0.8, 0.8);
right: -15px;
top: -15px;
}
}
@media (max-width: 425px) {
.cell_grid{
width: 90vw;
height: 70vh;
}
.width_group {
margin-top: 5px;
}
}
@media (max-width: 425px) {
.cell_grid{
width: 90vw;
height: 60vh;
}
}
</style>
</head>
<body onload="init()">
<a href="https://github.com/kejriwalrahul/GameOfLife"><img class="bannerimg" style="position: absolute; border: 0; z-index: 5;" src="https://camo.githubusercontent.com/652c5b9acfaddf3a9c326fa6bde407b87f7be0f4/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"></a>
<div class="col-md-4 left_panel">
<div>
<h3 style="margin-bottom: 0">Welcome to</h3>
<h1 style="margin-top: 0">Conway's Game Of Life</h1>
<hr>
<div class="container col-md-12">
<div class="row">
<h4>1. Instructions:</h4>
<ul>
<li> Modify grid size using controls below and hit 'Update'.</li>
<li> Click on cells to toggle alive (grey) or dead (white) state.</li>
<li> Use 'Next' to step 1 time unit in the future or hit 'Play' to cycle through 'Speed' number of iterations per second.</li>
<li> Hit 'Stop' to terminate playing.
</ul>
</div>
<div class="row">
<h4>2. Grid Configuration:</h4>
<div class="col-md-6 col-sm-4">
<div class="input-group">
<span class="input-group-addon">Height </span>
<input class="form-control" type="number" name="x" id="x">
</div>
</div>
<div class="col-md-6 col-sm-4">
<div class="input-group width_group">
<span class="input-group-addon">Width</span>
<input class="form-control" type="number" name="y" id="y">
</div>
</div>
</div>
<div class="row" style="margin-top: 10px">
<div class="col-md-8 col-sm-8">
<button class="btn btn-default" onclick="generate()" style="margin-right: 10px">Update</button>
<button class="btn btn-default" onclick="randomize()">Random State</button>
</div>
</div>
<div class="row" style="margin-top: 15px;">
<h4>3. Speed Controls:</h4>
<div class="col-md-12 col-sm-8">
<div class="input-group">
<span class="input-group-addon">Speed (iters/sec)</span>
<input class="form-control" type="number" id="playspeed">
</div>
</div>
</div>
<div class="row" style="margin-top: 10px;">
<div class="col-md-8 col-sm-8">
<button class="btn btn-default" onclick="updateState()" style="width: 60px; margin-right: 10px;">Next</button>
<button id="play_toggle" class="btn btn-default" onclick="play_toggle()">Play</button>
</div>
</div>
</div>
</div>
<!--
<div style="height: 5vh">
<hr>
<h4> Rahul Kejriwal </h4>
</div>
-->
</div>
<div class="col-md-8">
<div id="container" class="centerBlock">
</div>
</div>
</body>
</html>