-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
316 lines (280 loc) · 13.9 KB
/
index.html
File metadata and controls
316 lines (280 loc) · 13.9 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
<title>Visualizing Gravitational Lensing</title>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<!-- PWA Meta Tags -->
<meta name="description" content="Interactive visualization of gravitational lensing effects from galaxy clusters and cosmic voids" />
<meta name="theme-color" content="#4facfe" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Lensing Viz" />
<!-- PWA Manifest -->
<link rel="manifest" href="manifest.json" />
<!-- Icons -->
<link rel="icon" type="image/png" sizes="192x192" href="icons/icon-192x192.png" />
<link rel="apple-touch-icon" href="icons/icon-192x192.png" />
<link rel="stylesheet" href="css/styles.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<style>
.model-options {
display: flex;
flex-direction: column;
gap: 4px;
}
.model-row {
display: flex;
gap: 4px;
}
.paper-link {
display: none;
font-size: 0.75rem;
margin-top: 4px;
margin-bottom: 8px;
text-align: right;
}
.paper-link a {
color: #7affb5;
text-decoration: none;
border-bottom: 1px dashed #7affb5;
transition: opacity 0.2s;
}
.paper-link a:hover {
opacity: 0.8;
}
#plot-container {
display: none;
margin-top: 12px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
padding-top: 12px;
}
#mass-plot {
width: 100%;
height: 120px;
background: rgba(0,0,0,0.3);
border-radius: 4px;
border: 1px solid rgba(255,255,255,0.1);
}
</style>
<script data-goatcounter="https://nicosmo.goatcounter.com/count"
async src="//gc.zgo.at/count.js"></script>
</head>
<body>
<div id="loading">Generating Galaxy Field...</div>
<div id="canvas-container"></div>
<div id="lock-indicator">LOCKED</div>
<div id="ui-layer">
<div class="ui-header">
<h1>Lensing Visualization</h1>
<button id="toggle-btn" title="Toggle Settings">–</button>
</div>
<div class="control-content">
<p>
Interactive visualization of a massive cluster or a cosmic void bending light from background layers. A qualitative and exaggerated
representation of lensing effects.
</p>
<p id="credit-text" class="credit-text">Concept & Visualization by Nico Schuster and Andres Salcedo</p>
<p class="credit-text" style="margin-top: -8px">
<a
href="https://github.com/nicosmo/lensing_visualization/"
target="_blank"
style="color: #4facfe; text-decoration: none"
>Code and more info on GitHub</a
>
</p>
<p class="credit-text" style="margin-top: -8px">
<a
href="https://arxiv.org/abs/2603.18145"
target="_blank"
style="color: #4facfe; text-decoration: none"
>Paper on arXiv (2603.18145)</a
>
</p>
<div class="control-group">
<label>Physics Model</label>
<div class="model-options">
<div class="model-row">
<button class="model-btn active" id="btn-model-point" data-model="0">Point Mass</button>
<button class="model-btn" id="btn-model-nfw" data-model="1">NFW Halo</button>
<button class="model-btn" id="btn-model-elliptical" data-model="4">Elliptical Halo</button>
</div>
<div class="model-row">
<button class="model-btn" id="btn-model-void" data-model="2">Void Toy Model</button>
<button class="model-btn" id="btn-model-hsw" data-model="3">HSW Void</button>
</div>
</div>
<div id="hsw-link" class="paper-link">
<a href="https://arxiv.org/abs/1403.5499" target="_blank">View HSW Paper (arXiv:1403.5499) ↗</a>
</div>
</div>
<div class="control-group">
<label>Background Source</label>
<div style="display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px">
<div style="display: flex; gap: 4px">
<button class="preset-btn active" id="btn-galaxies" data-type="galaxies" style="flex: 1">Galaxies</button>
<button class="preset-btn" id="btn-bw" data-type="bw-grid" style="flex: 1">B&W Line Grid</button>
</div>
<div style="display: flex; gap: 4px">
<button class="preset-btn" id="btn-col" data-type="color-grid" style="flex: 1">Color Line Grid</button>
<button class="preset-btn" id="btn-dotted" data-type="dotted-grid" style="flex: 1">Color Dotted Grid</button>
</div>
</div>
<div id="layer-list" class="layer-list"></div>
<label for="bg-upload" id="upload-label" class="file-upload-btn">Add Own Background Image</label>
<input type="file" id="bg-upload" accept="image/*" />
</div>
<div class="control-group">
<label id="mass-label">
Cluster Mass
<span id="mass-val" class="value-display">100%</span>
</label>
<input type="range" id="mass-slider" min="0" max="200" value="100" />
</div>
<div class="control-group" id="group-spread">
<label id="spread-label">
Cluster Spread
<span id="spread-val" class="value-display">1.00x</span>
</label>
<input type="range" id="spread-slider" min="0" max="200" value="100" />
</div>
<div class="control-group" id="group-ellipticity" style="display:none;">
<label>
Ellipticity (q = 1 - e)
<span id="ellipticity-val" class="value-display">0.30</span>
</label>
<input type="range" id="ellipticity-slider" min="0" max="80" value="30" />
</div>
<div class="control-group" id="group-angle" style="display:none;">
<label>
Position Angle (deg)
<span id="angle-val" class="value-display">45</span>
</label>
<input type="range" id="angle-slider" min="0" max="180" value="45" />
</div>
<div class="control-group" id="group-wall-density" style="display:none;">
<label>
Wall Peak Density
<span id="wall-density-val" class="value-display">0.05</span>
</label>
<input type="range" id="wall-density-slider" min="0" max="50" value="5" />
</div>
<div class="control-group" id="group-wall-width" style="display:none;">
<label>
Wall Outer Edge
<span id="wall-width-val" class="value-display">1.05x</span>
</label>
<input type="range" id="wall-width-slider" min="1" max="100" value="5" />
</div>
<div class="control-group" id="group-hsw-rs" style="display:none;">
<label>
Scale Radius (r_s / r_v)
<span id="hsw-rs-val" class="value-display">0.90</span>
</label>
<input type="range" id="hsw-rs-slider" min="10" max="150" value="90" />
</div>
<div class="control-group" id="group-hsw-alpha" style="display:none;">
<label>
Inner Slope (α)
<span id="hsw-alpha-val" class="value-display">4.0</span>
</label>
<input type="range" id="hsw-alpha-slider" min="10" max="100" value="40" />
</div>
<div class="control-group" id="group-hsw-beta" style="display:none;">
<label>
Outer Slope (β)
<span id="hsw-beta-val" class="value-display">15.0</span>
</label>
<input type="range" id="hsw-beta-slider" min="10" max="300" value="150" />
</div>
<div class="control-group">
<label>
Number Of Background Layers
<span id="layers-val" class="value-display">3</span>
</label>
<input type="range" id="layers-slider" min="1" max="8" step="1" value="3" />
</div>
<div class="control-group">
<label>
<span id="density-label-text">Galaxy Density</span>
<span id="density-val" class="value-display">100%</span>
</label>
<input type="range" id="density-slider" min="0" max="200" value="100" />
</div>
<div class="control-group">
<label>
Galaxy Brightness
<span id="bright-val" class="value-display">100%</span>
</label>
<input type="range" id="bright-slider" min="0" max="200" value="100" />
</div>
<div class="control-group" id="group-caustics" style="display:none;">
<label>
Show Caustic Lines
<input type="checkbox" id="caustic-check" />
</label>
<div style="font-size: 0.65rem; text-align: right; margin-top: 6px; opacity: 0.85;">
Based on <a href="https://github.com/lenstronomy/lenstronomy" target="_blank" style="color: #7affb5; text-decoration: none; border-bottom: 1px dashed #7affb5;">GitHub:lenstronomy</a>
</div>
</div>
<div class="control-group">
<label>
Show Foreground Galaxies
<input type="checkbox" id="fg-check" checked />
</label>
</div>
<div class="control-group">
<label>
Show Cluster Member Galaxies
<input type="checkbox" id="cluster-check" checked />
</label>
</div>
<div class="control-group">
<label id="core-label">
Show Dark Matter Halo
<input type="checkbox" id="core-check" checked />
</label>
</div>
<div class="control-group" id="group-plot-toggle" style="display:none;">
<label>
Show Mass Distribution
<input type="checkbox" id="plot-check" checked />
</label>
<div id="plot-container">
<canvas id="mass-plot"></canvas>
</div>
</div>
<div class="reset-container">
<button id="reshuffle-btn" class="reshuffle-btn">Reshuffle Galaxies</button>
<button id="snapshot-btn" class="reshuffle-btn">Save Snapshot</button>
<button id="reset-main" class="reset-main-btn">Reset All Settings</button>
</div>
</div>
</div>
<div class="instructions" id="instruct">Drag to move • Click to Lock</div>
<!-- Modular JavaScript Files -->
<script src="js/utils.js"></script>
<script src="js/galaxy-factory.js"></script>
<script src="js/textures.js"></script>
<script src="js/shaders.js"></script>
<script src="js/ui.js"></script>
<script src="js/app.js"></script>
<!-- Service Worker Registration -->
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', function() {
navigator.serviceWorker.register('sw.js')
.then(function(registration) {
console.log('ServiceWorker registered:', registration.scope);
})
.catch(function(error) {
console.log('ServiceWorker registration failed:', error);
});
});
}
</script>
</body>
</html>