-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
450 lines (370 loc) · 20.2 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
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
444
445
446
447
448
449
450
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>N-Body Problem by Wartets</title>
<meta name="description" content="Explore Wartets' simulation of the N-body problem, which visualizes different interactions between several bodies.">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta property="og:title" content="N-Body Problem by Wartets">
<meta property="og:description" content="Explore Wartets' simulation of the N-body problem, which visualizes different interactions between several bodies.">
<meta property="og:image" content="https://wartets.github.io/N-Body-Problem/image/social-preview.png">
<meta property="og:url" content="https://wartets.github.io/N-Body-Problem/">
<meta property="og:type" content="website">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="N-Body Problem by Wartets">
<meta name="twitter:description" content="Explore Wartets' simulation of the N-body problem, which visualizes different interactions between several bodies.">
<meta name="twitter:image" content="https://wartets.github.io/N-Body-Problem/image/twitter-card.png">
<link rel="icon" href="image\browser-icon.png">
<link rel="stylesheet" href="css\styles.css"> <!-- CSS style sheet -->
<link rel="stylesheet" href="css\background.css">
</head>
<body>
<canvas id="simulationCanvas"></canvas>
<div id="infoWindow" class="draggable" style="display: none; position: absolute; top: 100px; left: 100px; width: 600px; border: 1px solid #000; padding: 10px;">
<div id="infoWindowHeader">
<span class="closeInfoWindowBtn" id="closeInfoWindowBtn">×</span>
<h3 id="infoWindowTitle">Détails des Objets</h3>
</div>
<hr style="width:80%;text-align:center;color:#444" id="hr">
<!-- Section pour afficher les informations des objets sélectionnés -->
<div id="objectInfo" style="display: flex; justify-content: space-between;">
<div id="objectAInfo" style="width: 45%; border-right: 1px solid #444; padding: 15px;">
<label for="objectASelect" id="objectASelectLabel" style="font-style : italic;">Choix de l'objet 1 : </label>
<select id="objectASelect">
</select>
<ul>
<li><span id="massAtext">Masse: </span><span id="massA"><b style="color:#555;">∅</b></span></li>
<li><span id="chargeAtext">Charge: </span><span id="chargeA"><b style="color:#555;">∅</b></span></li>
<li><span id="radiusAtext">Rayon: </span><span id="radiusA"><b style="color:#555;">∅</b></span></li>
<li><span id="surfaceAtext">Surface: </span><span id="surface1"><b style="color:#555;">∅</b></span></li>
<li><span id="posAtext">Position: </span><span id="positionA"><b style="color:#555;">∅</b></span></li>
<li><span id="distAtext">Distance du Barycentre: </span><span id="distanceBary1"><b style="color:#555;">∅</b></span></li>
<li><span id="speedAtext">Vitesse radiale: </span><span id="speedRadial1"><b style="color:#555;">∅</b></span></li>
<li><span id="accAtext">Accélération radiale: </span><span id="accelerationRadial1"><b style="color:#555;">∅</b></span></li>
<li><span id="forceAtext">Force totale radiale: </span><span id="forceTotalRadial1"><b style="color:#555;">∅</b></span></li>
</ul>
</div>
<div id="objectBInfo" style="width: 45%; padding: 15px;">
<label for="objectBSelect" id="objectBSelectLabel" style="font-style : italic;">Choix de l'objet 2 : </label>
<select id="objectBSelect">
</select>
<ul>
<li><span id="massBtext">Masse: </span><span id="massB"><b style="color:#555;">∅</b></span></li>
<li><span id="chargeBtext">Charge: </span><span id="chargeB"><b style="color:#555;">∅</b></span></li>
<li><span id="radiusBtext">Rayon: </span><span id="radiusB"><b style="color:#555;">∅</b></span></li>
<li><span id="surfaceBtext">Surface: </span><span id="surface2"><b style="color:#555;">∅</b></span></li>
<li><span id="posBtext">Position: </span><span id="positionB"><b style="color:#555;">∅</b></span></li>
<li><span id="distBtext">Distance du Barycentre: </span><span id="distanceBary2"><b style="color:#555;">∅</b></span></li>
<li><span id="speedBtext">Vitesse radiale: </span><span id="speedRadial2"><b style="color:#555;">∅</b></span></li>
<li><span id="accBtext">Accélération radiale: </span><span id="accelerationRadial2"><b style="color:#555;">∅</b></span></li>
<li><span id="forceBtext">Force totale radiale: </span><span id="forceTotalRadial2"><b style="color:#555;">∅</b></span></li>
</ul>
</div>
</div>
<hr style="width:80%;text-align:center;color:#444" id="hr">
<!-- Section pour les informations relatives -->
<ul style="padding: 15px;">
<li><span id="distABtext">Distance entre les deux objets: </span><span id="distanceBetween"><b style="color:#555;">∅</b></span></li>
<li><span id="speedABtext">Vitesse relative radiale: </span><span id="relativeSpeedRadial"><b style="color:#555;">∅</b></span></li>
<li><span id="accABtext">Accélération relative radiale: </span><span id="relativeAccelerationRadial"><b style="color:#555;">∅</b></span></li>
</ul>
<hr style="width:80%;text-align:center;color:#444" id="hr">
<!-- Ajout des listes déroulantes pour les paramètres -->
<div style="padding: 15px;text-align:center;">
<label for="paramXSelect">Sélectionner le paramètre X :</label>
<select id="paramXSelect"></select>
<br>
<label for="paramYSelect">Sélectionner le paramètre Y :</label>
<select id="paramYSelect"></select>
</div>
<!-- Ajout du graphique -->
<div id="containerChart" style="">
<span class="resetChartBtn" id="resetChartBtn">•</span>
<canvas id="parameterChart"></canvas>
</div>
</div>
<div>
<div id="barycenterCoords" class="canvas-text" style="position: absolute; top: 15px;">Barycenter Coord : (x; y)</div>
<div id="mouseCoords" class="canvas-text" style="position: absolute; top: 35px;">Coord : (x; y)</div>
<div id="timer" class="canvas-text" style="position: absolute; top: 55px;">Temps : 0.00 s</div>
<div id="UsageDisplay" class="canvas-text" style="position: absolute; top: 75px;">Usage: 0%</div>
<div id="fpsDisplay" class="canvas-text" style="position: absolute; top: 95px;">fps: 0</div>
<div id="skipDisplay" class="canvas-text" style="position: absolute; top: 115px;">Skipped: 0</div>
<button id="infoWindowBtn">
<img id="infoWindowImg" src="image/terminal-icon.png" alt="Object info">
</button>
<button id="resetViewBtn">
<img id="resetViewImg" src="image/reset-icon.png" alt="Reset View">
</button>
<button id="fullscreenBtn">
<img id="fullscreenImg" src="image/full-screen-on-icon.png" alt="Full-screen">
</button>
<button id="startPauseBtn">
<img id="startPauseImg" src="image/start-button.png" alt="Start">
</button>
<button id="helpBtn">
<img id="helpImg" src="image/help-icon.png" alt="Help">
</button>
<button id="controlsToggleBtn">
<img id="controlsToggle" src="image/U+25B6.svg" alt="close controls">
</button>
<div id="controls">
<select id="languageSelect">
<option value="fr">Français</option>
<option value="en">English</option>
<option value="es">Español</option>
<option value="pt">Português</option>
<option value="de">Deutsh</option>
<option value="it">Italiano</option>
<option value="la">Latin</option>
<option value="vf">Français: Ancien</option>
<option value="pirate">Français: Pirate</option>
<option value="shakespeare">English: Shakespeare</option>
<option value="minion">English: Minions</option>
<option value="LabelName">LabelName</option>
</select>
<hr style="width:100%;text-align:center;color:#444" id="hr1">
<!-- <label id="simulationSettings">Réglages de simulation :</label> -->
<div class="toggle-header">
<button class="toggle-btn">▼</button>
<label id="simulationSettings">Réglages de simulation</label>
</div>
<div class="control-group-1">
<!-- Intervalle de temps -->
<div class="control-group">
<label for="dt" id="dtLabel">dt (Intervalle de temps) :</label>
<input type="number" id="dt" value="0.24" step="0.01">
</div>
<!-- Options physiques -->
<div>
<input type="checkbox" id="collisionToggle" name="collisionToggle"/>
<label for="collisionToggle" id="collisionToggleLabel">Activer les collisions</label>
</div>
<div>
<input type="checkbox" id="mergeToggle" name="mergeToggle"/>
<label for="mergeToggle" id="mergeToggleLabel">Activer la fusion d'objet</label>
</div>
<div>
<input type="checkbox" id="gravityToggle" name="gravityToggle" checked />
<label for="gravityToggle" id="gravityToggleLabel">Activer la gravité</label>
</div>
<div>
<input type="checkbox" id="magneticToggle" name="magneticToggle"/>
<label for="magneticToggle" id="magneticToggleLabel">Activer la force électromagnétique</label>
</div>
<div>
<input type="checkbox" id="frictionToggle" name="frictionToggle"/>
<label for="frictionToggle" id="frictionToggleLabel">Activer les frottements</label>
</div>
<!-- Coefficient de frottement -->
<div id="frictionCoefficientContainer" style="display: none;">
<label for="frictionCoefficient" id="frictionCoefficientLabel">Coefficient de frottement :</label>
<input type="number" id="frictionCoefficient" value="0.1" step="0.01">
</div>
<!-- Champs d'affichage -->
<div>
<input type="checkbox" id="showGravityField" name="showGravityField"/>
<label for="showGravityField" id="showGravityFieldLabel">Afficher le champ de gravité</label>
</div>
<div>
<input type="checkbox" id="showMagneticField" name="showMagneticField"/>
<label for="showMagneticField" id="showMagneticFieldLabel">Afficher le champ électromagnétique</label>
</div>
</div>
<hr style="width:100%;text-align:center;color:#444" id="hr1">
<div class="toggle-header">
<button class="toggle-btn">▼</button>
<label id="displaySettings">Réglages d'affichages</label>
</div>
<div class="control-group-1">
<div>
<input type="checkbox" id="showSize" name="showSize" />
<label for="showSize" id="showSizeLabel">Tailles réelles I / constantes O</label>
</div>
<div>
<input type="checkbox" id="showVelocities" name="showVelocities"/>
<label for="showVelocities" id="showVelocitiesLabel">Afficher les vecteurs de vitesse</label>
</div>
<div>
<input type="checkbox" id="showGrid" name="showGrid" />
<label for="showGrid" id="showGridLabel">Afficher la grille</label>
</div>
<div class="control-group">
<label for="focusSelect" id="focusSelectLabel">Centre de la vue :</label>
<select id="focusSelect">
<option value="" id="selectViewOption">choose</option>
</select>
<label for="zooming-tool" id="zoomingToolLabel">Zoom manuel :</label>
<div id="zooming-tool" class="btn-group mrgn-bttm-lg">
<button type="button" id="zoomOut10" class="btn btn-default">/10</button>
<button type="button" id="zoomOut2" class="btn btn-default">/2</button>
<button type="button" id="zoomIn2" class="btn btn-default">x2</button>
<button type="button" id="zoomIn10" class="btn btn-default">x10</button>
</div>
<div>
<input type="checkbox" id="autoZoomToggle" name="autoZoomToggle" checked/>
<label for="autoZoomToggle" id="autoZoomToggleLabel">Zoom automatique</label>
</div>
</div>
<div>
<input type="checkbox" id="activateSound" name="activateSound" />
<label for="activateSound" id="activateSoundLabel">Activer le son</label>
</div>
<!-- Slider du trail -->
<div class="control-group">
<label for="trailLimit" id="trailLimitLabel">Nombre de points du trail (puiss. 10)</label>
<div class="slider-container">
<input type="range" id="trailLimit" name="trailLimit" min="0" max="5" value="3" step="0.5" class="slider" />
<div id="sliderTooltip" class="tooltip"></div>
</div>
</div>
</div>
<hr style="width:100%;text-align:center;color:#444" id="hr1">
<div class="toggle-header">
<button class="toggle-btn">▼</button>
<label id="objectSettings">Réglages des objets</label>
</div>
<div class="control-group-1">
<div class="control-group">
<label for="presetSelect" id="presetSelectLabel">Charger un preset :</label>
<select id="presetSelect"></select>
<button id="loadPresetBtn" class="rounded">Charger le preset</button>
<button id="importPresetBtn" class="rounded">Importer le preset</button>
<button id="savePresetBtn" class="rounded">Sauvegarder le preset</button>
<input type="text" id="presetName" placeholder="Nom du preset (vide pour nom par défaut)" class="rounded">
</div>
<div class="toggle-header-small">
<button class="toggle-btn">▼</button>
<label id="byObjectSettings">Objets</label>
</div>
<div class="control-group-1">
<div id="object-controls">
<!-- Controls for each object will be generated dynamically -->
</div>
<button id="addBodyBtn" class="rounded" style="cursor:copy">Ajouter un objet</button>
</div>
<hr style="width:100%;text-align:center;color:#333">
<div class="toggle-header-small">
<button class="toggle-btn">▶</button>
<label id="byWellSettings">Puits</label>
</div>
<div class="control-group-1 collapsed">
<div id="well-controls">
<!-- Controls for each wells will be generated dynamically -->
</div>
<button id="addWellBtn" class="rounded" style="cursor:copy">Ajouter un puits</button>
</div>
</div>
<hr style="width:100%;text-align:center;color:#444" id="hr1">
<div class="toggle-header">
<button class="toggle-btn">▶</button>
<label id="advancedSimulationSettings">Réglages avancés</label>
</div>
<div class="control-group-1 collapsed">
<div class="control-group">
<div>
<input type="checkbox" id="simulationMod" name="simulationMod" />
<label for="simulationMod" id="simulationModLabel">Calcul relativiste de la simulation (beta)</label>
</div>
<div>
<input type="checkbox" id="ConstVal" name="ConstVal" />
<label for="ConstVal" id="ConstValLabel">Valeur des constantes réelles</label>
</div>
<div id="customConstants">
<label for="GValue" id="GValueLabel">Constante Gravitationnelle (G) :</label>
<input type="number" id="GValue" value="0.1" step="0.1" style="margin-left:25px"/>
<br>
<label for="epsi0Value" id="epsi0ValueLabel">Permittivité du vide (epsilon_0) :</label>
<input type="number" id="epsi0Value" value="1.25663706144" step="0.1" style="margin-left:25px"/>
<br>
<label for="cValue" id="cValueLabel">Vitesse de la lumière (c) :</label>
<input type="number" id="cValue" value="299792458" step="10" style="margin-left:25px"/>
<br>
<label for="piValue" id="piValueLabel">Constante d'Archimède (pi) :</label>
<input type="number" id="piValue" value="3.141592653589793" step="0.01" style="margin-left:25px"/>
</div>
</div>
<div class="control-group">
<label id="vectorLengthLabelG">Longueur des vecteurs du champ gravitationnel :</label>
<div class="slider-container">
<input type="range" id="vectorLengthSliderG" min="0.01" max="10" value="1" step="0.01" />
<span id="vectorLengthValueG">1</span>
</div>
</div>
<div class="control-group">
<label id="vectorLengthLabelk">Longueur des vecteurs du champ électromagnétique :</label>
<div class="slider-container">
<input type="range" id="vectorLengthSliderk" min="0.01" max="10" value="1" step="0.01" />
<span id="vectorLengthValuek">1</span>
</div>
</div>
<div class="control-group">
<label id="vectorFieldDistanceLabel">Écartement des vecteurs des champs magnétiques</label>
<div class="slider-container">
<input type="range" id="vectorFieldDistance" min="3.75" max="37.5" value="17.5" step="1.25" />
<span id="vectorFieldDistanceD">17.5</span>
</div>
</div>
<div>
<input type="checkbox" id="devMod" name="devMod" />
<label for="devMod" id="devModLabel">Mode développeur</label>
</div>
</div>
<hr style="width:100%;text-align:center;color:#444" id="hr1">
</div>
</div>
<div id="helpModal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<h2 style="text-align: center; margin-bottom: 10px; color: #fff;" id="HelpModalTitle">Simulation d'un Système à N-Corps</h2>
<hr style="border: 0; height: 2px; background: #333; margin-bottom: 20px;">
<p style="font-size: 1.1em; line-height: 1.6;" id="HelpModalIntro">
Dans cette simulation interactive vous pourez explorer les forces de gravité, d'électromagnétisme, les collisions, et les effets de la friction dans un système à N corps. Ajustez la <em>vitesse</em>, la <em>masse</em>, la <em>charge</em>, et la <em>position</em> de chaque objet et observez les interactions en temps réel, visualisez également les champs <em>gravitationnel</em> et <em>électromagnétique</em> en direct.
</p>
<div style="margin-top: 20px;">
<h3 style="color: #fff;" id="HelpModalGitPageTitle">Page GitHub du Projet</h3>
<p id="HelpModalGitPageText">
Découvrez le code source et contribuez au projet sur GitHub :
</p>
<p style="text-align: center;" class="hoverlink">
<a href="https://github.com/Wartets/N-Body-Problem" target="_blank" style="font-weight: bold; color: #007acc; text-decoration: none;" id="HelpModalGitPageLink">Voir le projet sur GitHub</a>
</p>
</div>
<div style="margin-top: 20px;">
<h3 style="color: #fff;" id="HelpModalDocTitle">Documentation</h3>
<p id="HelpModalDocText">
Pour une meilleure compréhension des fonctionnalités du simulateur, explorez le <strong>Wiki</strong> :
</p>
<p style="text-align: center;" class="hoverlink">
<a href="https://github.com/Wartets/N-Body-Problem/wiki" target="_blank" style="font-weight: bold; color: #007acc; text-decoration: none;" id="HelpModalDocLink">Consulter le Wiki</a>
</p>
</div>
<div style="margin-top: 20px;">
<h3 style="color: #fff;" id="HelpModalBugTitle">Bugs et Suggestions</h3>
<p id="HelpModalBugText">
Si vous rencontrez un bug ou avez des suggestions, veuillez visiter :
</p>
<p style="text-align: center;" class="hoverlink">
<a href="https://github.com/Wartets/N-Body-Problem/issues" target="_blank" style="font-weight: bold; color: #ff6b6b; text-decoration: none;" id="HelpModalBugLink">Signaler un Problème</a>
</p>
</div>
<div style="margin-top: 20px;">
<h3 style="color: #fff;" id="HelpModalAutorTitle">Créateur</h3>
<p id="HelpModalAutorText">
Ce projet a été créé par <strong>Wartets</strong>. Consultez son profil GitHub pour en découvrir d'autres projets :
</p>
<p style="text-align: center;" class="hoverlink">
<a href="https://github.com/Wartets/" target="_blank" style="font-weight: bold; color: #007acc; text-decoration: none;" id="HelpModalAutorLink">@Wartets</a>
</p>
</div>
<hr style="border: 0; height: 2px; background: #333; margin-bottom: 20px;">
</div>
</div>
<script src="js/chart/chart.um.js"></script> <!-- Chart.js v4.4.4 -->
<script src="js/presets.js"></script> <!-- Lien vers le fichier JavaScript des Presets -->
<script src="js/script.js"></script> <!-- Lien vers le fichier JavaScript des Fonctions -->
<script src="js/translations.js"></script> <!-- Lien vers le fichier JavaScript des Traductions -->
</body>
</html>