-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
231 lines (210 loc) · 5.4 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Game of Life</title>
</head>
<style>
/* From http://brennaobrien.com/blog/2014/05/style-input-type-range-in-every-browser.html */
/* Webkit */
input[type=range]{
-webkit-appearance: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 300px;
height: 5px;
background: #ddd;
border: none;
border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: goldenrod;
margin-top: -4px;
}
input[type=range]:focus {
outline: none;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #ccc;
}
/* Firefox */
input[type=range]{
/* fix for FF unable to apply focus style bug */
border: 1px solid white;
/*required for proper track sizing in FF*/
width: 300px;
}
input[type=range]::-moz-range-track {
width: 300px;
height: 5px;
background: #ddd;
border: none;
border-radius: 3px;
}
input[type=range]::-moz-range-thumb {
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: goldenrod;
}
/*hide the outline behind the border*/
input[type=range]:-moz-focusring{
outline: 1px solid white;
outline-offset: -1px;
}
input[type=range]:focus::-moz-range-track {
background: #ccc;
}
/* IE 10+ */
input[type=range]::-ms-track {
width: 300px;
height: 5px;
/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
background: transparent;
/*leave room for the larger thumb to overflow with a transparent border */
border-color: transparent;
border-width: 6px 0;
/*remove default tick marks*/
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #777;
border-radius: 10px;
}
input[type=range]::-ms-fill-upper {
background: #ddd;
border-radius: 10px;
}
input[type=range]::-ms-thumb {
border: none;
height: 16px;
width: 16px;
border-radius: 50%;
background: goldenrod;
}
input[type=range]:focus::-ms-fill-lower {
background: #888;
}
input[type=range]:focus::-ms-fill-upper {
background: #ccc;
}
</style>
<style>
html, body {
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
border: 0px;
overflow: hidden;
background-color: #FFFFFF;
}
#life {
position: relative;
padding-left: 0;
padding-right: 0;
margin-left: auto;
margin-right: auto;
display: block;
height: 100%;
width: 100%;
}
#life-grid {
height: 100%;
width: 100%;
position: absolute;
display: block;
z-index: 2;
}
#life-board {
height: 100%;
width: 100%;
position: absolute;
display: block;
z-index: 1;
}
.ui-show-translucent {
opacity: 0.8;
display: block;
position: absolute;
height: 10%;
width: 100%;
bottom: 0px;
z-index: 3;
background: #FFFFFF;
}
.ui-hide {
opacity: 0;
display: block;
position: absolute;
height: 10%;
width: 100%;
bottom: 0px;
z-index: 3;
background: #BBBBBB;
}
#life-ui {
display: flex;
justify-content: space-between;
}
#stats {
display: flex;
align-items: center;
}
#instructions {
text-align: justify;
font-family: arial;
font-size: 16px;
font-size: 1.2vw;
}
</style>
<body>
<script src="./js/target/scala-2.11/life-jsdeps.js"></script>
<script type="text/javascript" src="./js/target/scala-2.11/life-opt.js"></script>
<script type="text/javascript" src="./stats.js"></script>
<div id="life">
<canvas id="life-board"></canvas>
<canvas id="life-grid"></canvas>
<div id="life-ui" class="ui-show-translucent">
<div id="x" style="display: flex; align-items: center; justify-content: center; width: 30%">
<p>2</p>
<input type="range" id="size" value="100" min="2" max="300" step="1"><br>
<p>300</p>
<p>(Size)</p>
</div>
<div id="y" style="display: flex; align-items: center; justify-content: center; width: 30%">
<p>1</p>
<input type="range" id="fpsLimit" value="1" min="1" max="61" step="1">
<p>60(Max FPS)</p>
</div>
<div id="instructions">
<div>
p play/pause
</div>
<div class="line">
n new board
</div>
<div class="line">
z/x decrease/increase framerate
</div>
<div class="line">
</> decrease/increase board size
</div>
</div>
<div id="stats">
<div id="total"></div>
<div id="step"></div>
</div>
</div>
</div>
<script type="text/javascript">
life.GameOfLifeJS().main();
</script>
</body>
</html>