Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
330 lines (324 loc) · 14.8 KB
/
Copy pathindex.html
File metadata and controls
330 lines (324 loc) · 14.8 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cosmic Network Simulator</title>
<link rel="stylesheet" href="/src/styles.css">
</head>
<body>
<div id="app">
<canvas id="canvas"></canvas>
<div id="info">
<div class="header-bar">
<h1>Cosmic Network Simulator</h1>
</div>
<div id="stats">
<div>Stars: <span id="star-count">0</span></div>
<div>Active Civilizations: <span id="active-stars">0</span></div>
<div>Active Waves: <span id="wave-count">0</span></div>
<div>Connections: <span id="connection-count">0</span></div>
<div>Camera: <span id="camera-pos">0, 0, 0</span></div>
</div>
<div id="controls">
<button id="play-pause-btn" class="control-btn">⏸️ Pause</button>
<button id="reset-btn" class="control-btn reset-btn">🔄 Reset</button>
<button id="toggle-waves-btn" class="control-btn">👁️ Hide Waves</button>
<button id="toggle-supernovae-btn" class="control-btn">✨ Hide Supernovae</button>
<button id="settings-btn" class="control-btn">⚙️ Settings</button>
<div class="speed-control">
<label for="speed-slider">Speed: <span id="speed-value">1.0</span>x</label>
<input type="range" id="speed-slider" min="0.1" max="3" step="0.1" value="1" />
</div>
</div>
</div>
<!-- Settings Modal -->
<div id="settings-modal" class="modal">
<div class="modal-content">
<div class="modal-header">
<h2>⚙️ Simulation Settings</h2>
<span class="close-btn">×</span>
</div>
<div class="modal-body">
<div class="settings-section">
<h3>Star Behavior</h3>
<label>
<span class="label-text">
Activation Chance:
<span class="info-icon">ⓘ
<span class="tooltip-text">Probability per second that a dormant star develops a civilization (also used for supernova chance).</span>
</span>
</span>
<input type="number" id="set-activationChance" required step="0.0001" min="0" />
</label>
<label>
<span class="label-text">
Deactivation Chance:
<span class="info-icon">ⓘ
<span class="tooltip-text">Probability per second that an active civilization goes dormant or extinct.</span>
</span>
</span>
<input type="number" id="set-deactivationChance" required step="0.0001" min="0" />
</label>
</div>
<div class="settings-section">
<h3>Galaxy Structure</h3>
<label>
<span class="label-text">
Central Bulge Radius <span style="color: rgba(255,255,255,0.5); font-size: 0.9em;">(units)</span>:
<span class="info-icon">ⓘ
<span class="tooltip-text">Radius of the dense spherical core at galaxy center (high radiation zone).</span>
</span>
</span>
<input type="number" id="set-centralBulgeRadius" required min="0" step="0.1" />
</label>
<label>
<span class="label-text">
Min Distance From Center <span style="color: rgba(255,255,255,0.5); font-size: 0.9em;">(units)</span>:
<span class="info-icon">ⓘ
<span class="tooltip-text">Minimum distance from galaxy center where civilizations can emerge (avoids bulge radiation).</span>
</span>
</span>
<input type="number" id="set-minDistanceFromCenter" required min="0" step="0.1" />
</label>
<label>
<span class="label-text">
Disk Radius <span style="color: rgba(255,255,255,0.5); font-size: 0.9em;">(units)</span>:
<span class="info-icon">ⓘ
<span class="tooltip-text">Maximum radius of the galactic disk where stars are distributed.</span>
</span>
</span>
<input type="number" id="set-diskRadius" required min="10" step="0.1" />
</label>
<label>
<span class="label-text">
Disk Thickness <span style="color: rgba(255,255,255,0.5); font-size: 0.9em;">(units)</span>:
<span class="info-icon">ⓘ
<span class="tooltip-text">Vertical thickness of the galactic disk (height above/below plane).</span>
</span>
</span>
<input type="number" id="set-diskThickness" required min="0.1" step="0.1" />
</label>
<label>
<span class="label-text">
Central Bulge Fraction:
<span class="info-icon">ⓘ
<span class="tooltip-text">Fraction of stars (0-1) that spawn in the dense central bulge vs spiral arms.</span>
</span>
</span>
<input type="number" id="set-centralBulgeFraction" required step="0.01" min="0" max="1" />
</label>
<label>
<span class="label-text">
Arm Width Factor:
<span class="info-icon">ⓘ
<span class="tooltip-text">Width of spiral arms relative to distance from center (higher = wider arms).</span>
</span>
</span>
<input type="number" id="set-armWidthFactor" required step="0.1" min="0" />
</label>
<label>
<span class="label-text">
Arm Curve Factor:
<span class="info-icon">ⓘ
<span class="tooltip-text">How tightly spiral arms curve (higher = tighter spiral).</span>
</span>
</span>
<input type="number" id="set-armCurveFactor" required step="0.5" min="0" />
</label>
</div>
<div class="settings-section">
<h3>Active Star Visuals</h3>
<label>
<span class="label-text">
Active Star Scale:
<span class="info-icon">ⓘ
<span class="tooltip-text">Size multiplier for stars with active civilizations (1.0 = normal size).</span>
</span>
</span>
<input type="number" id="set-activeStarScale" required step="0.1" min="0.1" />
</label>
<label>
<span class="label-text">
Color Multiplier:
<span class="info-icon">ⓘ
<span class="tooltip-text">Brightness multiplier for active star colors (higher = brighter).</span>
</span>
</span>
<input type="number" id="set-activeStarColorMultiplier" required step="0.1" min="0" />
</label>
<label>
<span class="label-text">
Light Intensity:
<span class="info-icon">ⓘ
<span class="tooltip-text">Intensity of the point light emitted by active stars.</span>
</span>
</span>
<input type="number" id="set-activeStarLightIntensity" required step="0.5" min="0" />
</label>
</div>
<div class="settings-section">
<h3>Dust Obscuration</h3>
<label>
<span class="label-text">
Behind Cloud Opacity:
<span class="info-icon">ⓘ
<span class="tooltip-text">Opacity (0-1) of stars behind dust clouds as seen from camera.</span>
</span>
</span>
<input type="number" id="set-behindCloudOpacity" required step="0.01" min="0" max="1" />
</label>
<label>
<span class="label-text">
Inside Cloud Opacity:
<span class="info-icon">ⓘ
<span class="tooltip-text">Opacity (0-1) of stars physically inside dust clouds.</span>
</span>
</span>
<input type="number" id="set-insideCloudOpacity" required step="0.01" min="0" max="1" />
</label>
<label>
<span class="label-text">
Clear Opacity:
<span class="info-icon">ⓘ
<span class="tooltip-text">Normal opacity (0-1) of stars not affected by dust.</span>
</span>
</span>
<input type="number" id="set-clearOpacity" required step="0.01" min="0" max="1" />
</label>
<label>
<span class="label-text">
Behind Cloud Light Intensity:
<span class="info-icon">ⓘ
<span class="tooltip-text">Light intensity for stars behind dust clouds (dimmed).</span>
</span>
</span>
<input type="number" id="set-behindCloudLightIntensity" required step="0.01" min="0" />
</label>
<label>
<span class="label-text">
Inside Cloud Light Intensity:
<span class="info-icon">ⓘ
<span class="tooltip-text">Light intensity for stars inside dust clouds (partially obscured).</span>
</span>
</span>
<input type="number" id="set-insideCloudLightIntensity" required step="0.01" min="0" />
</label>
</div>
<div class="settings-section">
<h3>Radio Waves</h3>
<label>
<span class="label-text">
Wave Speed:
<span class="info-icon">ⓘ
<span class="tooltip-text">Speed at which radio waves expand from active stars (units per second).</span>
</span>
</span>
<input type="number" id="set-waveSpeed" required step="0.5" min="0.1" />
</label>
<label>
<span class="label-text">
Max Radius <span style="color: rgba(255,255,255,0.5); font-size: 0.9em;">(units)</span>:
<span class="info-icon">ⓘ
<span class="tooltip-text">Maximum expansion radius before waves disappear.</span>
</span>
</span>
<input type="number" id="set-waveMaxRadius" required min="1" step="1" />
</label>
<label>
<span class="label-text">
Wave Color:
<span class="info-icon">ⓘ
<span class="tooltip-text">Color of radio wave rings emitted from active civilizations.</span>
</span>
</span>
<input type="color" id="set-waveColor" />
</label>
<label>
<span class="label-text">
Wave Opacity:
<span class="info-icon">ⓘ
<span class="tooltip-text">Opacity (0-1) of radio wave rings (higher = more visible).</span>
</span>
</span>
<input type="number" id="set-waveOpacity" required step="0.1" min="0" max="1" />
</label>
<label>
<span class="label-text">
Wave Segments:
<span class="info-icon">ⓘ
<span class="tooltip-text">Number of line segments forming each wave circle (higher = smoother circles).</span>
</span>
</span>
<input type="number" id="set-waveSegments" required min="3" step="1" />
</label>
</div>
<div class="settings-section">
<h3>Network & Star Birth</h3>
<label>
<span class="label-text">
Max Connection Distance <span style="color: rgba(255,255,255,0.5); font-size: 0.9em;">(units)</span>:
<span class="info-icon">ⓘ
<span class="tooltip-text">Maximum distance between stars (computed: 40% of spiral arm width). Adjust arm width factor to change this.</span>
</span>
</span>
<input type="number" id="set-maxConnectionDistance" readonly />
</label>
<label>
<span class="label-text">
Birth Replacement Ratio:
<span class="info-icon">ⓘ
<span class="tooltip-text">Fraction (0-1) of dead stars replaced by new stars when population above threshold.</span>
</span>
</span>
<input type="number" id="set-starBirthReplacementRatio" required step="0.01" min="0" max="1" />
</label>
<label>
<span class="label-text">
Birth Population Threshold:
<span class="info-icon">ⓘ
<span class="tooltip-text">Minimum star population before death-driven birth activates.</span>
</span>
</span>
<input type="number" id="set-starBirthPopulationThreshold" required min="0" step="1" />
</label>
<label>
<span class="label-text">
Max Stars:
<span class="info-icon">ⓘ
<span class="tooltip-text">Safety cap on total star population (prevents infinite growth).</span>
</span>
</span>
<input type="number" id="set-maxStars" required min="1000" step="1" />
</label>
<label>
<span class="label-text">
Star Geometry Radius <span style="color: rgba(255,255,255,0.5); font-size: 0.9em;">(units)</span>:
<span class="info-icon">ⓘ
<span class="tooltip-text">Base radius of star sphere meshes (inactive stars).</span>
</span>
</span>
<input type="number" id="set-starGeometryRadius" required step="0.1" min="0.1" />
</label>
<label>
<span class="label-text">
Star Geometry Segments:
<span class="info-icon">ⓘ
<span class="tooltip-text">Number of geometry segments for star spheres (higher = smoother but slower).</span>
</span>
</span>
<input type="number" id="set-starGeometrySegments" required min="3" step="1" />
</label>
</div>
</div>
<div class="modal-footer">
<button id="settings-save-btn" class="modal-btn primary-btn">💾 Save</button>
<button id="settings-reset-btn" class="modal-btn">🔄 Reset to Defaults</button>
<button id="settings-cancel-btn" class="modal-btn">❌ Cancel</button>
</div>
</div>
</div>
</div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>