-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
101 lines (98 loc) · 4.46 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="src/css/main.css">
<!-- JavaScript execution -->
<!-- <script src="src/main.js" type="module"></script> -->
<!-- TypeScript execution -->
<script id="mainScript" src="dist/main.js" type="module"></script>
<title>Conway's Game of Life</title>
</head>
<body>
<h1>Conway's Game of Life</h1>
<div class="panels">
<div class="buttonControls panel">
<h2>Controls</h2>
<div class="allButtons">
<div class="buttonsGroup" id="testButtons">
<div class="shapesGroup">
<h4>Test Buttons</h4>
<button class="buttonClass" id="canvasTest">Canvas Test</button>
<button class="buttonClass" id="clearButton">Clear</button>
</div>
<div class="shapesGroup" id="otherButtons">
<h4>Game Buttons</h4>
<div class="buttonRow row0">
<button class="buttonClass" id="savePosition">Save Position</button>
<button class="buttonClass" id="restorePosition">Restore Position</button>
<button class="buttonClass" id="nextGeneration">Next Generation</button>
</div>
<div class="buttonRow">
<button class="buttonClass" id="playAndStop">Play</button>
</div>
</div>
<div class="shapesGroup" id="otherOtherButtons">
<h4>Debug Info Buttons</h4>
<button class="buttonClass" id="savedLiveCells">Live Cells (Saved)</button>
<button class="buttonClass" id="currentLiveCells">Live Cells (Current)</button>
</div>
</div> <!-- class="buttonsGroup" id="testButtons" -->
<div class="buttonsGroup" id="defaultShapes">
<div class="shapesGroup">
<h4>Still Shapes</h4>
<div class="buttonRow row0">
<button class="buttonClass" id="shapeBlock">Block</button>
<button class="buttonClass" id="shapeBeehive">Beehive</button>
<button class="buttonClass" id="shapeLoaf">Loaf</button>
</div>
<div class="buttonRow row1">
<button class="buttonClass" id="shapeBoat">Boat</button>
<button class="buttonClass" id="shapeTub">Tub</button>
<button class="buttonClass" id="shapeCustomTest">Custom Test Board</button>
</div>
</div>
<div class="shapesGroup">
<h4>Oscillators</h4>
<button class="buttonClass" id="shapeBlinker">Blinker</button>
<button class="buttonClass" id="shapeToad">Toad</button>
<button class="buttonClass" id="shapeBeacon">Beacon</button>
<button class="buttonClass" id="shapePulsar">Pulsar</button>
<button class="buttonClass" id="shapePenta-decathlon">Penta-decathlon</button>
</div>
<div class="shapesGroup">
<h4>Spaceships</h4>
<div class="buttonRow row0">
<button class="buttonClass" id="shapeGlider">Glider</button>
<button class="buttonClass" id="shapeLWSS">Light-weight spaceship</button>
</div>
<div class="buttonRow row1">
<button class="buttonClass" id="shapeMWSS">Middle-weight spaceship</button>
<button class="buttonClass" id="shapeHWSS">Heavy-weight spaceship</button>
</div>
</div>
</div>
</div> <!-- class="allButtons" -->
</div> <!-- class="buttonControls panel" -->
<div class="rules panel">
<h2>Conway's Game of Life Rules</h2>
<div class="rulesGroup">
<p>Source: <a href="https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life" target="_blank">Wikipedia</a></p>
<ol>
<li>Any live cell with fewer than two live neighbors dies, as if by underpopulation.</li>
<li>Any live cell with two or three live neighbors lives on to the next generation.</li>
<li>Any live cell with more than three live neighbors dies, as if by overpopulation.</li>
<li>Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.</li>
</ol>
</div>
</div> <!-- class="rules panel" -->
</div> <!-- class="panels" -->
<div class="canvasPanel">
<center>
<h2 id="generationCounter">Generation: 0</h2>
<canvas id="CGoL_Board" width="1200" height="800"></canvas>
</center>
</div>
</body>
</html>