-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
443 lines (430 loc) · 13.6 KB
/
index.html
File metadata and controls
443 lines (430 loc) · 13.6 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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Emergence Engine v0.01</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
html, body { margin: 0; padding-top: 80px; background: #000; overflow: hidden; }
canvas { display: block; }
/* Optional: crisp monospace HUD */
@font-face { font-family: ui-mono; src: local("Consolas"), local("Menlo"), local("Monaco"); }
#header-container {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 40px;
background: rgba(0, 0, 0, 0.75);
border-bottom: 1px solid rgba(0, 255, 136, 0.3);
z-index: 1500;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 15px;
}
#header-title {
flex: 1;
}
#header-title h1 {
margin: 0;
font-family: ui-mono, monospace;
font-size: 16px;
font-weight: normal;
color: #00ff88;
text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}
#hud-container, #dashboard-container {
font-family: ui-mono, monospace;
font-size: 12px;
color: #00ff88;
background: rgba(0, 0, 0, 0.75);
padding: 10px;
}
#hud-container {
position: fixed;
top: 0px; /* Below header */
left: 0;
right: 0;
z-index: 1000;
}
#dashboard-container {
position: fixed;
top: 0px; /* Below header */
left: 0;
right: 0;
z-index: 1000;
max-height: 400px;
overflow-y: auto;
}
#hud-container.hidden, #dashboard-container.hidden {
display: none;
}
.hud-section {
margin-bottom: 6px;
}
.hud-line {
line-height: 14px;
white-space: pre;
}
#dashboard-container table {
width: 100%;
border-collapse: collapse;
font-size: 11px;
}
#dashboard-container th {
text-align: left;
padding: 2px 8px;
color: #d0ffd8;
border-bottom: 1px solid rgba(0, 255, 136, 0.3);
}
#dashboard-container td {
padding: 2px 8px;
color: #00ff88;
}
#hotkey-strip {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.85);
color: #00ff88;
font-family: ui-mono, monospace;
font-size: 11px;
padding: 8px 12px;
border-top: 1px solid rgba(0, 255, 136, 0.3);
z-index: 2000;
display: flex;
flex-wrap: wrap;
gap: 12px;
align-items: center;
backdrop-filter: blur(4px);
}
#hotkey-strip.hidden {
display: none;
}
.hotkey-item {
display: inline-flex;
align-items: center;
gap: 4px;
}
.hotkey-key {
background: rgba(0, 255, 136, 0.15);
border: 1px solid rgba(0, 255, 136, 0.4);
border-radius: 3px;
padding: 2px 6px;
font-weight: bold;
color: #4dffaa;
min-width: 20px;
text-align: center;
}
.hotkey-desc {
color: #88ffbb;
opacity: 0.9;
}
.hotkey-divider {
width: 1px;
height: 16px;
background: rgba(0, 255, 136, 0.2);
}
#top-links {
position: absolute;
top: 6px;
right: 10px;
display: flex;
gap: 8px;
align-items: center;
}
.link-button {
display: inline-flex;
align-items: center;
gap: 6px;
background: rgba(0, 0, 0, 0.85);
color: #00ff88;
font-family: ui-mono, monospace;
font-size: 11px;
padding: 6px 10px;
border: 1px solid rgba(0, 255, 136, 0.3);
border-radius: 4px;
text-decoration: none;
cursor: pointer;
backdrop-filter: blur(4px);
transition: background-color 0.2s;
}
.link-button:hover {
background: rgba(0, 255, 136, 0.1);
border-color: rgba(0, 255, 136, 0.6);
}
/* Quick Start Modal */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.8);
backdrop-filter: blur(4px);
z-index: 2000;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
}
.modal-overlay.hidden {
display: none;
}
.modal-content {
background: rgba(0, 0, 0, 0.95);
border: 1px solid rgba(0, 255, 136, 0.3);
border-radius: 8px;
max-width: 600px;
max-height: 80vh;
overflow-y: auto;
font-family: ui-mono, monospace;
color: #00ff88;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
border-bottom: 1px solid rgba(0, 255, 136, 0.2);
background: rgba(0, 0, 0, 0.9);
}
.modal-header h2 {
margin: 0;
font-size: 18px;
font-weight: normal;
color: #00ff88;
}
.close-btn {
background: none;
border: none;
color: #00ff88;
font-size: 24px;
cursor: pointer;
padding: 0;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
transition: background-color 0.2s;
}
.close-btn:hover {
background: rgba(0, 255, 136, 0.1);
}
.modal-body {
padding: 20px;
}
.quickstart-section {
margin-bottom: 20px;
}
.quickstart-section h3 {
margin: 0 0 10px 0;
font-size: 14px;
font-weight: normal;
color: #4dffaa;
text-transform: uppercase;
letter-spacing: 1px;
}
.quickstart-section p {
margin: 0 0 10px 0;
line-height: 1.5;
color: #88ffbb;
}
.interaction-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
margin-top: 10px;
}
.interaction-item {
background: rgba(0, 255, 136, 0.05);
border: 1px solid rgba(0, 255, 136, 0.2);
border-radius: 4px;
padding: 8px;
}
.interaction-key {
font-weight: bold;
color: #00ff88;
font-size: 12px;
margin-bottom: 4px;
}
.interaction-desc {
color: #88ffbb;
font-size: 11px;
line-height: 1.3;
}
.quickstart-section ul {
margin: 10px 0;
padding-left: 20px;
}
.quickstart-section li {
margin-bottom: 5px;
color: #88ffbb;
}
.quickstart-section strong {
color: #00ff88;
}
.quickstart-footer {
margin-top: 20px;
padding-top: 15px;
border-top: 1px solid rgba(0, 255, 136, 0.2);
text-align: center;
}
.quickstart-footer p {
font-size: 12px;
color: #66ffb3;
margin: 0;
}
.quickstart-footer a {
color: #00ff88;
text-decoration: none;
font-weight: bold;
}
.quickstart-footer a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<div id="header-container">
<div id="header-title">
<h1>Emergence Engine</h1>
</div>
<div id="top-links">
<button id="quickstart-btn" class="link-button">
<span>🚀</span>
<span>Quick Start</span>
</button>
<div class="hotkey-divider" style="width: 1px; height: 20px; background: rgba(0, 255, 136, 0.3);"></div>
<a href="https://github.com/DanPace725/EmergenceEngine" target="_blank" class="link-button">
<span>📚</span>
<span>GitHub</span>
</a>
<div class="hotkey-divider" style="width: 1px; height: 20px; background: rgba(0, 255, 136, 0.3);"></div>
<a href="https://github.com/DanPace725/EmergenceEngine/discussions/100" target="_blank" class="link-button">
<span>💬</span>
<span>Discussions</span>
</a>
</div>
</div>
<!-- Quick Start Modal -->
<div id="quickstart-modal" class="modal-overlay hidden">
<div class="modal-content">
<div class="modal-header">
<h2>🚀 Emergence Engine Quick Start</h2>
<button id="close-modal" class="close-btn">×</button>
</div>
<div class="modal-body">
<div class="quickstart-section">
<h3>What is this?</h3>
<p>A browser-based sandbox for exploring emergent behavior in swarms of intelligent agents. Watch simple agents learn to navigate, forage, and evolve complex behaviors through reinforcement learning.</p>
</div>
<div class="quickstart-section">
<h3>Key Interactions</h3>
<div class="interaction-grid">
<div class="interaction-item">
<div class="interaction-key">🖱️ Left Click + Drag</div>
<div class="interaction-desc">Guide agents toward resources</div>
</div>
<div class="interaction-item">
<div class="interaction-key">Shift + Click</div>
<div class="interaction-desc">Create distress signals</div>
</div>
<div class="interaction-item">
<div class="interaction-key">Alt + Click</div>
<div class="interaction-desc">Gentle bonding forces</div>
</div>
<div class="interaction-item">
<div class="interaction-key">Space</div>
<div class="interaction-desc">Pause/resume simulation</div>
</div>
<div class="interaction-item">
<div class="interaction-key">L</div>
<div class="interaction-desc">Open training UI</div>
</div>
<div class="interaction-item">
<div class="interaction-key">O</div>
<div class="interaction-desc">Configuration panel</div>
</div>
</div>
</div>
<div class="quickstart-section">
<h3>Visual Layers</h3>
<p>Toggle different overlays to understand what's happening:</p>
<ul>
<li><strong>G</strong> - Scent gradients</li>
<li><strong>P</strong> - Fertility maps</li>
<li><strong>T</strong> - Agent trails</li>
<li><strong>M</strong> - Mitosis (reproduction)</li>
</ul>
</div>
<div class="quickstart-footer">
<p>For detailed guides and advanced features, check the <a href="https://github.com/DanPace725/EmergenceEngine" target="_blank">GitHub repository</a> or join the <a href="https://github.com/DanPace725/EmergenceEngine/discussions/100" target="_blank">community discussions</a>.</p>
</div>
</div>
</div>
</div>
<div id="hud-container"></div>
<div id="dashboard-container" class="hidden"></div>
<div id="hotkey-strip">
<div class="hotkey-item"><span class="hotkey-key">K</span><span class="hotkey-desc">Toggle Hotkeys</span></div>
<div class="hotkey-divider"></div>
<div class="hotkey-item"><span class="hotkey-key">Space</span><span class="hotkey-desc">Pause</span></div>
<div class="hotkey-item"><span class="hotkey-key">R</span><span class="hotkey-desc">Reset</span></div>
<div class="hotkey-item"><span class="hotkey-key">C</span><span class="hotkey-desc">+5χ All</span></div>
<div class="hotkey-divider"></div>
<div class="hotkey-item"><span class="hotkey-key">A</span><span class="hotkey-desc">Auto Toggle</span></div>
<div class="hotkey-item"><span class="hotkey-key">S</span><span class="hotkey-desc">Extended Sense</span></div>
<div class="hotkey-item"><span class="hotkey-key">T</span><span class="hotkey-desc">Trail On/Off</span></div>
<div class="hotkey-item"><span class="hotkey-key">X</span><span class="hotkey-desc">Clear Trail</span></div>
<div class="hotkey-item"><span class="hotkey-key">F</span><span class="hotkey-desc">Diffusion</span></div>
<div class="hotkey-divider"></div>
<div class="hotkey-item"><span class="hotkey-key">G</span><span class="hotkey-desc">Scent Viz</span></div>
<div class="hotkey-item"><span class="hotkey-key">P</span><span class="hotkey-desc">Fertility Viz</span></div>
<div class="hotkey-item"><span class="hotkey-key">M</span><span class="hotkey-desc">Mitosis</span></div>
<div class="hotkey-divider"></div>
<div class="hotkey-item"><span class="hotkey-key">Y</span><span class="hotkey-desc">Adaptive Heuristics</span></div>
<div class="hotkey-item"><span class="hotkey-key">U</span><span class="hotkey-desc">Cycle HUD</span></div>
<div class="hotkey-item"><span class="hotkey-key">L</span><span class="hotkey-desc">Training UI</span></div>
<div class="hotkey-divider"></div>
<div class="hotkey-item"><span class="hotkey-key">V</span><span class="hotkey-desc">Toggle All</span></div>
<div class="hotkey-item"><span class="hotkey-key">E</span><span class="hotkey-desc">Screenshot</span></div>
<div class="hotkey-divider"></div>
<div class="hotkey-item"><span class="hotkey-key">O</span><span class="hotkey-desc">Config Panel</span></div>
</div>
<canvas id="view"></canvas>
<!-- Quick Start Modal JavaScript -->
<script>
// Quick start modal functionality
const quickstartBtn = document.getElementById('quickstart-btn');
const quickstartModal = document.getElementById('quickstart-modal');
const closeModalBtn = document.getElementById('close-modal');
function showModal() {
quickstartModal.classList.remove('hidden');
}
function hideModal() {
quickstartModal.classList.add('hidden');
}
// Event listeners
quickstartBtn.addEventListener('click', showModal);
closeModalBtn.addEventListener('click', hideModal);
// Close modal when clicking outside
quickstartModal.addEventListener('click', (e) => {
if (e.target === quickstartModal) {
hideModal();
}
});
// Close modal with Escape key
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && !quickstartModal.classList.contains('hidden')) {
hideModal();
}
});
</script>
<script type="module" src="/app.js"></script>
</body>
</html>