This repository was archived by the owner on Jul 1, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
341 lines (311 loc) · 12.7 KB
/
Copy pathindex.html
File metadata and controls
341 lines (311 loc) · 12.7 KB
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0" />
<title>Organism Simulation Game</title>
<!-- Mobile optimization meta tags -->
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="format-detection" content="telephone=no" />
<!-- PWA Meta Tags -->
<meta name="theme-color" content="#2196F3" />
<meta name="description" content="Interactive organism simulation game with real-time population dynamics" />
<link rel="manifest" href="/manifest.json" />
<link rel="apple-touch-icon" href="/icons/icon-192x192.png" />
<!-- Preload critical resources -->
<link rel="preload" href="/src/main.ts" as="script" type="module" />
<style>
/* Basic reset and test styles */
* { box-sizing: border-box; }
body {
margin: 0;
padding: 20px;
font-family: Arial, sans-serif;
background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
color: white;
min-height: 100vh;
/* Prevent mobile bounce scrolling */
overscroll-behavior: none;
/* Improve touch responsiveness */
touch-action: manipulation;
/* Prevent text selection on mobile */
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#app {
max-width: 1200px;
margin: 0 auto;
text-align: center;
}
h1 {
font-size: 2.5em;
margin: 0;
background: linear-gradient(45deg, #4CAF50, #2196F3);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
/* Mobile-specific improvements */
@media (max-width: 768px) {
body {
padding: 10px;
/* Fix iOS Safari viewport issues */
min-height: -webkit-fill-available;
}
/* Prevent zoom on input focus for iOS */
input, select, textarea {
font-size: 16px !important;
}
}
/* Accessibility improvements */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
/* Improve focus visibility */
button:focus,
input:focus,
select:focus,
canvas:focus {
outline: 2px solid #4CAF50;
outline-offset: 2px;
}
/* High contrast improvements */
@media (prefers-contrast: high) {
h1 {
-webkit-text-fill-color: white;
color: white;
}
}
/* Fieldset styling for controls */
fieldset.controls {
border: none;
padding: 0;
margin: 0;
}
fieldset.controls legend {
padding: 0;
}
</style>
</head>
<body>
<div id="app">
<header role="banner">
<h1>Organism Simulation Game</h1>
<p>Click on the canvas to place organisms, then watch how they multiply and divide over time</p>
</header>
<main role="main">
<section aria-labelledby="controls-heading">
<h2 id="controls-heading" class="sr-only">Simulation Controls</h2>
<fieldset class="controls">
<legend class="sr-only">Game Control Settings</legend>
<div class="control-group">
<label for="organism-select">Select Organism:</label>
<select id="organism-select" aria-label="Choose organism type for simulation">
<option value="bacteria">🦠 Bacteria (Fast growth)</option>
<option value="yeast">🍄 Yeast (Medium growth)</option>
<option value="algae">🌱 Algae (Slow growth)</option>
<option value="virus">🦠 Virus (Very fast growth)</option>
</select>
</div>
<div class="control-group">
<label for="speed-slider">Simulation Speed:</label>
<input type="range" id="speed-slider" min="1" max="10" value="5">
<span id="speed-value">5x</span>
</div>
<div class="control-group">
<label for="population-limit">Max Population:</label>
<input type="range" id="population-limit" min="100" max="2000" value="1000">
<span id="population-limit-value">1000</span>
</div>
<div class="control-group button-group">
<button id="start-btn" title="Start Simulation" aria-label="Start the simulation">
<span aria-hidden="true">▶️</span>
<span class="sr-only">Start</span>
</button>
<button id="pause-btn" title="Pause Simulation" aria-label="Pause the simulation">
<span aria-hidden="true">⏸️</span>
<span class="sr-only">Pause</span>
</button>
<button id="reset-btn" title="Reset Simulation" aria-label="Reset the simulation">
<span aria-hidden="true">🔄</span>
<span class="sr-only">Reset</span>
</button>
<button id="clear-btn" title="Clear Canvas" aria-label="Clear the canvas">
<span aria-hidden="true">🗑️</span>
<span class="sr-only">Clear</span>
</button>
</div> </fieldset>
</section>
<section aria-labelledby="stats-heading">
<h2 id="stats-heading" class="sr-only">Game Statistics</h2>
<div class="game-info">
<div class="stats" id="stats-panel">
<div class="stat-item">
<span>Population: </span>
<span id="population-count">0</span>
</div>
<div class="stat-item">
<span>Generation: </span>
<span id="generation-count">0</span>
</div>
<div class="stat-item">
<span>Time: </span>
<span id="time-elapsed">0s</span>
</div>
<div class="stat-item">
<span>Births/sec: </span>
<span id="birth-rate">0</span>
</div>
<div class="stat-item">
<span>Deaths/sec: </span>
<span id="death-rate">0</span>
</div>
<div class="stat-item">
<span>Avg Age: </span>
<span id="avg-age">0</span>
</div>
<div class="stat-item">
<span>Oldest: </span>
<span id="oldest-organism">0</span>
</div>
<div class="stat-item">
<span>Density: </span>
<span id="population-density">0</span>
</div>
<div class="stat-item">
<span>Stability: </span>
<span id="population-stability">N/A</span>
</div>
</div>
<div class="game-stats">
<div class="stat-item score">
<span>Score: </span>
<span id="score">0</span>
</div>
<div class="stat-item achievements">
<span>Achievements: </span>
<span id="achievement-count">0/7</span>
</div>
<div class="stat-item high-score">
<span>High Score: </span>
<span id="high-score">0</span>
</div>
</div>
</div>
<div class="game-panels">
<div class="panel achievements-panel">
<h3>🏆 Achievements</h3>
<div id="achievements-list" class="achievements-list"></div>
</div>
<div class="panel challenges-panel">
<h3>🎯 Challenges</h3>
<div id="current-challenge" class="current-challenge">
<p>No active challenge</p>
<button id="start-challenge-btn">Start Challenge</button>
</div>
<div id="challenge-progress" class="challenge-progress hidden"></div>
</div>
<div class="panel powerups-panel">
<h3>⚡ Power-ups</h3>
<div id="powerups-list" class="powerups-list">
<div class="powerup-item">
<span class="powerup-name">Growth Boost</span>
<span class="powerup-cost">Cost: 500</span>
<button id="buy-growth-boost" class="buy-powerup" data-powerup="growth">Buy</button>
</div>
<div class="powerup-item">
<span class="powerup-name">Longevity</span>
<span class="powerup-cost">Cost: 300</span>
<button id="buy-longevity" class="buy-powerup" data-powerup="longevity">Buy</button>
</div>
<div class="powerup-item">
<span class="powerup-name">Population Boom</span>
<span class="powerup-cost">Cost: 800</span>
<button id="buy-population-boom" class="buy-powerup" data-powerup="population">Buy</button>
</div>
</div>
</div>
<div class="panel leaderboard-panel">
<h3>🏅 Leaderboard</h3>
<div id="leaderboard-list" class="leaderboard-list"></div>
</div>
</section>
<section aria-labelledby="canvas-heading">
<h2 id="canvas-heading" class="sr-only">Simulation Canvas</h2>
<canvas id="simulation-canvas" width="800" height="500"
aria-label="Interactive organism simulation canvas. Click to place organisms and watch them multiply over time. Use arrow keys for navigation."
tabindex="0"></canvas>
</section>
</main>
<!-- Mobile Features Test Section -->
<aside aria-labelledby="mobile-test-heading">
<h2 id="mobile-test-heading" class="sr-only">Mobile Features Testing</h2>
<div id="mobile-test-section" class="mobile-test-panel" style="margin-top: 20px; padding: 15px; background: rgba(0,0,0,0.3); border-radius: 10px; display: none;">
<h3>📱 Mobile Features Test</h3>
<div id="mobile-status" class="mobile-status">
<div>Device Type: <span id="device-type">Unknown</span></div>
<div>Touch Support: <span id="touch-support">Unknown</span></div>
<div>Screen Size: <span id="screen-size">Unknown</span></div>
</div>
<div class="mobile-features-grid" style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 15px;">
<div class="feature-test">
<h4>🎮 Advanced Gestures</h4>
<div id="gesture-status">Not initialized</div>
<div id="last-gesture" style="font-size: 0.8em; color: #aaa;">Last: None</div>
</div>
<div class="feature-test">
<h4>✨ Visual Effects</h4>
<div id="effects-status">Not initialized</div>
<button id="test-effect-btn">Test Effect</button>
</div>
<div class="feature-test">
<h4>📱 PWA Features</h4>
<div id="pwa-status">Not initialized</div>
<button id="install-btn" style="display: none;">Install App</button>
</div>
<div class="feature-test">
<h4>📊 Analytics</h4>
<div id="analytics-status">Not initialized</div>
<div id="session-info" style="font-size: 0.8em; color: #aaa;">Session: None</div>
</div>
<div class="feature-test">
<h4>📤 Social Sharing</h4>
<div id="social-status">Not initialized</div>
<button id="share-btn">Share Screenshot</button>
</div>
<div class="feature-test">
<h4>⚡ Performance</h4>
<div>FPS: <span id="fps-counter">--</span></div>
<div>Memory: <span id="memory-usage">--</span></div>
<div>Battery: <span id="battery-level">--</span></div>
</div>
</div>
<div class="gesture-instructions" style="margin-top: 15px; padding: 10px; background: rgba(255,255,255,0.1); border-radius: 5px; font-size: 0.9em;">
<strong>Try these gestures on mobile:</strong><br>
• Swipe fast (left/right) to change organism type<br>
• Swipe fast (up/down) to change speed<br>
• 3-finger tap for fullscreen<br>
• 4-finger tap to toggle UI<br>
• 5-finger tap to reset simulation<br>
• Edge swipes for panels<br>
• Force touch to place organisms
</div>
</div>
</aside>
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>