-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
122 lines (108 loc) · 2.64 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Game of Life</title>
<style>
body {
font-family: "Courier New", Courier, monospace;
text-align: center;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
h2 {
margin-top: 20px;
}
canvas {
border: none;
display: block;
width: 100%;
height: auto;
}
.controls {
position: fixed;
width: 100%;
bottom: 32px;
z-index: 9999;
}
.panel {
width: 80%;
margin: 0 auto;
padding: 20px 40px;
background-color: white;
border-radius: 64px;
display: flex;
align-items: center;
justify-content: space-between;
box-shadow: 0px 0px 16px 8px rgba(192, 192, 192, 0.5);
}
.slider-container {
width: 100%;
max-width: 320px;
}
.slider {
width: 100%;
accent-color: #00a6ed;
}
.slider:hover,
.slider:focus,
.slider:focus-visible {
accent-color: #30acdc;
}
.btn-container {
display: flex;
align-items: center;
gap: 12px;
}
input[type="button"] {
padding: 12px 16px;
border: none;
border-radius: 16px;
font-family: "Courier New", Courier, monospace;
font-size: 16px;
cursor: pointer;
}
</style>
</head>
<body>
<canvas></canvas>
<div class="controls">
<div class="panel">
<div class="slider-container">
<label for="speed-slider">Animation speed (1-60 FPS):</label>
<input
type="range"
id="speed-slider"
min="1"
max="60"
value="60"
class="slider"
/>
</div>
<div class="slider-container">
<label for="density-slider">Population Density (0-100%)</label>
<input
type="range"
id="density-slider"
min="0"
max="100"
value="50"
class="slider"
/>
</div>
<div class="btn-container">
<input type="button" value="▶️ Start" onclick="startGameLoop()" />
<input type="button" value="⏹️ Stop" onclick="pauseGameLoop()" />
<input
type="button"
value="🔃 Reset Simulation"
onclick="resetGameLoop()"
/>
</div>
</div>
</div>
<script src="game.js"></script>
</body>
</html>