Spaces:
Running

AK51 commited on
Commit
929e2a6
·
verified ·
1 Parent(s): d6cf32b

Upload 51 files

Browse files
Files changed (8) hide show
  1. README.md +5 -1
  2. css/style.css +103 -4
  3. index.html +124 -0
  4. js/i18n.js +120 -3
  5. js/i18n_moons.js +126 -123
  6. js/main.js +73 -2
  7. js/moonfx.js +595 -0
  8. js/scene.js +132 -14
README.md CHANGED
@@ -13,6 +13,8 @@ short_description: Interactive 3D guide to giant-planet magnetospheres & aurora
13
 
14
  An interactive public-outreach website, inspired by the [MOP 2028 conference](https://www.lsr.hku.hk/MOP/index.html) (Hong Kong, 10–14 January 2028), that explains the magnetospheres and aurora of Jupiter, Saturn, Uranus and Neptune to high-school students and the public.
15
 
 
 
16
  Languages: English, 简体中文, 繁體中文 (switch in the top-right corner; the choice is remembered).
17
 
18
  ## Features
@@ -23,7 +25,9 @@ Languages: English, 简体中文, 繁體中文 (switch in the top-right corner;
23
  - **Moons**: 18 moons with mission mosaics (Earth's Moon; Io, Europa, Ganymede, Callisto; Mimas, Enceladus, Tethys, Dione, Rhea, Titan, Iapetus; Miranda, Ariel, Umbriel, Titania, Oberon; Triton). Click a moon in 3D, or use the Moons section, to fly to it and read about its role in the magnetosphere.
24
  - **Spacecraft**: 3D models of Voyager 2, Galileo, Cassini–Huygens, Juno, Hubble, JWST, JUICE and Europa Clipper, grouped by the 8 MOP 2028 conference themes. Tap the numbered markers to learn what each instrument does; each craft also lists its main discoveries.
25
  - **Aurora gallery**: animated polar views of the aurora on Earth, Jupiter, Saturn, Uranus and Neptune, drawn over the planet textures.
26
- - **Size comparison**, **why study it**, **missions timeline** and a short **quiz**.
 
 
27
 
28
  ## Files
29
 
 
13
 
14
  An interactive public-outreach website, inspired by the [MOP 2028 conference](https://www.lsr.hku.hk/MOP/index.html) (Hong Kong, 10–14 January 2028), that explains the magnetospheres and aurora of Jupiter, Saturn, Uranus and Neptune to high-school students and the public.
15
 
16
+ Created by **Andy Kong**.
17
+
18
  Languages: English, 简体中文, 繁體中文 (switch in the top-right corner; the choice is remembered).
19
 
20
  ## Features
 
25
  - **Moons**: 18 moons with mission mosaics (Earth's Moon; Io, Europa, Ganymede, Callisto; Mimas, Enceladus, Tethys, Dione, Rhea, Titan, Iapetus; Miranda, Ariel, Umbriel, Titania, Oberon; Triton). Click a moon in 3D, or use the Moons section, to fly to it and read about its role in the magnetosphere.
26
  - **Spacecraft**: 3D models of Voyager 2, Galileo, Cassini–Huygens, Juno, Hubble, JWST, JUICE and Europa Clipper, grouped by the 8 MOP 2028 conference themes. Tap the numbered markers to learn what each instrument does; each craft also lists its main discoveries.
27
  - **Aurora gallery**: animated polar views of the aurora on Earth, Jupiter, Saturn, Uranus and Neptune, drawn over the planet textures.
28
+ - **Solar wind control** on the front page: a strength slider (magnetopause size and aurora power update live), a "launch a solar storm (CME)" button, and a "Hide menus" button (or press H) for an unobstructed view.
29
+ - **Moon plasma effects**: plumes, auroral spots, Alfvén wings, pick-up ion tails, Ganymede's mini-magnetosphere and more.
30
+ - **Size comparison**, **why study it**, **missions timeline**, a short **quiz**, **latest news** (ESA Plasma Observatory, 19 Nov 2026) and a **reference list**.
31
 
32
  ## Files
33
 
css/style.css CHANGED
@@ -105,7 +105,61 @@ body.exploring .ui .panel, body.exploring .ui .planet-tabs { opacity: 1; pointer
105
  .sw-field { background: #7fb6ff; } .sw-wind { background: #ffe39a; } .sw-mp { background: linear-gradient(90deg, #4fb5ff, #ff9a50); }
106
  .sw-aurora { background: linear-gradient(90deg, #5fffa0, #c27bff); } .sw-torus { background: #ff8a4a; } .sw-moons { background: #ffd25a; } .sw-labels { background: #ccc; }
107
  .panel input[type=range] { width: 100%; accent-color: var(--accent2); }
108
- .views { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  .views button { background: rgba(255,255,255,.05); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 6px; cursor: pointer; font-size: .8rem; }
110
  .views button:hover { background: rgba(255,255,255,.12); }
111
  .panel .note { color: var(--muted); font-size: .78rem; margin: 12px 0 0; }
@@ -213,11 +267,46 @@ tbody td { color: #c9d1f2; }
213
 
214
  .footer { padding: 36px max(5vw, 20px); border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; text-align: center; }
215
  .footer p { margin: 6px 0; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
 
217
  /* ------------------------------------------------------------ mobile */
218
- @media (max-width: 1100px) {
219
  .nav a { padding: 6px 7px; font-size: .85rem; }
220
  }
 
 
 
 
 
 
 
221
  @media (max-width: 960px) {
222
  .menu-btn { display: block; }
223
  .nav { display: none; position: absolute; top: 58px; left: 0; right: 0; flex-direction: column; background: rgba(5,7,20,.97); padding: 10px; border-bottom: 1px solid var(--line); }
@@ -227,6 +316,8 @@ tbody td { color: #c9d1f2; }
227
  .stage { position: relative; height: 68vh; min-height: 380px; }
228
  .hero { position: relative; width: 100%; padding: 26px 20px 30px; background: var(--bg); }
229
  body.exploring .hero { display: none; }
 
 
230
  .ui { position: static; }
231
  .ui .panel, .ui .planet-tabs { display: none; }
232
  body.exploring .ui .panel, body.exploring .ui .planet-tabs { display: flex; }
@@ -278,7 +369,7 @@ tbody td { color: #c9d1f2; }
278
  @media (max-width: 960px) {
279
  .moon-grid { grid-template-columns: 1fr; }
280
  .moon-card { flex-direction: column; align-items: center; text-align: left; }
281
- }
282
 
283
  /* -------------------------------------------------------- spacecraft */
284
  .themes h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
@@ -339,4 +430,12 @@ tbody td { color: #c9d1f2; }
339
  .craft-stage { height: 420px; }
340
  .craft-info { max-height: none; }
341
  .craft-facts { grid-template-columns: 1fr 1fr; }
342
- }
 
 
 
 
 
 
 
 
 
105
  .sw-field { background: #7fb6ff; } .sw-wind { background: #ffe39a; } .sw-mp { background: linear-gradient(90deg, #4fb5ff, #ff9a50); }
106
  .sw-aurora { background: linear-gradient(90deg, #5fffa0, #c27bff); } .sw-torus { background: #ff8a4a; } .sw-moons { background: #ffd25a; } .sw-labels { background: #ccc; }
107
  .panel input[type=range] { width: 100%; accent-color: var(--accent2); }
108
+ /* hide-all-menus toggle */
109
+ .ui-toggle {
110
+ position: absolute; top: 72px; right: 16px; z-index: 7; display: inline-flex; align-items: center; gap: 7px;
111
+ background: rgba(8,11,30,.78); color: var(--text); border: 1px solid var(--line); border-radius: 999px;
112
+ padding: 7px 14px 7px 11px; font-size: .82rem; cursor: pointer; backdrop-filter: blur(10px);
113
+ }
114
+ .ui-toggle:hover { background: rgba(30,36,80,.9); }
115
+ .ui-ico { width: 16px; height: 12px; position: relative; flex: none; }
116
+ .ui-ico::before, .ui-ico::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; border-radius: 1px; background: currentColor; transition: transform .3s, top .3s; }
117
+ .ui-ico::before { top: 2px; } .ui-ico::after { top: 8px; }
118
+ body.ui-min .ui-toggle { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; }
119
+ body.ui-min .ui-ico::before { top: 5px; transform: rotate(45deg); }
120
+ body.ui-min .ui-ico::after { top: 5px; transform: rotate(-45deg); }
121
+ body.ui-min .ui-ico::before, body.ui-min .ui-ico::after { width: 10px; left: 3px; }
122
+ body:not(.ui-min) .ui-ico::before, body:not(.ui-min) .ui-ico::after { box-shadow: 0 3px 0 currentColor; }
123
+ body.ui-min .hero, body.ui-min .wind-card,
124
+ body.ui-min.exploring .ui .panel, body.ui-min.exploring .ui .planet-tabs { opacity: 0 !important; pointer-events: none !important; }
125
+ body.ui-min .hero { transform: translateX(-40px); }
126
+ /* floating solar wind control: visible on the front page and while exploring */
127
+ .wind-card {
128
+ position: absolute; right: 24px; bottom: 24px; z-index: 6; width: 330px;
129
+ background: rgba(8,11,30,.78); border: 1px solid rgba(255,190,110,.28); border-radius: 16px;
130
+ backdrop-filter: blur(12px); padding: 12px 16px 12px; font-size: .85rem; box-shadow: 0 8px 30px rgba(0,0,0,.4);
131
+ transition: opacity .4s, border-color .4s, box-shadow .4s, left .6s, right .6s, transform .6s;
132
+ }
133
+ body.exploring .wind-card { right: auto; left: 50%; bottom: 16px; transform: translateX(-50%); width: 320px; }
134
+ body.touring .wind-card { opacity: 0; pointer-events: none; }
135
+ .wind-card.storming, .wind-card.impact { border-color: rgba(255,100,70,.7); box-shadow: 0 0 26px rgba(255,90,50,.35); }
136
+ .wind-card.impact { animation: impactPulse .9s ease-in-out infinite; }
137
+ @keyframes impactPulse { 50% { box-shadow: 0 0 40px rgba(255,90,50,.7); } }
138
+ .wind-h { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 4px; }
139
+ .wind-title { font-weight: 700; color: #ffd9a0; font-size: .9rem; }
140
+ .wind-val { font-weight: 700; color: #ffe39a; white-space: nowrap; font-size: .8rem; }
141
+ .wind-val[data-level=calm] { color: #9fc4ff; }
142
+ .wind-val[data-level=strong] { color: #ffb15a; }
143
+ .wind-val[data-level=storm] { color: #ff6b5a; }
144
+ .wind-row { display: flex; align-items: center; gap: 8px; }
145
+ .wind-end { color: var(--muted); font-size: .72rem; white-space: nowrap; }
146
+ #windSlider { flex: 1; min-width: 0; height: 22px; -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
147
+ #windSlider::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #7fb2ff, #ffe39a 25%, #ffb15a 55%, #ff4a4a); }
148
+ #windSlider::-moz-range-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, #7fb2ff, #ffe39a 25%, #ffb15a 55%, #ff4a4a); }
149
+ #windSlider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -6px; border-radius: 50%; background: #fff; border: 3px solid #ff9a40; box-shadow: 0 0 10px rgba(255,170,80,.9); }
150
+ #windSlider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid #ff9a40; box-shadow: 0 0 10px rgba(255,170,80,.9); }
151
+ .wind-meters { display: grid; gap: 4px; margin: 8px 0 2px; }
152
+ .wind-meters div { display: grid; grid-template-columns: 1fr auto; column-gap: 8px; font-size: .75rem; color: var(--muted); }
153
+ .wind-meters b { color: var(--text); font-weight: 600; }
154
+ .wind-meters i { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 2px; }
155
+ .wind-meters em { display: block; height: 100%; width: 50%; background: linear-gradient(90deg, #4fb5ff, #8fd0ff); transition: width .2s; }
156
+ .wind-meters em.au { background: linear-gradient(90deg, #5fffa0, #c27bff); }
157
+ .wind-btns { display: grid; grid-template-columns: auto 1fr; gap: 6px; margin-top: 8px; }
158
+ .wind-btns button { background: rgba(255,255,255,.05); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; cursor: pointer; font-size: .8rem; }
159
+ .wind-btns button:hover:not(:disabled) { background: rgba(255,255,255,.12); }
160
+ .wind-btns .storm { background: linear-gradient(90deg, rgba(255,120,60,.3), rgba(255,60,90,.3)); border-color: rgba(255,120,80,.55); font-weight: 600; }
161
+ .wind-btns button:disabled { opacity: .5; cursor: default; }
162
+ .wind-hint { color: var(--muted); font-size: .72rem; margin: 8px 0 0; line-height: 1.4; }.views { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
163
  .views button { background: rgba(255,255,255,.05); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 6px; cursor: pointer; font-size: .8rem; }
164
  .views button:hover { background: rgba(255,255,255,.12); }
165
  .panel .note { color: var(--muted); font-size: .78rem; margin: 12px 0 0; }
 
267
 
268
  .footer { padding: 36px max(5vw, 20px); border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; text-align: center; }
269
  .footer p { margin: 6px 0; }
270
+ .footer .credit { color: var(--text); font-size: 1rem; font-weight: 600; margin-bottom: 12px; }
271
+
272
+ /* news */
273
+ .news-pill { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin-top: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: #d8defa; text-decoration: none; font-size: .85rem; }
274
+ .news-pill:hover { background: rgba(255,255,255,.12); }
275
+ .np-tag { background: linear-gradient(135deg, #ff9a50, #ff5a8a); color: #fff; font-weight: 700; font-size: .72rem; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
276
+ .news-card { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: 28px; background: var(--card, rgba(255,255,255,.03)); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
277
+ .news-art svg { width: 100%; height: auto; display: block; border-radius: 12px; }
278
+ .news-date { color: var(--aurora); font-weight: 600; font-size: .85rem; margin: 0 0 6px; }
279
+ .news-body h3 { font-size: 1.35rem; margin: 0 0 10px; }
280
+ .news-body p, .news-body li { color: #d0d7f5; }
281
+ .news-body ul { padding-left: 1.2em; margin: 10px 0 14px; }
282
+ .news-body li { margin: 5px 0; }
283
+ .news-why { border-left: 3px solid var(--aurora); background: rgba(95,242,194,.06); padding: 10px 14px; border-radius: 0 10px 10px 0; margin: 0 0 16px; }
284
+ .news-why p { margin: 4px 0 0; }
285
+
286
+ /* references */
287
+ .refs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
288
+ .refs h3 { margin: 0 0 10px; color: var(--aurora); font-size: 1rem; }
289
+ .refs h3:not(:first-child) { margin-top: 22px; }
290
+ .refs ol, .refs ul { padding-left: 1.4em; margin: 0; }
291
+ .refs li { color: #c9d1f2; font-size: .86rem; line-height: 1.5; margin: 0 0 8px; }
292
+ .refs a { color: #9fc4ff; }
293
+ .ref-note { color: var(--muted); }
294
+ @media (max-width: 960px) {
295
+ .news-card { grid-template-columns: 1fr; padding: 16px; }
296
+ .refs-grid { grid-template-columns: 1fr; }
297
+ }
298
 
299
  /* ------------------------------------------------------------ mobile */
300
+ @media (max-width: 1340px) {
301
  .nav a { padding: 6px 7px; font-size: .85rem; }
302
  }
303
+ /* the full menu no longer fits: switch to the ☰ drop-down earlier than the rest of the mobile layout */
304
+ @media (max-width: 1180px) {
305
+ .menu-btn { display: block; }
306
+ .nav { display: none; position: absolute; top: 58px; left: 0; right: 0; flex-direction: column; background: rgba(5,7,20,.97); padding: 10px; border-bottom: 1px solid var(--line); z-index: 30; }
307
+ body.menu-open .nav { display: flex; }
308
+ .lang { margin-left: auto; }
309
+ }
310
  @media (max-width: 960px) {
311
  .menu-btn { display: block; }
312
  .nav { display: none; position: absolute; top: 58px; left: 0; right: 0; flex-direction: column; background: rgba(5,7,20,.97); padding: 10px; border-bottom: 1px solid var(--line); }
 
316
  .stage { position: relative; height: 68vh; min-height: 380px; }
317
  .hero { position: relative; width: 100%; padding: 26px 20px 30px; background: var(--bg); }
318
  body.exploring .hero { display: none; }
319
+ .wind-card, body.exploring .wind-card { position: relative; left: auto; right: auto; bottom: auto; transform: none; width: auto; margin: 12px; }
320
+ .ui-toggle { display: none; }
321
  .ui { position: static; }
322
  .ui .panel, .ui .planet-tabs { display: none; }
323
  body.exploring .ui .panel, body.exploring .ui .planet-tabs { display: flex; }
 
369
  @media (max-width: 960px) {
370
  .moon-grid { grid-template-columns: 1fr; }
371
  .moon-card { flex-direction: column; align-items: center; text-align: left; }
372
+ }
373
 
374
  /* -------------------------------------------------------- spacecraft */
375
  .themes h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
 
430
  .craft-stage { height: 420px; }
431
  .craft-info { max-height: none; }
432
  .craft-facts { grid-template-columns: 1fr 1fr; }
433
+ }
434
+
435
+ /* moon effect labels and chips */
436
+ .scene-label.fx { font-size: 11px; color: #ffe6a8; border-color: rgba(255,200,120,.45); background: rgba(20,12,4,.55); }
437
+ .fx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
438
+ .fx-chips span { font-size: .78rem; padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(255,200,120,.4); background: rgba(255,200,120,.08); color: #ffe6c0; }
439
+ .moon-status { margin: 10px 0 6px; padding: 6px 10px; border-radius: 8px; font-size: .82rem; background: rgba(255,210,120,.1); border: 1px solid rgba(255,210,120,.35); color: #ffe0a0; }
440
+ .moon-status.tail { background: rgba(90,255,190,.1); border-color: rgba(90,255,190,.4); color: #9fffd8; }
441
+ #moonTail { width: 100%; margin-bottom: 8px; }
index.html CHANGED
@@ -3,6 +3,7 @@
3
  <head>
4
  <meta charset="utf-8" />
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
 
6
  <title>Magnetospheres of the Outer Planets · 3D Explorer</title>
7
  <meta name="description" content="An interactive 3D introduction to the magnetospheres and aurora of Jupiter, Saturn, Uranus and Neptune, for students and the public. English, 简体中文, 繁體中文." />
8
  <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🪐</text></svg>" />
@@ -28,7 +29,9 @@
28
  <a href="#why" data-i18n="nav.why">Why study</a>
29
  <a href="#missions" data-i18n="nav.missions">Missions</a>
30
  <a href="#quiz" data-i18n="nav.quiz">Quiz</a>
 
31
  <a href="#mop" data-i18n="nav.mop">MOP 2028</a>
 
32
  </nav>
33
  <div class="lang" role="group" aria-label="Language">
34
  <button data-lang="en">EN</button>
@@ -51,6 +54,27 @@
51
  <a class="btn ghost" href="#how" data-i18n="hero.cta2"></a>
52
  </div>
53
  <p class="hint" data-i18n="hero.hint"></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  </div>
55
 
56
  <div class="ui" id="ui">
@@ -215,6 +239,47 @@
215
  <div class="quiz-footer"><span id="quizScore"></span><button class="btn ghost small" id="quizReset" data-i18n="qz.reset"></button></div>
216
  </section>
217
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
  <!-- ========================================================== MOP -->
219
  <section id="mop" class="section mop">
220
  <div class="mop-inner">
@@ -224,9 +289,68 @@
224
  <a class="btn primary" href="https://www.lsr.hku.hk/MOP/index.html" target="_blank" rel="noopener" data-i18n="mop.link"></a>
225
  </div>
226
  </section>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
  </main>
228
 
229
  <footer class="footer">
 
230
  <p data-i18n="ft.note"></p>
231
  <p data-i18n="ft.sources"></p>
232
  <p data-i18n="ft.tex"></p>
 
3
  <head>
4
  <meta charset="utf-8" />
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <meta name="author" content="Andy Kong" />
7
  <title>Magnetospheres of the Outer Planets · 3D Explorer</title>
8
  <meta name="description" content="An interactive 3D introduction to the magnetospheres and aurora of Jupiter, Saturn, Uranus and Neptune, for students and the public. English, 简体中文, 繁體中文." />
9
  <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🪐</text></svg>" />
 
29
  <a href="#why" data-i18n="nav.why">Why study</a>
30
  <a href="#missions" data-i18n="nav.missions">Missions</a>
31
  <a href="#quiz" data-i18n="nav.quiz">Quiz</a>
32
+ <a href="#news" data-i18n="nav.news">News</a>
33
  <a href="#mop" data-i18n="nav.mop">MOP 2028</a>
34
+ <a href="#refs" data-i18n="nav.refs">References</a>
35
  </nav>
36
  <div class="lang" role="group" aria-label="Language">
37
  <button data-lang="en">EN</button>
 
54
  <a class="btn ghost" href="#how" data-i18n="hero.cta2"></a>
55
  </div>
56
  <p class="hint" data-i18n="hero.hint"></p>
57
+ <a class="news-pill" href="#news"><span class="np-tag" data-i18n="nw.tag"></span><span data-i18n="nw.pill"></span> →</a>
58
+ </div>
59
+
60
+ <button class="ui-toggle" id="uiToggle" type="button" aria-pressed="false"><span class="ui-ico" aria-hidden="true"></span><span id="uiToggleTxt"></span></button>
61
+
62
+ <div class="wind-card" id="windCard">
63
+ <div class="wind-h"><span class="wind-title">☀ <span data-i18n="ex.wind"></span></span><span id="windVal" class="wind-val"></span></div>
64
+ <div class="wind-row">
65
+ <span class="wind-end" data-i18n="ex.windCalm"></span>
66
+ <input type="range" id="windSlider" min="0.3" max="4" step="0.05" value="1" aria-labelledby="windCard" />
67
+ <span class="wind-end" data-i18n="ex.windStorm"></span>
68
+ </div>
69
+ <div class="wind-meters">
70
+ <div><span data-i18n="ex.mSize"></span><b id="mpVal"></b><i><em id="mpBar"></em></i></div>
71
+ <div><span data-i18n="ex.mAurora"></span><b id="auVal"></b><i><em id="auBar" class="au"></em></i></div>
72
+ </div>
73
+ <div class="wind-btns">
74
+ <button id="windReset" data-i18n="ex.windReset"></button>
75
+ <button id="cmeBtn" class="storm" data-i18n="ex.storm"></button>
76
+ </div>
77
+ <p class="wind-hint" data-i18n="ex.windHint"></p>
78
  </div>
79
 
80
  <div class="ui" id="ui">
 
239
  <div class="quiz-footer"><span id="quizScore"></span><button class="btn ghost small" id="quizReset" data-i18n="qz.reset"></button></div>
240
  </section>
241
 
242
+ <!-- ========================================================= NEWS -->
243
+ <section id="news" class="section">
244
+ <h2 data-i18n="nw.title"></h2>
245
+ <p class="lead" data-i18n="nw.sub"></p>
246
+ <article class="news-card">
247
+ <div class="news-art" aria-hidden="true">
248
+ <svg viewBox="0 0 320 200" role="img">
249
+ <defs>
250
+ <radialGradient id="nwSun" cx="100%" cy="50%" r="70%"><stop offset="0" stop-color="#ffd27a"/><stop offset=".35" stop-color="#ff8a3a" stop-opacity=".55"/><stop offset="1" stop-color="#ff8a3a" stop-opacity="0"/></radialGradient>
251
+ <radialGradient id="nwEarth" cx="40%" cy="40%" r="60%"><stop offset="0" stop-color="#6fb8ff"/><stop offset="1" stop-color="#123a7a"/></radialGradient>
252
+ </defs>
253
+ <rect width="320" height="200" fill="#060a1f"/>
254
+ <rect width="320" height="200" fill="url(#nwSun)"/>
255
+ <path d="M250 20 Q120 30 95 100 Q120 170 250 180" fill="none" stroke="#ff9a50" stroke-width="2" stroke-opacity=".7"/>
256
+ <path d="M215 35 Q130 45 112 100 Q130 155 215 165" fill="none" stroke="#4fb5ff" stroke-width="2.5" stroke-opacity=".85"/>
257
+ <path d="M112 100 Q60 70 0 75 M112 100 Q60 130 0 125" fill="none" stroke="#4fb5ff" stroke-width="1.5" stroke-opacity=".5"/>
258
+ <circle cx="140" cy="100" r="14" fill="url(#nwEarth)"/>
259
+ <g fill="#fff">
260
+ <circle cx="205" cy="62" r="3.2"/><circle cx="214" cy="70" r="3.2"/><circle cx="199" cy="74" r="3.2"/>
261
+ <circle cx="122" cy="148" r="3.2"/><circle cx="92" cy="58" r="3.2"/><circle cx="60" cy="112" r="3.2"/><circle cx="182" cy="132" r="3.2"/>
262
+ </g>
263
+ <g stroke="#fff" stroke-opacity=".25" stroke-dasharray="2 3"><path d="M205 62 L214 70 L199 74 Z"/></g>
264
+ <text x="12" y="188" fill="#9fb2ff" font-size="11" font-family="sans-serif">7 × spacecraft</text>
265
+ </svg>
266
+ </div>
267
+ <div class="news-body">
268
+ <p class="news-date" data-i18n="nw.date"></p>
269
+ <h3 data-i18n="nw.head"></h3>
270
+ <p data-i18n="nw.text"></p>
271
+ <ul>
272
+ <li data-i18n="nw.p1"></li>
273
+ <li data-i18n="nw.p2"></li>
274
+ <li data-i18n="nw.p3"></li>
275
+ <li data-i18n="nw.p4"></li>
276
+ </ul>
277
+ <div class="news-why"><strong data-i18n="nw.whyT"></strong><p data-i18n="nw.why"></p></div>
278
+ <a class="btn primary small" href="https://www.esa.int/articles/about-us/directorates/science/seven-spacecraft-observatory-to-study-plasma-universe" target="_blank" rel="noopener" data-i18n="nw.link"></a>
279
+ </div>
280
+ </article>
281
+ </section>
282
+
283
  <!-- ========================================================== MOP -->
284
  <section id="mop" class="section mop">
285
  <div class="mop-inner">
 
289
  <a class="btn primary" href="https://www.lsr.hku.hk/MOP/index.html" target="_blank" rel="noopener" data-i18n="mop.link"></a>
290
  </div>
291
  </section>
292
+
293
+ <!-- =================================================== REFERENCES -->
294
+ <section id="refs" class="section refs">
295
+ <h2 data-i18n="rf.title"></h2>
296
+ <p class="lead" data-i18n="rf.sub"></p>
297
+ <div class="refs-grid">
298
+ <div>
299
+ <h3 data-i18n="rf.books"></h3>
300
+ <ol>
301
+ <li>Kivelson, M. G., &amp; Russell, C. T. (Eds.) (1995). <em>Introduction to Space Physics</em>. Cambridge University Press.</li>
302
+ <li>Bagenal, F., Dowling, T. E., &amp; McKinnon, W. B. (Eds.) (2004). <em>Jupiter: The Planet, Satellites and Magnetosphere</em>. Cambridge University Press.</li>
303
+ <li>Kivelson, M. G., &amp; Bagenal, F. (2014). Planetary magnetospheres. In <em>Encyclopedia of the Solar System</em> (3rd ed.). Elsevier.</li>
304
+ <li>Bhardwaj, A., &amp; Gladstone, G. R. (2000). Auroral emissions of the giant planets. <em>Reviews of Geophysics</em>, 38(3), 295–353.</li>
305
+ <li>Grodent, D. (2015). A brief review of ultraviolet auroral emissions on giant planets. <em>Space Science Reviews</em>, 187, 23–50.</li>
306
+ <li>Bagenal, F., &amp; Dols, V. (2020). The space environment of Io and Europa. <em>Journal of Geophysical Research: Space Physics</em>, 125.</li>
307
+ </ol>
308
+ </div>
309
+ <div>
310
+ <h3 data-i18n="rf.papers"></h3>
311
+ <ol start="7">
312
+ <li>Shue, J.-H., et al. (1997). A new functional form to study the solar wind control of the magnetopause size and shape. <em>Journal of Geophysical Research</em>, 102(A5), 9497–9511. <span class="ref-note">(magnetopause shape used in the 3D model)</span></li>
313
+ <li>Ness, N. F., et al. (1986). Magnetic fields at Uranus. <em>Science</em>, 233, 85–89.</li>
314
+ <li>Ness, N. F., et al. (1989). Magnetic fields at Neptune. <em>Science</em>, 246, 1473–1478.</li>
315
+ <li>Kivelson, M. G., et al. (1996). Discovery of Ganymede's magnetic field by the Galileo spacecraft. <em>Nature</em>, 384, 537–541.</li>
316
+ <li>Dougherty, M. K., et al. (2006). Identification of a dynamic atmosphere at Enceladus with the Cassini magnetometer. <em>Science</em>, 311, 1406–1409.</li>
317
+ <li>Lamy, L., et al. (2012). Earth-based detection of Uranus' aurorae. <em>Geophysical Research Letters</em>, 39, L07105.</li>
318
+ <li>Grasset, O., et al. (2013). JUpiter ICy moons Explorer (JUICE): An ESA mission to orbit Ganymede and to characterise the Jupiter system. <em>Planetary and Space Science</em>, 78, 1–21.</li>
319
+ <li>Saur, J., et al. (2015). The search for a subsurface ocean in Ganymede with Hubble Space Telescope observations of its auroral ovals. <em>Journal of Geophysical Research: Space Physics</em>, 120, 1715–1737.</li>
320
+ <li>Connerney, J. E. P., et al. (2017). Jupiter's magnetosphere and aurorae observed by the Juno spacecraft during its first polar orbits. <em>Science</em>, 356, 826–832.</li>
321
+ <li>Melin, H., et al. (2025). Discovery of H<sub>3</sub><sup>+</sup> and infrared aurorae at Neptune with JWST. <em>Nature Astronomy</em>.</li>
322
+ </ol>
323
+ </div>
324
+ <div>
325
+ <h3 data-i18n="rf.missions"></h3>
326
+ <ul>
327
+ <li><a href="https://science.nasa.gov/mission/voyager/" target="_blank" rel="noopener">NASA Voyager 1 &amp; 2</a></li>
328
+ <li><a href="https://science.nasa.gov/mission/galileo/" target="_blank" rel="noopener">NASA Galileo</a></li>
329
+ <li><a href="https://science.nasa.gov/mission/cassini/" target="_blank" rel="noopener">NASA–ESA–ASI Cassini–Huygens</a></li>
330
+ <li><a href="https://science.nasa.gov/mission/juno/" target="_blank" rel="noopener">NASA Juno</a></li>
331
+ <li><a href="https://science.nasa.gov/mission/hubble/" target="_blank" rel="noopener">NASA–ESA Hubble Space Telescope</a></li>
332
+ <li><a href="https://science.nasa.gov/mission/webb/" target="_blank" rel="noopener">NASA–ESA–CSA James Webb Space Telescope</a></li>
333
+ <li><a href="https://www.esa.int/Science_Exploration/Space_Science/Juice" target="_blank" rel="noopener">ESA JUICE</a></li>
334
+ <li><a href="https://science.nasa.gov/mission/europa-clipper/" target="_blank" rel="noopener">NASA Europa Clipper</a></li>
335
+ <li><a href="https://www.lsr.hku.hk/MOP/index.html" target="_blank" rel="noopener">MOP 2028 conference, The University of Hong Kong</a></li>
336
+ </ul>
337
+ <h3 data-i18n="rf.res"></h3>
338
+ <ul>
339
+ <li>Planet and moon textures: <a href="https://www.solarsystemscope.com/textures/" target="_blank" rel="noopener">Solar System Scope</a> (CC BY 4.0), NASA / USGS mosaics, via <a href="https://huggingface.co/spaces/AK51/SatelliteMap" target="_blank" rel="noopener">AK51/SatelliteMap</a></li>
340
+ <li>Spacecraft shapes (simplified) based on NASA and ESA reference models: <a href="https://github.com/nasa/NASA-3D-Resources" target="_blank" rel="noopener">NASA 3D Resources</a>, <a href="https://scifleet.esa.int/" target="_blank" rel="noopener">ESA SciFleet</a></li>
341
+ <li>3D graphics: <a href="https://threejs.org/" target="_blank" rel="noopener">three.js</a></li>
342
+ </ul>
343
+ <h3 data-i18n="rf.news"></h3>
344
+ <ul>
345
+ <li>ESA (19 November 2026). <a href="https://www.esa.int/articles/about-us/directorates/science/seven-spacecraft-observatory-to-study-plasma-universe" target="_blank" rel="noopener">Seven-spacecraft observatory to study plasma universe</a>.</li>
346
+ </ul>
347
+ </div>
348
+ </div>
349
+ </section>
350
  </main>
351
 
352
  <footer class="footer">
353
+ <p class="credit" data-i18n="ft.by"></p>
354
  <p data-i18n="ft.note"></p>
355
  <p data-i18n="ft.sources"></p>
356
  <p data-i18n="ft.tex"></p>
js/i18n.js CHANGED
@@ -8,7 +8,7 @@ export const I18N = {
8
  en: {
9
  meta: { title: "Magnetospheres of the Outer Planets · 3D Explorer" },
10
  brand: "Outer Planets",
11
- nav: { explore: "3D Explorer", how: "How it works", aurora: "Aurora", compare: "Size", why: "Why study", missions: "Missions", quiz: "Quiz", mop: "MOP 2028" },
12
  hero: {
13
  kicker: "Inspired by the MOP 2028 conference · Hong Kong",
14
  title: "Magnetospheres of the Outer Planets",
@@ -21,6 +21,19 @@ export const I18N = {
21
  layers: "Layers",
22
  notscale: "Not to scale: distances are compressed so everything fits on screen.",
23
  speed: "Time speed",
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  views: "Camera",
25
  tour: "Guided tour",
26
  tourStart: "▶ Start guided tour",
@@ -166,7 +179,33 @@ export const I18N = {
166
  date: "10–14 January 2028 · LE1, Library Extension Building, The University of Hong Kong",
167
  link: "Visit the MOP 2028 website"
168
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  ft: {
 
170
  note: "Made for students and the public. The 3D scenes are simplified and not to scale; aurora colours on the giant planets are false colour.",
171
  sources: "Facts from NASA, ESA, the MOP 2028 conference and published research.",
172
  learn: "Learn more"
@@ -177,7 +216,7 @@ export const I18N = {
177
  "zh-Hans": {
178
  meta: { title: "外行星磁层 · 3D 探索" },
179
  brand: "外行星磁层",
180
- nav: { explore: "3D 探索", how: "运作原理", aurora: "极光", compare: "大小比较", why: "为何研究", missions: "探测任务", quiz: "小测验", mop: "MOP 2028" },
181
  hero: {
182
  kicker: "灵感来自 2028 年香港 MOP 国际会议",
183
  title: "外行星磁层",
@@ -190,6 +229,19 @@ export const I18N = {
190
  layers: "图层",
191
  notscale: "非真实比例:为了在屏幕上显示全部内容,距离已被压缩。",
192
  speed: "时间速度",
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  views: "视角",
194
  tour: "导览",
195
  tourStart: "▶ 开始导览",
@@ -335,7 +387,33 @@ export const I18N = {
335
  date: "2028 年 1 月 10–14 日 · 香港大学图书馆新翼 LE1 演讲厅",
336
  link: "浏览 MOP 2028 网站"
337
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
  ft: {
 
339
  note: "为学生和公众制作。3D 场景经过简化,并非真实比例;巨行星的极光颜色为假色。",
340
  sources: "资料来自 NASA、欧空局、MOP 2028 会议及已发表的研究。",
341
  learn: "延伸阅读"
@@ -346,7 +424,7 @@ export const I18N = {
346
  "zh-Hant": {
347
  meta: { title: "外行星磁層 · 3D 探索" },
348
  brand: "外行星磁層",
349
- nav: { explore: "3D 探索", how: "運作原理", aurora: "極光", compare: "大小比較", why: "為何研究", missions: "探測任務", quiz: "小測驗", mop: "MOP 2028" },
350
  hero: {
351
  kicker: "靈感來自 2028 年香港 MOP 國際會議",
352
  title: "外行星磁層",
@@ -359,6 +437,19 @@ export const I18N = {
359
  layers: "圖層",
360
  notscale: "非真實比例:為了在螢幕上顯示全部內容,距離已被壓縮。",
361
  speed: "時間速度",
 
 
 
 
 
 
 
 
 
 
 
 
 
362
  views: "視角",
363
  tour: "導覽",
364
  tourStart: "▶ 開始導覽",
@@ -504,7 +595,33 @@ export const I18N = {
504
  date: "2028 年 1 月 10–14 日 · 香港大學圖書館新翼 LE1 演講廳",
505
  link: "瀏覽 MOP 2028 網站"
506
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
507
  ft: {
 
508
  note: "為學生和公眾製作。3D 場景經過簡化,並非真實比例;巨行星的極光顏色為假色。",
509
  sources: "資料來自 NASA、歐洲太空總署、MOP 2028 會議及已發表的研究。",
510
  learn: "延伸閱讀"
 
8
  en: {
9
  meta: { title: "Magnetospheres of the Outer Planets · 3D Explorer" },
10
  brand: "Outer Planets",
11
+ nav: { explore: "3D Explorer", how: "How it works", aurora: "Aurora", compare: "Size", why: "Why study", missions: "Missions", quiz: "Quiz", news: "News", refs: "References", mop: "MOP 2028" },
12
  hero: {
13
  kicker: "Inspired by the MOP 2028 conference · Hong Kong",
14
  title: "Magnetospheres of the Outer Planets",
 
21
  layers: "Layers",
22
  notscale: "Not to scale: distances are compressed so everything fits on screen.",
23
  speed: "Time speed",
24
+ wind: "Solar wind strength",
25
+ windCalm: "Calm",
26
+ windNormal: "Normal",
27
+ windStrong: "Strong",
28
+ windStorm: "Storm",
29
+ windReset: "↺ Normal",
30
+ storm: "⚡ Launch a solar storm (CME)",
31
+ windHint: "Drag the slider: a stronger solar wind squeezes the magnetosphere towards the planet and makes the aurora brighter and wider. Or launch a cloud of solar plasma and watch it hit.",
32
+ hideUi: "Hide menus",
33
+ showUi: "Show menus",
34
+ mSize: "Magnetopause",
35
+ mRadii: "≈ {n} planet radii",
36
+ mAurora: "Aurora power",
37
  views: "Camera",
38
  tour: "Guided tour",
39
  tourStart: "▶ Start guided tour",
 
179
  date: "10–14 January 2028 · LE1, Library Extension Building, The University of Hong Kong",
180
  link: "Visit the MOP 2028 website"
181
  },
182
+ nw: {
183
+ title: "Latest news",
184
+ tag: "New",
185
+ pill: "ESA picks a 7-spacecraft Plasma Observatory",
186
+ sub: "Plasma research is moving fast. Here is the newest big decision about studying the plasma universe.",
187
+ date: "19 November 2026 · ESA",
188
+ head: "Seven-spacecraft observatory to study the plasma universe",
189
+ text: "ESA's Member States have chosen Plasma Observatory as the agency's next medium-class (M7) mission. Seven spacecraft flying in formation will, for the first time, follow how the Sun's energy moves through Earth's magnetic shield at many scales of distance and time at once.",
190
+ p1: "Plasma, a gas of charged particles, makes up more than 99% of the visible Universe, from the Sun and stars to the solar wind.",
191
+ p2: "ESA's earlier four-spacecraft Cluster mission found that the solar wind interacts with Earth's magnetosphere on scales from a few kilometres to tens of thousands of kilometres, and from milliseconds to minutes. However, it could only study one scale at a time.",
192
+ p3: "Plasma Observatory will measure magnetic fields, electric fields and particles in seven places at once, linking small, fast events to large changes in the magnetosphere.",
193
+ p4: "It is the first mission of ESA's Voyage 2050 programme. Launch is foreseen for the late 2030s.",
194
+ whyT: "Why it matters for the outer planets",
195
+ why: "Earth's magnetosphere is the closest natural laboratory for plasma. The same processes, such as shocks, magnetic reconnection and the energy that powers aurora, happen in the giant magnetospheres of Jupiter, Saturn, Uranus and Neptune, which spacecraft visit only rarely. Understanding them at Earth helps scientists interpret what they see there.",
196
+ link: "Read the full story at ESA"
197
+ },
198
+ rf: {
199
+ title: "References",
200
+ sub: "The facts, numbers and models on this site come from these sources. Students can use them to read further.",
201
+ books: "Books and reviews",
202
+ papers: "Research papers",
203
+ missions: "Missions and agencies",
204
+ res: "Images, textures, 3D models and software",
205
+ news: "News"
206
+ },
207
  ft: {
208
+ by: "Created by Andy Kong",
209
  note: "Made for students and the public. The 3D scenes are simplified and not to scale; aurora colours on the giant planets are false colour.",
210
  sources: "Facts from NASA, ESA, the MOP 2028 conference and published research.",
211
  learn: "Learn more"
 
216
  "zh-Hans": {
217
  meta: { title: "外行星磁层 · 3D 探索" },
218
  brand: "外行星磁层",
219
+ nav: { explore: "3D 探索", how: "运作原理", aurora: "极光", compare: "大小比较", why: "为何研究", missions: "探测任务", quiz: "小测验", news: "最新消息", refs: "参考资料", mop: "MOP 2028" },
220
  hero: {
221
  kicker: "灵感来自 2028 年香港 MOP 国际会议",
222
  title: "外行星磁层",
 
229
  layers: "图层",
230
  notscale: "非真实比例:为了在屏幕上显示全部内容,距离已被压缩。",
231
  speed: "时间速度",
232
+ wind: "太阳风强度",
233
+ windCalm: "平静",
234
+ windNormal: "正常",
235
+ windStrong: "强",
236
+ windStorm: "风暴",
237
+ windReset: "↺ 正常",
238
+ storm: "⚡ 发射太阳风暴(日冕物质抛射)",
239
+ windHint: "拖动滑杆:太阳风越强,磁层就被压得越靠近行星,极光也会变得更亮、范围更大。也可以发射一团太阳等离子体,看看它撞上磁层的情形。",
240
+ hideUi: "隐藏菜单",
241
+ showUi: "显示菜单",
242
+ mSize: "磁层顶距离",
243
+ mRadii: "≈ {n} 个行星半径",
244
+ mAurora: "极光强度",
245
  views: "视角",
246
  tour: "导览",
247
  tourStart: "▶ 开始导览",
 
387
  date: "2028 年 1 月 10–14 日 · 香港大学图书馆新翼 LE1 演讲厅",
388
  link: "浏览 MOP 2028 网站"
389
  },
390
+ nw: {
391
+ title: "最新消息",
392
+ tag: "新",
393
+ pill: "ESA 选定七航天器“等离子体天文台”",
394
+ sub: "等离子体研究发展迅速。以下是研究“等离子体宇宙”的最新重大决定。",
395
+ date: "2026 年 11 月 19 日 · 欧洲空间局(ESA)",
396
+ head: "七颗航天器组成的天文台,研究等离子体宇宙",
397
+ text: "欧洲空间局成员国选定“等离子体天文台”(Plasma Observatory)为下一个中型(M7)任务。七颗编队飞行的航天器将首次在多个距离和时间尺度上,同时追踪太阳的能量如何穿过地球的磁场屏障。",
398
+ p1: "等离子体是由带电粒子组成的气体,占可见宇宙物质的 99% 以上,太阳、恒星和太阳风都是等离子体。",
399
+ p2: "ESA 早前由四颗航天器组成的 Cluster 任务发现,太阳风与地球磁层的相互作用,尺度从几公里到几万公里,时间从几毫秒到几分钟不等,但它每次只能研究一种尺度。",
400
+ p3: "等离子体天文台将在七个位置同时测量磁场、电场和粒子,把细小而快速的事件与磁层的大尺度变化联系起来。",
401
+ p4: "这是 ESA“远航 2050”(Voyage 2050)计划的第一个任务,预计于 2030 年代后期发射。",
402
+ whyT: "这对外行星研究有什么意义?",
403
+ why: "地球磁层是离我们最近的天然等离子体实验室。激波、磁重联以及驱动极光的能量传递等过程,同样发生在木星、土星、天王星和海王星的巨大磁层中,而航天器很少能到达那里。先在地球弄清这些过程,科学家就能更好地解读外行星的观测结果。",
404
+ link: "在 ESA 网站阅读全文(英文)"
405
+ },
406
+ rf: {
407
+ title: "参考资料",
408
+ sub: "本网站的资料、数据和模型来自以下来源,同学们可以用来进一步阅读。",
409
+ books: "书籍与综述",
410
+ papers: "研究论文",
411
+ missions: "探测任务与航天机构",
412
+ res: "图像、纹理、3D 模型与软件",
413
+ news: "新闻"
414
+ },
415
  ft: {
416
+ by: "由 Andy Kong 制作",
417
  note: "为学生和公众制作。3D 场景经过简化,并非真实比例;巨行星的极光颜色为假色。",
418
  sources: "资料来自 NASA、欧空局、MOP 2028 会议及已发表的研究。",
419
  learn: "延伸阅读"
 
424
  "zh-Hant": {
425
  meta: { title: "外行星磁層 · 3D 探索" },
426
  brand: "外行星磁層",
427
+ nav: { explore: "3D 探索", how: "運作原理", aurora: "極光", compare: "大小比較", why: "為何研究", missions: "探測任務", quiz: "小測驗", news: "最新消息", refs: "參考資料", mop: "MOP 2028" },
428
  hero: {
429
  kicker: "靈感來自 2028 年香港 MOP 國際會議",
430
  title: "外行星磁層",
 
437
  layers: "圖層",
438
  notscale: "非真實比例:為了在螢幕上顯示全部內容,距離已被壓縮。",
439
  speed: "時間速度",
440
+ wind: "太陽風強度",
441
+ windCalm: "平靜",
442
+ windNormal: "正常",
443
+ windStrong: "強",
444
+ windStorm: "風暴",
445
+ windReset: "↺ 正常",
446
+ storm: "⚡ 發射太陽風暴(日冕物質拋射)",
447
+ windHint: "拖動滑桿:太陽風越強,磁層就被壓得越靠近行星,極光也會變得更亮、範圍更大。也可以發射一團太陽等離子體,看看它撞上磁層的情形。",
448
+ hideUi: "隱藏選單",
449
+ showUi: "顯示選單",
450
+ mSize: "磁層頂距離",
451
+ mRadii: "≈ {n} 個行星半徑",
452
+ mAurora: "極光強度",
453
  views: "視角",
454
  tour: "導覽",
455
  tourStart: "▶ 開始導覽",
 
595
  date: "2028 年 1 月 10–14 日 · 香港大學圖書館新翼 LE1 演講廳",
596
  link: "瀏覽 MOP 2028 網站"
597
  },
598
+ nw: {
599
+ title: "最新消息",
600
+ tag: "新",
601
+ pill: "ESA 選定七太空船「等離子體天文台」",
602
+ sub: "等離子體研究發展迅速。以下是研究「等離子體宇宙」的最新重大決定。",
603
+ date: "2026 年 11 月 19 日 · 歐洲太空總署(ESA)",
604
+ head: "七艘太空船組成的天文台,研究等離子體宇宙",
605
+ text: "歐洲太空總署成員國選定「等離子體天文台」(Plasma Observatory)為下一個中型(M7)任務。七艘編隊飛行的太空船將首次在多個距離和時間尺度上,同時追蹤太陽的能量如何穿過地球的磁場屏障。",
606
+ p1: "等離子體是由帶電粒子組成的氣體,佔可見宇宙物質的 99% 以上,太陽、恆星和太陽風都是等離子體。",
607
+ p2: "ESA 早前由四艘太空船組成的 Cluster 任務發現,太陽風與地球磁層的相互作用,尺度從幾公里到幾萬公里,時間從幾毫秒到幾分鐘不等,但它每次只能研究一種尺度。",
608
+ p3: "等離子體天文台將在七個位置同時測量磁場、電場和粒子,把細小而快速的事件與磁層的大尺度變化聯繫起來。",
609
+ p4: "這是 ESA「遠航 2050」(Voyage 2050)計劃的第一個任務,預計於 2030 年代後期發射。",
610
+ whyT: "這對外行星研究有甚麼意義?",
611
+ why: "地球磁層是離我們最近的天然等離子體實驗室。激波、磁重聯以及驅動極光的能量傳遞等過程,同樣發生在木星、土星、天王星和海王星的巨大磁層中,而太空船很少能到達那裏。先在地球弄清這些過程,科學家就能更好地解讀外行星的觀測結果。",
612
+ link: "在 ESA 網站閱讀全文(英文)"
613
+ },
614
+ rf: {
615
+ title: "參考資料",
616
+ sub: "本網站的資料、數據和模型來自以下來源,同學們可以用來進一步閱讀。",
617
+ books: "書籍與綜述",
618
+ papers: "研究論文",
619
+ missions: "探測任務與太空機構",
620
+ res: "圖像、紋理、3D 模型與軟件",
621
+ news: "新聞"
622
+ },
623
  ft: {
624
+ by: "由 Andy Kong 製作",
625
  note: "為學生和公眾製作。3D 場景經過簡化,並非真實比例;巨行星的極光顏色為假色。",
626
  sources: "資料來自 NASA、歐洲太空總署、MOP 2028 會議及已發表的研究。",
627
  learn: "延伸閱讀"
js/i18n_moons.js CHANGED
@@ -1,123 +1,126 @@
1
- // Moon names, descriptions and the moon section text, merged into I18N by main.js.
2
-
3
- export const MOON_I18N = {
4
- en: {
5
- nav: { moons: "Moons" },
6
- moons: {
7
- moon: "Moon", io: "Io", europa: "Europa", ganymede: "Ganymede", callisto: "Callisto",
8
- mimas: "Mimas", enceladus: "Enceladus", tethys: "Tethys", dione: "Dione", rhea: "Rhea", titan: "Titan", iapetus: "Iapetus",
9
- miranda: "Miranda", ariel: "Ariel", umbriel: "Umbriel", titania: "Titania", oberon: "Oberon", triton: "Triton"
10
- },
11
- mn: {
12
- title: "Moons inside the magnetospheres",
13
- sub: "The giant planets’ moons sit inside their magnetic bubbles. Some feed them with gas, some glow in their own aurora, and some hide oceans that the magnetic field helps us find. Spin a globe, then fly to the moon in 3D. You can also click any moon in the 3D explorer.",
14
- fly: "Fly to it in 3D",
15
- back: "← Back to planet",
16
- dia: "Diameter", dist: "Distance from planet", period: "Orbit period", host: "Orbits",
17
- days: "days", retro: "backwards (retrograde)", km: "km",
18
- clickHint: "Tip: click a moon in 3D to learn about it.",
19
- roleTitle: "In the magnetosphere"
20
- },
21
- mo: {
22
- moon: { tag: "Earth’s only natural satellite", text: "The Moon has no global magnetic field and almost no atmosphere, so the solar wind hits its surface directly. For a few days each month it passes through Earth’s magnetotail, where it is bathed in plasma from Earth instead." },
23
- io: { tag: "Volcano world · plasma source", text: "The most volcanic world in the solar system. Its volcanoes release about one tonne of gas every second, which is ionised to form the Io plasma torus. As Jupiter’s field sweeps past, Io drives an electric current of millions of amperes along its flux tube, leaving a bright auroral footprint in Jupiter’s atmosphere." },
24
- europa: { tag: "Ocean world", text: "A salty ocean lies beneath its icy shell. Galileo found the ocean through the magnetic field it induces as Jupiter’s field sweeps past. Radiation splits the surface ice and makes a thin oxygen atmosphere. Europa Clipper will study it from 2030." },
25
- ganymede: { tag: "The moon with its own magnetosphere", text: "The largest moon in the solar system, and the only one with its own magnetic field: a mini-magnetosphere inside Jupiter’s, with its own aurora. In 2015 Hubble watched those aurora rock back and forth less than expected, revealing a salty ocean beneath the ice. JUICE will orbit Ganymede from 2034." },
26
- callisto: { tag: "Ancient cratered world", text: "One of the most heavily cratered surfaces in the solar system. Galileo detected a magnetic signal induced inside Callisto, a hint that a deep salty ocean may exist. It lies outside Jupiter’s main radiation belts, so it would be a safer place for future explorers." },
27
- mimas: { tag: "The ‘Death Star’ moon", text: "The giant Herschel crater makes Mimas look like the Death Star. Its gravity helps shape the Cassini Division in Saturn’s rings, and in 2024 scientists reported that it may hide a young ocean." },
28
- enceladus: { tag: "Geysers · main plasma source", text: "Geysers near its south pole spray water vapour and ice into space from an ocean below. This water is the main source of plasma in Saturn’s magnetosphere and feeds the E ring. Cassini flew through the plumes and tasted salts and organic molecules." },
29
- tethys: { tag: "Icy moon in the plasma", text: "An icy moon with a huge canyon, Ithaca Chasma. Electrons from Saturn’s magnetosphere bombard its surface and change its colour and brightness in patterns that follow the plasma flow." },
30
- dione: { tag: "Thin oxygen atmosphere", text: "Cassini found a very thin layer of oxygen around Dione, made when charged particles and sunlight split water ice. Dione may also have an ocean deep below its crust." },
31
- rhea: { tag: "Saturn’s second-largest moon", text: "In 2010 Cassini detected a thin atmosphere of oxygen and carbon dioxide around Rhea, kept topped up as Saturn’s magnetospheric particles hit its icy surface." },
32
- titan: { tag: "Thick atmosphere, methane lakes", text: "Larger than Mercury, with a thick nitrogen atmosphere and lakes of liquid methane. It has no magnetic field of its own, so Saturn’s field and plasma drape around its atmosphere. Huygens landed in 2005, and NASA’s Dragonfly drone is planned to arrive in the 2030s." },
33
- iapetus: { tag: "The two-tone moon", text: "Half bright and half dark, with a tall ridge around its equator. It orbits so far from Saturn that it spends its time outside the magnetosphere, in the solar wind." },
34
- miranda: { tag: "Patchwork world", text: "A jumble of giant cliffs and grooves. Verona Rupes may be the tallest cliff in the solar system, about 20 km high. Voyager 2 photographed it in 1986." },
35
- ariel: { tag: "CO₂ ice from the magnetosphere?", text: "The brightest of Uranus’s large moons, crossed by young canyons. JWST found carbon dioxide ice concentrated on one side, possibly made by charged particles from Uranus’s magnetosphere hitting the surface." },
36
- umbriel: { tag: "The darkest moon of Uranus", text: "The darkest of Uranus’s large moons, with a mysterious bright ring called Wunda near its equator." },
37
- titania: { tag: "Uranus’s largest moon", text: "Titania may hold a thin ocean between its rocky core and icy crust, which makes it a key target for a future Uranus orbiter and its magnetometer." },
38
- oberon: { tag: "In and out of the magnetosphere", text: "The outermost large moon of Uranus. Part of its orbit lies beyond the magnetopause, so its surface is exposed to both the solar wind and Uranus’s magnetospheric plasma." },
39
- triton: { tag: "Captured world with geysers", text: "Probably a captured Kuiper Belt object, because it orbits backwards. Voyager 2 saw nitrogen geysers in 1989. Neptune’s tilted field sweeps over Triton as the planet spins, and its atmosphere may supply nitrogen to Neptune’s magnetosphere. It may also hide an ocean." }
40
- },
41
- ft: { tex: "Planet and Moon textures: Solar System Scope (CC BY 4.0), based on NASA imagery. Moon mosaics: NASA/JPL/USGS (Galileo, Cassini, Voyager), via NOAA Science On a Sphere." }
42
- },
43
-
44
- "zh-Hans": {
45
- nav: { moons: "卫星" },
46
- moons: {
47
- moon: "月球", io: "木卫一", europa: "木卫二", ganymede: "木卫三", callisto: "木卫四",
48
- mimas: "土卫一", enceladus: "土卫二", tethys: "土卫三", dione: "土卫四", rhea: "土卫五", titan: "土卫六", iapetus: "土卫八",
49
- miranda: "天卫五", ariel: "天卫一", umbriel: "天卫二", titania: "天卫三", oberon: "天卫四", triton: "海卫一"
50
- },
51
- mn: {
52
- title: "磁层中的卫星",
53
- sub: "巨行星的卫星都处在磁“泡泡”之中:有的为磁层提供气体,有的拥有自己的极光,有的藏着海洋,而磁场正是帮助我们找到海洋的线索。转动下面的星球,再在 3D 中飞过去看看。你也可以在 3D 探索中直接点击任何卫星。",
54
- fly: "在 3D 中飞过去",
55
- back: "← 返回行星",
56
- dia: "直径", dist: "与行星距离", period: "公转周期", host: "环绕",
57
- days: "天", retro: "逆向公转", km: "公里",
58
- clickHint: "提示:在 3D 中点击卫星即可查看介绍。",
59
- roleTitle: "在磁层中的角色"
60
- },
61
- mo: {
62
- moon: { full: "月球", tag: "地球唯一的天然卫星", text: "月球没有全球磁场,也几乎没有大气,太阳风直接打在它的表面。每个月有几天,月球会穿过地球的磁尾,改为沐浴在来自地球的等离子体中。" },
63
- io: { full: "木卫一(艾奥)", tag: "火山世界 · 等离子体来源", text: "太阳系中火山活动最剧烈的天体。火山每秒释放约一吨气体,气体被电离后形成木卫一等离子体环。当木星磁场扫过时,木卫一沿着磁通管驱动高达数百万安培的电流,在木星大气中留下明亮的极光“足迹”。" },
64
- europa: { full: "木卫二(欧罗巴)", tag: "海洋世界", text: "冰壳之下有一片咸水海洋。伽利略号通过木星磁场扫过时海洋感应出的磁场发现了它。辐射分解表面的冰,形成稀薄的氧气大气。欧罗巴快船将于 2030 年起研究它。" },
65
- ganymede: { full: "木卫三(盖尼米得)", tag: "拥有自己磁层的卫星", text: "太阳系最大的卫星,也是唯一拥有自身磁场的卫星:在木星磁层之内还有一个迷你磁层,并有自己的极光。2015 年,哈勃发现这些极光的摆动比预期小,揭示冰层下有咸水海洋。JUICE 将于 2034 年起环绕木卫三运行。" },
66
- callisto: { full: "木卫四(卡利斯托)", tag: "古老的陨石坑世界", text: "太阳系中陨石坑最密集的表面之一。伽利略号在木卫四内部探测到感应磁场信号,暗示可能存在深层咸水海洋。它位于木星主要辐射带之外,对未来的探索者来说较为安全。" },
67
- mimas: { full: "土卫一(弥玛斯)", tag: "“死星”卫星", text: "巨大的赫歇尔陨石坑令它看起来像电影中的“死星”。它的引力帮助塑造了土星光环中的卡西尼缝;2024 年科学家报告它可能藏有一个年轻的海洋。" },
68
- enceladus: { full: "土卫二(恩克拉多斯)", tag: "喷泉 · 主要等离子体来源", text: "南极附近的喷泉把下方海洋的水汽和冰粒喷向太空。这些水是土星磁层等离子体的主要来源,也补充了 E 环。卡西尼号曾穿过羽流,“尝”到盐分和有机分子。" },
69
- tethys: { full: "土卫三(特提斯)", tag: "等离子体中的冰卫星", text: "拥有巨大峡谷“伊萨卡深谷”的冰卫星。土星磁层的电子轰击它的表面,按照等离子体流动的方向改变表面的颜色和亮度。" },
70
- dione: { full: "土卫四(狄俄涅)", tag: "稀薄的氧气大气", text: "卡西尼号在土卫四周围发现极稀薄的氧气层,是带电粒子和阳光分解水冰而成。土卫四的地壳深处也可能有海洋。" },
71
- rhea: { full: "土卫五(瑞亚)", tag: "土星第二大卫星", text: "2010 年,卡西尼号在土卫五周围探测到由氧和二氧化碳组成的稀薄大气,土星磁层粒子撞击冰面不断为它补充气体。" },
72
- titan: { full: "土卫六(泰坦)", tag: "浓厚大气与甲烷湖", text: "比水星还大,拥有浓厚的氮气大气和液态甲烷湖。它没有自己的磁场,所以土星的磁场和等离子体会包裹着它的大气。惠更斯号于 2005 年着陆,NASA 的“蜻蜓号”无人机计划在 2030 年代抵达。" },
73
- iapetus: { full: "土卫八(伊阿珀托斯)", tag: "黑白双色卫星", text: "一半明亮、一半黝黑,赤道上还有一道高耸的山脊。它离土星很远,大部分时间位于磁层之外的太阳风中。" },
74
- miranda: { full: "天卫五(米兰达)", tag: "拼凑而成的世界", text: "布满巨大悬崖和沟槽。维罗纳断崖高约 20 公里,可能是太阳系最高的悬崖。旅行者 2 号在 1986 年拍下了它。" },
75
- ariel: { full: "天卫一(艾瑞尔)", tag: "来自磁层的二氧化碳冰?", text: "天王星大卫星中最明亮的一颗,表面有年轻的峡谷。韦布望远镜发现二氧化碳冰集中在它的一侧,可能是天王星磁层的带电粒子撞击表面造成的。" },
76
- umbriel: { full: "天卫二(乌姆柏里厄尔)", tag: "天王星最暗的卫星", text: "天王星大卫星中最暗的一颗,赤道附近有一个神秘的明亮圆环,名为“温达”。" },
77
- titania: { full: "天卫三(泰坦尼亚)", tag: "天王星最大的卫星", text: "天卫三的岩石核心与冰壳之间可能有一层薄薄的海洋,是未来天王星轨道器及其磁强计的重要目标。" },
78
- oberon: { full: "天卫四(奥伯龙)", tag: "进出磁层的卫星", text: "天王星最外侧的大卫星。它的部分轨道位于磁层顶以外,所以表面同时受到太阳风和天王星磁层等离子体的冲击。" },
79
- triton: { full: "海卫一(特里同)", tag: "被俘获、有喷泉的世界", text: "它逆向公转,很可能是被海王星俘获的柯伊伯带天体。旅行者 2 号在 1989 年看到氮气喷泉。海王星倾斜的磁场随自转扫过海卫一,它的大气可能为海王星磁层提供氮。它也可能藏有海洋。" }
80
- },
81
- ft: { tex: "行星与月球纹理:Solar System Scope(CC BY 4.0),基于 NASA 图像。卫星拼接图:NASA/JPL/USGS(伽利略号、卡西尼号、旅行者号),经 NOAA Science On a Sphere 提供。" }
82
- },
83
-
84
- "zh-Hant": {
85
- nav: { moons: "衛星" },
86
- moons: {
87
- moon: "月球", io: "木衛一", europa: "木衛二", ganymede: "木衛三", callisto: "木衛四",
88
- mimas: "土衛一", enceladus: "土衛二", tethys: "土衛三", dione: "土衛四", rhea: "土衛五", titan: "土衛六", iapetus: "土衛八",
89
- miranda: "天衛五", ariel: "天衛一", umbriel: "天衛二", titania: "天衛三", oberon: "天衛四", triton: "海衛一"
90
- },
91
- mn: {
92
- title: "磁層中的衛星",
93
- sub: "巨行星的衛星都處在磁「泡泡」之中:有的為磁層提供氣體,有的擁有自己的極光,有的藏著海洋,而磁場正是幫助我們找到海洋的線索。轉動下面的星球,再在 3D 中飛過去看看。你也可以在 3D 探索中直接點擊任何衛星。",
94
- fly: "在 3D 中飛過去",
95
- back: "← 返回行星",
96
- dia: "直徑", dist: "與行星距離", period: "公轉周期", host: "環繞",
97
- days: "天", retro: "逆向公轉", km: "公里",
98
- clickHint: "提示:在 3D 中點擊衛星即可查看介紹。",
99
- roleTitle: "在磁層中的角色"
100
- },
101
- mo: {
102
- moon: { full: "月球", tag: "地球唯一的天然衛星", text: "月球沒有全球磁場,也幾乎沒有大氣,太陽風直接打在它的表面。每個月有幾天,月球會穿過地球的磁尾,改為沐浴在來自地球的等離子體中。" },
103
- io: { full: "木衛一(艾奧)", tag: "火山世界 · 等離子體來源", text: "太陽系中火山活動最劇烈的天體。火山每秒釋放約一噸氣體,氣體被電離後形成木衛一等離子體環。當木星磁場掃過時,木衛一沿著磁通管驅動高達數百萬安培的電流,在木星大氣中留下明亮的極光「足跡」。" },
104
- europa: { full: "木衛二(歐羅巴)", tag: "海洋世界", text: "冰殼之下有一片鹹水海洋。伽利略號透過木星磁場掃過時海洋感應出的磁場發現了它。輻射分解表面的冰,形成稀薄的氧氣大氣。歐羅巴快船將於 2030 年起研究它。" },
105
- ganymede: { full: "木衛三(甘尼米德)", tag: "擁有自己磁層的衛星", text: "太陽系最大的衛星,也是唯一擁有自身磁場的衛星:在木星磁層之內還有一個迷你磁層,並有自己的極光。2015 年,哈勃發現這些極光的擺動比預期小,揭示冰層下有鹹水海洋。JUICE 將於 2034 年起環繞木衛三運行。" },
106
- callisto: { full: "木衛四(卡利斯多)", tag: "古老的隕石坑世界", text: "太陽系中隕石坑最密集的表面之一。伽利略號在木衛四內部探測到感應磁場訊號,暗示可能存在深層鹹水海洋。它位於木星主要輻射帶之外,對未來的探索者來說較為安全。" },
107
- mimas: { full: "土衛一(彌瑪斯)", tag: "「死星」衛星", text: "巨大的赫歇爾隕石坑令它看起來像電影中的「死星」。它的引力幫助塑造了土星光環中的卡西尼縫;2024 年科學家報告它可能藏有一個年輕的海洋。" },
108
- enceladus: { full: "土衛二(恩塞勒達斯)", tag: "噴泉 · 主要等離子體來源", text: "南極附近的噴泉把下方海洋的水汽和冰粒噴向太空。這些水是土星磁層等離子體的主要來源,也補充了 E 環。卡西尼號曾穿過羽流,「嚐」到鹽分和有機分子。" },
109
- tethys: { full: "土衛三(特提斯)", tag: "等離子體中的冰衛星", text: "擁有巨大峽谷「伊薩卡深谷」的冰衛星。土星磁層的電子轟擊它的表面,按照等離子體流動的方向改變表面的顏色和亮度。" },
110
- dione: { full: "土衛四(狄俄涅)", tag: "稀薄的氧氣大氣", text: "卡西尼號在土衛四周圍發現極稀薄的氧氣層,是帶電粒子和陽光分解水冰而成。土衛四的地殼深處也可能有海洋。" },
111
- rhea: { full: "土衛五(瑞亞)", tag: "土星第二大衛星", text: "2010 年,卡西尼號在土衛五周圍探測到由氧和二氧化碳組成的稀薄大氣,土星磁層粒子撞擊冰面不斷為它補充氣體。" },
112
- titan: { full: "土衛六(泰坦)", tag: "濃厚大氣與甲烷湖", text: "比水星還大,擁有濃厚的氮氣大氣和液態甲烷湖。它沒有自己的磁場,所以土星的磁場和等離子體會包裹著它的大氣。惠更斯號於 2005 年著陸,NASA 的「蜻蜓號」無人機計劃在 2030 年代抵達。" },
113
- iapetus: { full: "土衛八(伊阿珀托斯)", tag: "黑白雙色衛星", text: "一半明亮、一半黝黑,赤道上還有一道高聳的山脊。它離土星很遠,大部分時間位於磁層之外的太陽風中。" },
114
- miranda: { full: "天衛五(米蘭達)", tag: "拼湊而成的世界", text: "佈滿巨大懸崖和溝槽。維羅納斷崖高約 20 公里,可能是太陽系最高的懸崖。航海家 2 號在 1986 年拍下了它。" },
115
- ariel: { full: "天衛一(艾瑞爾)", tag: "來自磁層的二氧化碳冰?", text: "天王星大衛星中最明亮的一顆,表面有年輕的峽谷。韋伯望遠鏡發現二氧化碳冰集中在它的一側,可能是天王星磁層的帶電粒子撞擊表面造成的。" },
116
- umbriel: { full: "天衛二(烏姆柏里厄爾)", tag: "天王星最暗的衛星", text: "天王星大衛星中最暗的一顆,赤道附近有一個神秘的明亮圓環,名為「溫達」。" },
117
- titania: { full: "天衛三(泰坦妮亞)", tag: "天王星最大的衛星", text: "天衛三的岩石核心與冰殼之間可能有一層薄薄的海洋,是未來天王星軌道器及其磁強計的重要目標。" },
118
- oberon: { full: "天衛四(奧伯龍)", tag: "進出磁層的衛星", text: "天王星最外側的大衛星。它的部分軌道位於磁層頂以外,所以表面同時受到太陽風和天王星磁層等離子體的衝擊。" },
119
- triton: { full: "海衛一(特里同)", tag: "被俘獲、有噴泉的世界", text: "它逆向公轉,很可能是被海王星俘獲的柯伊伯帶天體。航海家 2 號在 1989 年看到氮氣噴泉。海王星傾斜的磁場隨自轉掃過海衛一,它的大氣可能為海王星磁層提供氮。它也可能藏有海洋。" }
120
- },
121
- ft: { tex: "行星與月球紋理:Solar System Scope(CC BY 4.0),基於 NASA 圖像。衛星拼接圖:NASA/JPL/USGS(伽利略號、卡西尼號、航海家號),經 NOAA Science On a Sphere 提供。" }
122
- }
123
- };
 
 
 
 
1
+ // Moon names, descriptions and the moon section text, merged into I18N by main.js.
2
+
3
+ export const MOON_I18N = {
4
+ en: {
5
+ nav: { moons: "Moons" },
6
+ fx: { volcano: "Volcanic plumes", plume: "Possible water plume", geysers: "Water geysers (main plasma source)", n2geysers: "Nitrogen geysers", spots: "Auroral spots (moon's own aurora)", aurora: "Auroral ovals", lens: "Electron-beam pattern", co2: "CO₂ ice made by the magnetosphere?", exo: "Thin oxygen exosphere", haze: "Thick hazy atmosphere", minimag: "Mini-magnetosphere", drape: "Draped magnetic field", wings: "Alfvén wings → planet's aurora", tail: "Pick-up ions → plasma torus", sodium: "Sodium cloud", neutral: "Neutral water cloud", flow: "Magnetospheric plasma flow", solarwind: "Solar wind", wake: "Plasma wake (empty shadow)", impact: "Solar wind hits the surface", lunarmag: "Mini-magnetospheres (magnetic rocks)", swirl: "Lunar swirl (Reiner Gamma)", natail: "Sodium tail", magtail: "Inside Earth's magnetotail" },
7
+ moons: {
8
+ moon: "Moon", io: "Io", europa: "Europa", ganymede: "Ganymede", callisto: "Callisto",
9
+ mimas: "Mimas", enceladus: "Enceladus", tethys: "Tethys", dione: "Dione", rhea: "Rhea", titan: "Titan", iapetus: "Iapetus",
10
+ miranda: "Miranda", ariel: "Ariel", umbriel: "Umbriel", titania: "Titania", oberon: "Oberon", triton: "Triton"
11
+ },
12
+ mn: {
13
+ title: "Moons inside the magnetospheres",
14
+ sub: "The giant planets’ moons sit inside their magnetic bubbles. Some feed them with gas, some glow in their own aurora, and some hide oceans that the magnetic field helps us find. Spin a globe, then fly to the moon in 3D. You can also click any moon in the 3D explorer.",
15
+ fly: "Fly to it in 3D",
16
+ back: "← Back to planet",
17
+ dia: "Diameter", dist: "Distance from planet", period: "Orbit period", host: "Orbits",
18
+ days: "days", retro: "backwards (retrograde)", km: "km",
19
+ clickHint: "Tip: click a moon in 3D to learn about it.",
20
+ roleTitle: "In the magnetosphere", seeTitle: "What you can see in 3D", nowWind: "Right now: in the solar wind", nowTail: "Right now: inside Earth's magnetotail", toTail: "Move the Moon behind Earth (into the magnetotail)"
21
+ },
22
+ mo: {
23
+ moon: { tag: "Earth’s only natural satellite", text: "The Moon has no global magnetic field and almost no atmosphere, s’s magnetotail, where it is bathed in plasma from Earth instead." },
24
+ io: { tag: "Volcano world · plasma source", text: "The most volcanic world in the solar system. Its volcanoes release about one tonne of gas every second, which is ionised to form the Io plasma torus. As Jupiter’s field sweeps past, Io drives an electric current of millions of amperes along its flux tube, leaving a bright auroral footprint in Jupiter’s atmosphere." },
25
+ europa: { tag: "Ocean world", text: "A salty ocean lies beneath its icy shell. Galileo found the ocean through the magnetic field it induces as Jupiter’s field sweeps past. Radiation splits the surface ice and makes a thin oxygen atmosphere. Europa Clipper will study it from 2030." },
26
+ ganymede: { tag: "The moon with its own magnetosphere", text: "The largest moon in the solar system, and the only one with its own magnetic field: a mini-magnetosphere inside Jupiter’s, with its own aurora. In 2015 Hubble watched those aurora rock back and forth less than expected, revealing a salty ocean beneath the ice. JUICE will orbit Ganymede from 2034." },
27
+ callisto: { tag: "Ancient cratered world", text: "One of the most heavily cratered surfaces in the solar system. Galileo detected a magnetic signal induced inside Callisto, a hint that a deep salty ocean may exist. It lies outside Jupiter’s main radiation belts, so it would be a safer place for future explorers." },
28
+ mimas: { tag: "The ‘Death Star’ moon", text: "The giant Herschel crater makes Mimas look like the Death Star. Its gravity helps shape the Cassini Division in Saturn’s rings, and in 2024 scientists reported that it may hide a young ocean." },
29
+ enceladus: { tag: "Geysers · main plasma source", text: "Geysers near its south pole spray water vapour and ice into space from an ocean below. This water is the main source of plasma in Saturn’s magnetosphere and feeds the E ring. Cassini flew through the plumes and tasted salts and organic molecules." },
30
+ tethys: { tag: "Icy moon in the plasma", text: "An icy moon with a huge canyon, Ithaca Chasma. Electrons from Saturn’s magnetosphere bombard its surface and change its colour and brightness in patterns that follow the plasma flow." },
31
+ dione: { tag: "Thin oxygen atmosphere", text: "Cassini found a very thin layer of oxygen around Dione, made when charged particles and sunlight split water ice. Dione may also have an ocean deep below its crust." },
32
+ rhea: { tag: "Saturn’s second-largest moon", text: "In 2010 Cassini detected a thin atmosphere of oxygen and carbon dioxide around Rhea, kept topped up as Saturn’s magnetospheric particles hit its icy surface." },
33
+ titan: { tag: "Thick atmosphere, methane lakes", text: "Larger than Mercury, with a thick nitrogen atmosphere and lakes of liquid methane. It has no magnetic field of its own, so Saturn’s field and plasma drape around its atmosphere. Huygens landed in 2005, and NASA’s Dragonfly drone is planned to arrive in the 2030s." },
34
+ iapetus: { tag: "The two-tone moon", text: "Half bright and half dark, with a tall ridge around its equator. It orbits so far from Saturn that it spends its time outside the magnetosphere, in the solar wind." },
35
+ miranda: { tag: "Patchwork world", text: "A jumble of giant cliffs and grooves. Verona Rupes may be the tallest cliff in the solar system, about 20 km high. Voyager 2 photographed it in 1986." },
36
+ ariel: { tag: "CO₂ ice from the magnetosphere?", text: "The brightest of Uranus’s large moons, crossed by young canyons. JWST found carbon dioxide ice concentrated on one side, possibly made by charged particles from Uranus’s magnetosphere hitting the surface." },
37
+ umbriel: { tag: "The darkest moon of Uranus", text: "The darkest of Uranus’s large moons, with a mysterious bright ring called Wunda near its equator." },
38
+ titania: { tag: "Uranus’s largest moon", text: "Titania may hold a thin ocean between its rocky core and icy crust, which makes it a key target for a future Uranus orbiter and its magnetometer." },
39
+ oberon: { tag: "In and out of the magnetosphere", text: "The outermost large moon of Uranus. Part of its orbit lies beyond the magnetopause, so its surface is exposed to both the solar wind and Uranus’s magnetospheric plasma." },
40
+ triton: { tag: "Captured world with geysers", text: "Probably a captured Kuiper Belt object, because it orbits backwards. Voyager 2 saw nitrogen geysers in 1989. Neptune’s tilted field sweeps over Triton as the planet spins, and its atmosphere may supply nitrogen to Neptune’s magnetosphere. It may also hide an ocean." }
41
+ },
42
+ ft: { tex: "Planet and Moon textures: Solar System Scope (CC BY 4.0), based on NASA imagery. Moon mosaics: NASA/JPL/USGS (Galileo, Cassini, Voyager), via NOAA Science On a Sphere." }
43
+ },
44
+
45
+ "zh-Hans": {
46
+ nav: { moons: "卫星" },
47
+ fx: { volcano: "火山羽流", plume: "可能的水羽流", geysers: "水喷泉(主要等离子体来源)", n2geysers: "氮气喷泉", spots: "极光光斑(卫星自己的极光)", aurora: "极光环", lens: "高能电子轰击图案", co2: "磁层造成的二氧化碳冰?", exo: "稀薄的氧气外逸层", haze: "浓厚的雾霾大气", minimag: "迷你磁层", drape: "包裹的磁力线", wings: "阿尔芬翼 → 行星极光", tail: "拾起离子 → 等离子体环", sodium: "钠云", neutral: "中性水汽云", flow: "磁层等离子体流", solarwind: "太阳风", wake: "等离子体尾流(空洞)", impact: "太阳风直接撞击表面", lunarmag: "迷你磁层(带磁性的岩石)", swirl: "月面旋涡(赖纳伽马)", natail: "钠尾", magtail: "正处于地球磁尾中" },
48
+ moons: {
49
+ moon: "月球", io: "木卫一", europa: "木卫二", ganymede: "木卫三", callisto: "木卫四",
50
+ mimas: "土卫一", enceladus: "土卫二", tethys: "土卫三", dione: "土卫四", rhea: "土卫五", titan: "土卫六", iapetus: "土卫八",
51
+ miranda: "天卫五", ariel: "天卫一", umbriel: "天卫二", titania: "天卫三", oberon: "天卫四", triton: "海卫一"
52
+ },
53
+ mn: {
54
+ title: "磁层中的卫星",
55
+ sub: "巨行星的卫星都处在磁“泡泡”之中:有的为磁层提供气体,有的拥有自己的极光,有的藏着海洋,而磁场正是帮助我们找到海洋的线索。转动下面的星球,再在 3D 中飞过去看看。你也可以在 3D 探索中直接点击任何卫星。",
56
+ fly: "在 3D 中飞过去",
57
+ back: "← 返回行星",
58
+ dia: "直径", dist: "与行星距离", period: "公转周期", host: "环绕",
59
+ days: "天", retro: "逆向公转", km: "公里",
60
+ clickHint: "提示:在 3D 中点击卫星即可查看介绍。",
61
+ roleTitle: "在磁层中的角色", seeTitle: "3D 中可以看到", nowWind: "现在:位于太阳风中", nowTail: "现在:位于地球磁尾中", toTail: "把月球移到地球背后(进入磁尾)"
62
+ },
63
+ mo: {
64
+ moon: { full: "月球", tag: "地球唯一的天然卫星", text: "月球没有全球磁场,也几乎没有大气,太阳风直接打在它的表面并被吸收,在月球背后留下一个空洞般的尾流。一些带磁性的岩石形成微小的“迷你磁层”,保护着像赖纳伽马这样明亮的“月面旋涡”。阳光和太阳风把钠原子从表面撞出来,形成一条暗淡的钠尾。每个月约有 6 天,月球会穿过地球的磁尾,改为沐浴在来自地球的等离子体中。" },
65
+ io: { full: "木卫一(艾奥)", tag: "火山世界 · 等离子体来源", text: "太阳系中火山活动最剧烈的天体。火山每秒释放约一吨气体,气体被电离后形成木卫一等离子体环。当木星磁场扫过时,木卫一沿着磁通管驱动高达数百万安培的电流,在木星大气中留下明亮的极光“足迹”。" },
66
+ europa: { full: "木卫二(欧罗巴)", tag: "海洋世界", text: "冰壳之下有一片咸水海洋。伽利略号通过木星磁场扫过时海洋感应出的磁场发现了它。辐射分解表面的冰,形成稀薄的氧气大气。欧罗巴快船将于 2030 年起研究它。" },
67
+ ganymede: { full: "木卫三(盖尼米得)", tag: "拥有自己磁层的卫星", text: "太阳系最大的卫星,也是唯一拥有自身磁场的卫星:在木星磁层之内还有一个迷你磁层,并有自己的极光。2015 年,哈勃发现这些极光的摆动比预期小,揭示冰层下有咸水海洋。JUICE 将于 2034 年起环绕木卫三运行。" },
68
+ callisto: { full: "木卫四(卡利斯托)", tag: "古老的陨石坑世界", text: "太阳系中陨石坑最密集的表面之一。伽利略号在木卫四内部���测到感应磁场信号,暗示可能存在深层咸水海洋。它位于木星主要辐射带之外,对未来的探索者来说较为安全。" },
69
+ mimas: { full: "土卫一(弥玛斯)", tag: "“死星”卫星", text: "巨大的赫歇尔陨石坑令它看起来像电影中的“死星”。它的引力帮助塑造了土星光环中的卡西尼缝;2024 年科学家报告它可能藏有一个年轻的海洋。" },
70
+ enceladus: { full: "土卫二(恩克拉多斯)", tag: "喷泉 · 主要等离子体来源", text: "南极附近的喷泉把下方海洋的水汽和冰粒喷向太空。这些水是土星磁层等离子体的主要来源,也补充了 E 环。卡西尼号曾穿过羽流,“尝”到盐分和有机分子。" },
71
+ tethys: { full: "土卫三(特提斯)", tag: "等离子体中的冰卫星", text: "拥有巨大峡谷“伊萨卡深谷”的冰卫星。土星磁层的电子轰击它的表面,按照等离子体流动的方向改变表面的颜色和亮度。" },
72
+ dione: { full: "土卫四(狄俄涅)", tag: "稀薄的氧气大气", text: "卡西尼号在土卫四周围发现极稀薄的氧气层,是带电粒子和阳光分解水冰而成。土卫四的地壳深处也可能有海洋。" },
73
+ rhea: { full: "土卫五(瑞亚)", tag: "土星第二大卫星", text: "2010 年,卡西尼号在土卫五周围探测到由氧和二氧化碳组成的稀薄大气,土星磁层粒子撞击冰面不断为它补充气体。" },
74
+ titan: { full: "土卫六(泰坦)", tag: "浓厚大气与甲烷湖", text: "比水星还大,拥有浓厚的氮气大气和液态甲烷湖。它没有自己的磁场,所以土星的磁场和等离子体会包裹着它的大气。惠更斯号于 2005 年着陆,NASA 的“蜻蜓号”无人机计划在 2030 年代抵达。" },
75
+ iapetus: { full: "土卫八(伊阿珀托斯)", tag: "黑白双色卫星", text: "一半明亮、一半黝黑,赤道上还有一道高耸的山脊。它离土星很远,大部分时间位于磁层之外的太阳风中。" },
76
+ miranda: { full: "天卫五(米兰达)", tag: "拼凑而成的世界", text: "布满巨大悬崖和沟槽。维罗纳断崖高约 20 公里,可能是太阳系最高的悬崖。旅行者 2 号在 1986 年拍下了它。" },
77
+ ariel: { full: "天卫一(艾瑞尔)", tag: "来自磁层的二氧化碳冰?", text: "天王星大卫星中最明亮的一颗,表面有年轻的峡谷。韦布望远镜发现二氧化碳冰集中在它的一侧,可能是天王星磁层的带电粒子撞击表面造成的。" },
78
+ umbriel: { full: "天卫二(乌姆柏里厄尔)", tag: "天王星最暗的卫星", text: "天王星大卫星中最暗的一颗,赤道附近有一个神秘的明亮圆环,名为“温达”。" },
79
+ titania: { full: "天卫三(泰坦尼亚)", tag: "天王星最大的卫星", text: "天卫三的岩石核心与冰壳之间可能有一层薄薄的海洋,是未来天王星轨道器及其磁强计的重要目标。" },
80
+ oberon: { full: "天卫四(奥伯龙)", tag: "进出磁层的卫星", text: "天王星最外侧的大卫星。它的部分轨道位于磁层顶以外,所以表面同时受到太阳风和天王星磁层等离子体的冲击。" },
81
+ triton: { full: "海卫一(特里同)", tag: "被俘获、有喷泉的世界", text: "它逆向公转,很可能是被海王星俘获的柯伊伯带天体。旅行者 2 号在 1989 年看到氮气喷泉。海王星倾斜的磁场随自转扫过海卫一,它的大气可能为海王星磁层提供氮。它也可能藏有海洋。" }
82
+ },
83
+ ft: { tex: "行星与月球纹理:Solar System Scope(CC BY 4.0),基于 NASA 图像。卫星拼接图:NASA/JPL/USGS(伽利略号、卡西尼号、旅行者号),经 NOAA Science On a Sphere 提供。" }
84
+ },
85
+
86
+ "zh-Hant": {
87
+ nav: { moons: "衛星" },
88
+ fx: { volcano: "火山羽流", plume: "可能的水羽流", geysers: "水噴泉(主要等離子體來源)", n2geysers: "氮氣噴泉", spots: "極光光斑(衛星自己的極光)", aurora: "極光環", lens: "高能電子轟擊圖案", co2: "磁層造成的二氧化碳冰?", exo: "稀薄的氧氣外逸層", haze: "濃厚的霧霾大氣", minimag: "迷你磁層", drape: "包裹的磁力線", wings: "阿爾芬翼 → 行星極光", tail: "拾起離子 → 等離子體環", sodium: "鈉雲", neutral: "中性水汽雲", flow: "磁層等離子體流", solarwind: "太陽風", wake: "等離子體尾流(空洞)", impact: "太陽風直接撞擊表面", lunarmag: "迷你磁層(帶磁性的岩石)", swirl: "月面漩渦(賴納伽馬)", natail: "鈉尾", magtail: "正處於地球磁尾中" },
89
+ moons: {
90
+ moon: "月球", io: "木衛一", europa: "木衛二", ganymede: "木衛三", callisto: "木衛四",
91
+ mimas: "土衛一", enceladus: "土衛二", tethys: "土衛三", dione: "土衛四", rhea: "土衛五", titan: "土衛六", iapetus: "土衛八",
92
+ miranda: "天衛五", ariel: "天衛一", umbriel: "天衛��", titania: "天衛三", oberon: "天衛四", triton: "海衛一"
93
+ },
94
+ mn: {
95
+ title: "磁層中的衛星",
96
+ sub: "巨行星的衛星都處在磁「泡泡」之中:有的為磁層提供氣體,有的擁有自己的極光,有的藏著海洋,而磁場正是幫助我們找到海洋的線索。轉動下面的星球,再在 3D 中飛過去看看。你也可以在 3D 探索中直接點擊任何衛星。",
97
+ fly: "在 3D 中飛過去",
98
+ back: "← 返回行星",
99
+ dia: "直徑", dist: "與行星距離", period: "公轉周期", host: "環繞",
100
+ days: "天", retro: "逆向公轉", km: "公里",
101
+ clickHint: "提示:在 3D 中點擊衛星即可查看介紹。",
102
+ roleTitle: "在磁層中的角色", seeTitle: "3D 中可以看到", nowWind: "現在:位於太陽風中", nowTail: "現在:位於地球磁尾中", toTail: "把月球移到地球背後(進入磁尾)"
103
+ },
104
+ mo: {
105
+ moon: { full: "月球", tag: "地球唯一的天然衛星", text: "月球沒有全球磁場,也幾乎沒有大氣,太陽風直接打在它的表面並被吸收,在月球背後留下一個空洞般的尾流。一些帶磁性的岩石形成微小的「迷你磁層」,保護著像賴納伽馬這樣明亮的「月面漩渦」。陽光和太陽風把鈉原子從表面撞出來,形成一條暗淡的鈉尾。每個月約有 6 天,月球會穿過地球的磁尾,改為沐浴在來自地球的等離子體中。" },
106
+ io: { full: "木衛一(艾奧)", tag: "火山世界 · 等離子體來源", text: "太陽系中火山活動最劇烈的天體。火山每秒釋放約一噸氣體,氣體被電離後形成木衛一等離子體環。當木星磁場掃過時,木衛一沿著磁通管驅動高達數百萬安培的電流,在木星大氣中留下明亮的極光「足跡」。" },
107
+ europa: { full: "木衛二(歐羅巴)", tag: "海洋世界", text: "冰殼之下有一片鹹水海洋。伽利略號透過木星磁場掃過時海洋感應出的磁場發現了它。輻射分解表面的冰,形成稀薄的氧氣大氣。歐羅巴快船將於 2030 年起研究它。" },
108
+ ganymede: { full: "木衛三(甘尼米德)", tag: "擁有自己磁層的衛星", text: "太陽系最大的衛星,也是唯一擁有自身磁場的衛星:在木星磁層之內還有一個迷你磁層,並有自己的極光。2015 年,哈勃發現這些極光的擺動比預期小,揭示冰層下有鹹水海洋。JUICE 將於 2034 年起環繞木衛三運行。" },
109
+ callisto: { full: "木衛四(卡利斯多)", tag: "古老的隕石坑世界", text: "太陽系中隕石坑最密集的表面之一。伽利略號在木衛四內部探測到感應磁場訊號,暗示可能存在深層鹹水海洋。它位於木星主要輻射帶之外,對未來的探索者來說較為安全。" },
110
+ mimas: { full: "土衛一(彌瑪斯)", tag: "「死星」衛星", text: "巨大的赫歇爾隕石坑令它看起來像電影中的「死星」。它的引力幫助塑造了土星光環中的卡西尼縫;2024 年科學家報告它可能藏有一個年輕的海洋。" },
111
+ enceladus: { full: "土衛二(恩塞勒達斯)", tag: "噴泉 · 主要等離子體來源", text: "南極附近的噴泉把下方海洋的水汽和冰粒噴向太空。這些水是土星磁層等離子體的主要來源,也補充了 E 環。卡西尼號曾穿過羽流,「嚐」到鹽分和有機分子。" },
112
+ tethys: { full: "土衛三(特提斯)", tag: "等離子體中的冰衛星", text: "擁有巨大峽谷「伊薩卡深谷」的冰衛星。土星磁層的電子轟擊它的表面,按照等離子體流動的方向改變表面的顏色和亮度。" },
113
+ dione: { full: "土衛四(狄俄涅)", tag: "稀薄的氧氣大氣", text: "卡西尼號在土衛四周圍發現極稀薄的氧氣層,是帶電粒子和陽光分解水冰而成。土衛四的地殼深處也可能有海洋。" },
114
+ rhea: { full: "土衛五(瑞亞)", tag: "土星第二大衛星", text: "2010 年,卡西尼號在土衛五周圍探測到由氧和二氧化碳組成的稀薄大氣,土星磁層粒子撞擊冰面不斷為它補充氣體。" },
115
+ titan: { full: "土衛六(泰坦)", tag: "濃厚大氣與甲烷湖", text: "比水星還大,擁有濃厚的氮氣大氣和液態甲烷湖。它沒有自己的磁場,所以土星的磁場和等離子體會包裹著它的大氣。惠更斯號於 2005 年著陸,NASA 的「蜻蜓號」無人機計劃在 2030 年代抵達。" },
116
+ iapetus: { full: "土衛八(伊阿珀托斯)", tag: "黑白雙色衛星", text: "一半明亮、一半黝黑,赤道上還有一道高聳的山脊。它離土星很遠,大部分時間位於磁層之外的太陽風中。" },
117
+ miranda: { full: "天衛五(米蘭達)", tag: "拼湊而成的世界", text: "佈滿巨大懸崖和溝槽。維羅納斷崖高約 20 公里,可能是太陽系最高的懸崖。航海家 2 號在 1986 年拍下了它。" },
118
+ ariel: { full: "天衛一(艾瑞爾)", tag: "來自磁層的二氧化碳冰?", text: "天王星大衛星中最明亮的一顆,表面有年輕的峽谷。韋伯望遠鏡發現二氧化碳冰集中在它的一側,可能是天王星磁層的帶電粒子撞擊表面造成的。" },
119
+ umbriel: { full: "天衛二(烏姆柏里厄爾)", tag: "天王星最暗的衛星", text: "天王星大衛星中最暗的一顆,赤道附近有一個神秘的明亮圓環,名為「溫達」。" },
120
+ titania: { full: "天衛三(泰坦妮亞)", tag: "天王星最大的衛星", text: "天衛三的岩石核心與冰殼之間可能有一層薄薄的海洋,是未來天王星軌道器及其磁強計的重要目標。" },
121
+ oberon: { full: "天衛四(奧伯龍)", tag: "進出磁層的衛星", text: "天王星最外側的大衛星。它的部分軌道位於磁層頂以外,所以表面同時受到太陽風和天王星磁層等離子體的衝擊。" },
122
+ triton: { full: "海衛一(特里同)", tag: "被俘獲、有噴泉的世界", text: "它逆向公轉,很可能是被海王星俘獲的柯伊伯帶天體。航海家 2 號在 1989 年看到氮氣噴泉。海王星傾斜的磁場隨自轉掃過海衛一,它的大氣可能為海王星磁層提供氮。它也可能藏有海洋。" }
123
+ },
124
+ ft: { tex: "行星與月球紋理:Solar System Scope(CC BY 4.0),基於 NASA 圖像。衛星拼接圖:NASA/JPL/USGS(伽利略號、卡西尼號、航海家號),經 NOAA Science On a Sphere 提供。" }
125
+ }
126
+ };
js/main.js CHANGED
@@ -3,6 +3,7 @@ import { MOON_I18N } from './i18n_moons.js';
3
  import { CRAFT_I18N, CRAFT_ORDER, CRAFT_THEMES, CRAFT_INST, CRAFT_BACKDROP } from './i18n_craft.js';
4
  import { createCraftViewer } from './craft.js';
5
  import { createScene, PLANET_CFG, FEATURED_MOONS, moonData } from './scene.js';
 
6
 
7
  // merge moon text into the main dictionary
8
  const deepMerge = (a, b) => { for (const k in b) { if (b[k] && typeof b[k] === 'object' && !Array.isArray(b[k]) && a[k] && typeof a[k] === 'object') deepMerge(a[k], b[k]); else a[k] = b[k]; } return a; };
@@ -79,7 +80,8 @@ function showMoon(key) {
79
  $('#infoName').textContent = moonName(key);
80
  $('#infoDesc').textContent = t(`mo.${key}.text`);
81
  $('#infoFacts').innerHTML = moonFacts(key).map(([k, v]) => `<dt>${esc(t(k))}</dt><dd>${esc(v)}</dd>`).join('');
82
- $('#infoMoons').innerHTML = `<div class="moon-actions"><button class="btn primary small" id="moonFly">${esc(t('mn.fly'))}</button><button class="btn ghost small" id="moonBack">${esc(t('mn.back'))}</button></div>`;
 
83
  $('#moonFly').addEventListener('click', () => scene?.focusMoon(key));
84
  $('#moonBack').addEventListener('click', () => { selection = null; updateInfo(); scene?.view('overview'); });
85
  document.body.classList.remove('touring');
@@ -106,6 +108,69 @@ $$('#planetTabs button').forEach(b => b.addEventListener('click', () => { endTou
106
  $$('[data-layer]').forEach(cb => cb.addEventListener('change', () => scene?.setLayer(cb.dataset.layer, cb.checked)));
107
  $$('[data-view]').forEach(b => b.addEventListener('click', () => scene?.view(b.dataset.view)));
108
  $('#speed').addEventListener('input', e => scene?.setSpeed(parseFloat(e.target.value)));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
 
110
  function startExploring() { document.body.classList.add('exploring'); }
111
  $('#startBtn').addEventListener('click', startExploring);
@@ -116,7 +181,7 @@ const TOUR = [
116
  { planet: 'jupiter', view: 'close', layers: { field: true, wind: false, mp: false, aurora: false, torus: false, moons: false, labels: true } },
117
  { planet: 'jupiter', view: 'overview', layers: { field: true, wind: true, mp: false, aurora: false, torus: false, moons: false, labels: true } },
118
  { planet: 'jupiter', view: 'overview', layers: { field: true, wind: true, mp: true, aurora: false, torus: false, moons: false, labels: true } },
119
- { planet: 'jupiter', view: 'mid', layers: { field: true, wind: false, mp: false, aurora: false, torus: true, moons: true, labels: true } },
120
  { planet: 'jupiter', view: 'aurora', layers: { ...ALL_ON, wind: false, mp: false } },
121
  { planet: 'uranus', view: 'overview', layers: { ...ALL_ON } }
122
  ];
@@ -131,6 +196,7 @@ function showStep(i) {
131
  if (scene.planet !== s.planet) scene.setPlanet(s.planet, { keepView: true });
132
  scene.setLayers(s.layers);
133
  scene.view(s.view);
 
134
  syncLayerBoxes();
135
  $('#tour').hidden = false;
136
  renderTourText();
@@ -327,6 +393,8 @@ function applyLang(l) {
327
  renderSteps(); renderMoons(); renderThemes(); renderPicker(); renderCraftInfo(); renderBars(); renderTable(); renderWhy(); renderTimeline(); renderQuiz();
328
  if (scene) { selection ? showMoon(selection) : updateInfo(); scene.refreshLabels(); }
329
  renderTourText();
 
 
330
  }
331
  $$('.lang button').forEach(b => b.addEventListener('click', () => applyLang(b.dataset.lang)));
332
 
@@ -337,6 +405,9 @@ applyLang(lang);
337
  initAuroraGallery();
338
  if (params.has('explore')) startExploring();
339
  if (params.get('view')) scene?.view(params.get('view'), true);
 
 
 
340
  if (params.has('tour')) showStep(parseInt(params.get('tour'), 10) || 0);
341
  if (CRAFT_ORDER.includes(params.get('craft'))) showCraft(params.get('craft'));
342
  if (params.get('moon') && moonData(params.get('moon'))) flyToMoon(params.get('moon'), false, true);
 
3
  import { CRAFT_I18N, CRAFT_ORDER, CRAFT_THEMES, CRAFT_INST, CRAFT_BACKDROP } from './i18n_craft.js';
4
  import { createCraftViewer } from './craft.js';
5
  import { createScene, PLANET_CFG, FEATURED_MOONS, moonData } from './scene.js';
6
+ import { moonFxKeys } from './moonfx.js';
7
 
8
  // merge moon text into the main dictionary
9
  const deepMerge = (a, b) => { for (const k in b) { if (b[k] && typeof b[k] === 'object' && !Array.isArray(b[k]) && a[k] && typeof a[k] === 'object') deepMerge(a[k], b[k]); else a[k] = b[k]; } return a; };
 
80
  $('#infoName').textContent = moonName(key);
81
  $('#infoDesc').textContent = t(`mo.${key}.text`);
82
  $('#infoFacts').innerHTML = moonFacts(key).map(([k, v]) => `<dt>${esc(t(k))}</dt><dd>${esc(v)}</dd>`).join('');
83
+ const fxk = moonFxKeys(key);
84
+ $('#infoMoons').innerHTML = (fxk.length ? `<h3>${esc(t('mn.seeTitle'))}</h3><div class="fx-chips">${fxk.map(k => `<span>${esc(t('fx.' + k))}</span>`).join('')}</div>` : '') + `<div class="moon-actions"><button class="btn primary small" id="moonFly">${esc(t('mn.fly'))}</button><button class="btn ghost small" id="moonBack">${esc(t('mn.back'))}</button></div>`;
85
  $('#moonFly').addEventListener('click', () => scene?.focusMoon(key));
86
  $('#moonBack').addEventListener('click', () => { selection = null; updateInfo(); scene?.view('overview'); });
87
  document.body.classList.remove('touring');
 
108
  $$('[data-layer]').forEach(cb => cb.addEventListener('change', () => scene?.setLayer(cb.dataset.layer, cb.checked)));
109
  $$('[data-view]').forEach(b => b.addEventListener('click', () => scene?.view(b.dataset.view)));
110
  $('#speed').addEventListener('input', e => scene?.setSpeed(parseFloat(e.target.value)));
111
+ /* solar wind intensity: 1 = typical; values are relative dynamic pressure */
112
+ function windLevelKey(k) { return k < 0.7 ? 'ex.windCalm' : k < 1.5 ? 'ex.windNormal' : k < 2.6 ? 'ex.windStrong' : 'ex.windStorm'; }
113
+ function setWind(k, instant = false) {
114
+ const sl = $('#windSlider');
115
+ k = Math.min(parseFloat(sl.max), Math.max(parseFloat(sl.min), k));
116
+ sl.value = k;
117
+ scene?.setWind(k, instant);
118
+ // the stream must be visible for the slider to make sense
119
+ if (scene && !scene.getLayers().wind) { scene.setLayer('wind', true); syncLayerBoxes(); }
120
+ renderWind();
121
+ }
122
+ function renderWind() {
123
+ const k = parseFloat($('#windSlider').value);
124
+ const lvl = windLevelKey(k);
125
+ $('#windVal').textContent = `${t(lvl)} · ×${k.toFixed(1)}`;
126
+ $('#windVal').dataset.level = lvl.slice(7).toLowerCase();
127
+ $('#windCard').classList.toggle('storming', k >= 2.6);
128
+ }
129
+ /* hide / show all overlay menus so the 3D view is unobstructed (button or "H" key) */
130
+ function renderUiToggle() {
131
+ const min = document.body.classList.contains('ui-min');
132
+ $('#uiToggleTxt').textContent = t(min ? 'ex.showUi' : 'ex.hideUi');
133
+ $('#uiToggle').setAttribute('aria-pressed', String(min));
134
+ $('#uiToggle').title = t(min ? 'ex.showUi' : 'ex.hideUi') + ' (H)';
135
+ }
136
+ function toggleUi(force) {
137
+ document.body.classList.toggle('ui-min', force);
138
+ renderUiToggle();
139
+ }
140
+ $('#uiToggle').addEventListener('click', () => toggleUi());
141
+ document.addEventListener('keydown', e => {
142
+ if (e.key !== 'h' && e.key !== 'H') return;
143
+ if (e.ctrlKey || e.metaKey || e.altKey || /INPUT|TEXTAREA|SELECT/.test(document.activeElement?.tagName || '')) return;
144
+ const r = $('#explore').getBoundingClientRect();
145
+ if (r.bottom > 0 && r.top < innerHeight) toggleUi();
146
+ });
147
+ $('#windSlider').addEventListener('input', e => setWind(parseFloat(e.target.value)));
148
+ $('#windReset').addEventListener('click', () => setWind(1));
149
+ $('#cmeBtn').addEventListener('click', () => {
150
+ if (!scene) return;
151
+ if (!scene.getLayers().wind) { scene.setLayer('wind', true); syncLayerBoxes(); }
152
+ if (!scene.getLayers().mp) { scene.setLayer('mp', true); syncLayerBoxes(); }
153
+ scene.launchCME();
154
+ });
155
+ // Typical magnetopause stand-off distance in planetary radii; it scales as (pressure)^(-1/6).
156
+ const REAL_MP = { earth: 10, jupiter: 63, saturn: 22, uranus: 18, neptune: 26 };
157
+ let meterT = 0;
158
+ function updateMeters(now) {
159
+ requestAnimationFrame(updateMeters);
160
+ if (!scene || now - meterT < 150) return;
161
+ meterT = now;
162
+ const w = scene.windInfo();
163
+ const mp = (REAL_MP[scene.planet] || 10) * Math.pow(w.k, -1 / 6);
164
+ $('#mpVal').textContent = t('ex.mRadii').replace('{n}', mp >= 30 ? Math.round(mp) : mp.toFixed(1));
165
+ $('#mpBar').style.width = `${Math.min(100, 100 * Math.pow(w.k, -1 / 6) / 1.25)}%`;
166
+ $('#auVal').textContent = `×${w.boost.toFixed(1)}`;
167
+ $('#auBar').style.width = `${Math.min(100, 100 * w.boost / 2.6)}%`;
168
+ const card = $('#windCard');
169
+ card.classList.toggle('cme', w.cme && w.kick === 0);
170
+ card.classList.toggle('impact', w.kick > 0.05);
171
+ $('#cmeBtn').disabled = w.cme;
172
+ }
173
+ requestAnimationFrame(updateMeters);
174
 
175
  function startExploring() { document.body.classList.add('exploring'); }
176
  $('#startBtn').addEventListener('click', startExploring);
 
181
  { planet: 'jupiter', view: 'close', layers: { field: true, wind: false, mp: false, aurora: false, torus: false, moons: false, labels: true } },
182
  { planet: 'jupiter', view: 'overview', layers: { field: true, wind: true, mp: false, aurora: false, torus: false, moons: false, labels: true } },
183
  { planet: 'jupiter', view: 'overview', layers: { field: true, wind: true, mp: true, aurora: false, torus: false, moons: false, labels: true } },
184
+ { planet: 'jupiter', view: 'mid', moon: 'io', layers: { field: true, wind: false, mp: false, aurora: true, torus: true, moons: true, labels: true } },
185
  { planet: 'jupiter', view: 'aurora', layers: { ...ALL_ON, wind: false, mp: false } },
186
  { planet: 'uranus', view: 'overview', layers: { ...ALL_ON } }
187
  ];
 
196
  if (scene.planet !== s.planet) scene.setPlanet(s.planet, { keepView: true });
197
  scene.setLayers(s.layers);
198
  scene.view(s.view);
199
+ if (s.moon) scene.focusMoon(s.moon);
200
  syncLayerBoxes();
201
  $('#tour').hidden = false;
202
  renderTourText();
 
393
  renderSteps(); renderMoons(); renderThemes(); renderPicker(); renderCraftInfo(); renderBars(); renderTable(); renderWhy(); renderTimeline(); renderQuiz();
394
  if (scene) { selection ? showMoon(selection) : updateInfo(); scene.refreshLabels(); }
395
  renderTourText();
396
+ renderWind();
397
+ renderUiToggle();
398
  }
399
  $$('.lang button').forEach(b => b.addEventListener('click', () => applyLang(b.dataset.lang)));
400
 
 
405
  initAuroraGallery();
406
  if (params.has('explore')) startExploring();
407
  if (params.get('view')) scene?.view(params.get('view'), true);
408
+ if (params.has('wind')) setWind(parseFloat(params.get('wind')) || 1, true);
409
+ if (params.has('clean')) toggleUi(true);
410
+ if (params.has('cme')) scene?.launchCME(parseFloat(params.get('cme')) || 0);
411
  if (params.has('tour')) showStep(parseInt(params.get('tour'), 10) || 0);
412
  if (CRAFT_ORDER.includes(params.get('craft'))) showCraft(params.get('craft'));
413
  if (params.get('moon') && moonData(params.get('moon'))) flyToMoon(params.get('moon'), false, true);
js/moonfx.js ADDED
@@ -0,0 +1,595 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Plasma, aurora, plume and atmosphere effects for each moon.
2
+ //
3
+ // Everything is built in the moon's own frame, in units of the moon's radius, and the group is
4
+ // attached to the (tidally locked) moon mesh. In that frame the direction to the planet is +x and
5
+ // the planet's spin axis is +y. Corotating magnetospheric plasma moves faster than the moon, so it
6
+ // overtakes the moon from behind: the flow runs along +z, hitting the trailing hemisphere and
7
+ // leaving a wake ahead of the moon. Earth's Moon instead sits in the solar wind (flow mode 'sun').
8
+
9
+ import * as THREE from 'three';
10
+
11
+ const TAU = Math.PI * 2;
12
+ const D = Math.PI / 180;
13
+
14
+ /* ---------------------------------------------------------------- config */
15
+ // halo: [r,g,b,opacity] glow that makes the moon visible from far away
16
+ // flow: background plasma flowing past (obs = obstacle radius it is deflected around)
17
+ // tail: pick-up ions stripped from the moon and carried downstream
18
+ // shells: glowing atmosphere/aurora shells (atmo limb glow, spots, ovals, lens)
19
+ // plumes: volcanoes / geysers; wings: Alfvén wings; minimag: Ganymede's magnetosphere
20
+ // drape: field draping (Titan); cloud: neutral cloud along the orbit
21
+ const FX = {
22
+ moon: {
23
+ halo: [0.55, 0.6, 0.75, 0.12],
24
+ flow: { mode: 'sun', n: 170, obs: 1.02, c: [1.0, 0.85, 0.55], label: 'solarwind' },
25
+ wake: true,
26
+ shells: [{ r: 1.02, atmo: [0.65, 0.7, 1.0], a: 0.18 }]
27
+ },
28
+ io: {
29
+ halo: [1.0, 0.6, 0.25, 0.5],
30
+ flow: { n: 240, obs: 1.15 },
31
+ tail: { n: 260, c: [1.0, 0.7, 0.3], len: 7 },
32
+ shells: [{ r: 1.03, atmo: [1.0, 0.35, 0.3], a: 1.1, spots: 1.5, c1: [1.0, 0.3, 0.25], c2: [0.5, 0.6, 1.0], c3: [0.4, 1.0, 0.5], rock: 0.6, label: 'spots' }],
33
+ plumes: {
34
+ type: 'umbrella', label: 'volcano', h: 0.32, n: 55,
35
+ vents: [[-19, 170], [15, 140], [35, -150], [-40, -140], [5, 110], [50, 180], [-5, -110], [10, 95], [-25, -95]],
36
+ colors: [[0.55, 0.75, 1.0], [0.55, 0.75, 1.0], [1.0, 0.5, 0.3]]
37
+ },
38
+ wings: { c: [1.0, 0.85, 0.45], r: 1.1 },
39
+ cloud: { c: [1.0, 0.72, 0.28], arc: 1.2, tube: 0.13, a: 0.55, label: 'sodium' }
40
+ },
41
+ europa: {
42
+ halo: [0.6, 0.75, 1.0, 0.28],
43
+ flow: { n: 210, obs: 1.08 },
44
+ tail: { n: 170, c: [0.5, 0.85, 1.0], len: 6 },
45
+ shells: [{ r: 1.03, atmo: [0.55, 0.6, 1.0], a: 0.6, spots: 0.95, c1: [0.75, 0.5, 1.0], c2: [0.5, 0.7, 1.0], c3: [0.75, 0.5, 1.0], rock: 0.5, label: 'spots' }],
46
+ plumes: { type: 'umbrella', label: 'plume', h: 0.45, n: 80, vents: [[-60, 175]], colors: [[0.75, 0.9, 1.0]] },
47
+ wings: { c: [0.7, 0.8, 1.0], r: 1.1 }
48
+ },
49
+ ganymede: {
50
+ halo: [0.7, 0.6, 1.0, 0.32],
51
+ flow: { n: 280, obs: 2.15 },
52
+ shells: [{ r: 1.03, atmo: [0.6, 0.6, 1.0], a: 0.5, oval: 1.4, ovalLat: 0.75, c1: [0.8, 0.45, 1.0], c2: [0.45, 0.7, 1.0], rock: 0.5, label: 'aurora' }],
53
+ minimag: { c: [0.6, 0.55, 1.0] },
54
+ wings: { c: [0.8, 0.7, 1.0], r: 2.1 }
55
+ },
56
+ callisto: {
57
+ halo: [0.6, 0.7, 0.9, 0.15],
58
+ flow: { n: 190, obs: 1.12 },
59
+ tail: { n: 90, c: [0.6, 0.8, 1.0], len: 5 },
60
+ shells: [{ r: 1.03, atmo: [0.65, 0.7, 1.0], a: 0.4, spots: 0.35, c1: [0.7, 0.6, 1.0], c2: [0.6, 0.7, 1.0], c3: [0.7, 0.6, 1.0], rock: 0.3, label: 'spots' }]
61
+ },
62
+ mimas: {
63
+ halo: [0.7, 0.75, 0.9, 0.1], flow: { n: 130, obs: 1.02 },
64
+ shells: [{ r: 1.02, atmo: [0.6, 0.7, 1.0], a: 0.15, lens: 0.9, lensSide: 1, lensC: [0.4, 0.8, 1.0], label: 'lens' }]
65
+ },
66
+ enceladus: {
67
+ halo: [0.6, 0.85, 1.0, 0.45],
68
+ flow: { n: 190, obs: 1.25 },
69
+ tail: { n: 200, c: [0.45, 0.7, 1.0], len: 7 },
70
+ shells: [{ r: 1.03, atmo: [0.6, 0.8, 1.0], a: 0.5 }],
71
+ plumes: {
72
+ type: 'jets', label: 'geysers', n: 70,
73
+ vents: [[-82, 0], [-80, 60], [-84, 120], [-79, 180], [-83, 240], [-78, 300], [-87, 30]],
74
+ colors: [[0.85, 0.95, 1.0], [0.6, 0.8, 1.0]]
75
+ },
76
+ wings: { c: [0.6, 0.85, 1.0], r: 1.3 },
77
+ cloud: { c: [0.5, 0.75, 1.0], arc: 1.0, tube: 0.12, a: 0.42, label: 'neutral' }
78
+ },
79
+ tethys: {
80
+ halo: [0.7, 0.75, 0.9, 0.1], flow: { n: 140, obs: 1.02 },
81
+ shells: [{ r: 1.02, atmo: [0.6, 0.7, 1.0], a: 0.15, lens: 0.8, lensSide: 1, lensC: [0.4, 0.8, 1.0], label: 'lens' }]
82
+ },
83
+ dione: {
84
+ halo: [0.65, 0.75, 0.95, 0.14], flow: { n: 150, obs: 1.04 }, tail: { n: 60, c: [0.55, 0.8, 1.0], len: 4 },
85
+ shells: [{ r: 1.03, atmo: [0.6, 0.75, 1.0], a: 0.35, lens: 0.3, lensSide: 1, lensC: [0.4, 0.8, 1.0], label: 'exo' }]
86
+ },
87
+ rhea: {
88
+ halo: [0.65, 0.75, 0.95, 0.14], flow: { n: 160, obs: 1.04 }, tail: { n: 60, c: [0.55, 0.8, 1.0], len: 4 },
89
+ shells: [{ r: 1.03, atmo: [0.6, 0.75, 1.0], a: 0.4, label: 'exo' }]
90
+ },
91
+ titan: {
92
+ halo: [1.0, 0.65, 0.3, 0.42],
93
+ flow: { n: 270, obs: 1.7, c: [0.55, 0.8, 1.0] },
94
+ tail: { n: 230, c: [0.4, 0.7, 1.0], len: 8 },
95
+ shells: [
96
+ { r: 1.12, atmo: [1.0, 0.6, 0.25], a: 1.6, label: 'haze' },
97
+ { r: 1.35, atmo: [0.35, 0.6, 1.0], a: 0.35 }
98
+ ],
99
+ drape: { c: [0.4, 0.85, 1.0] }
100
+ },
101
+ iapetus: {
102
+ halo: [0.7, 0.7, 0.8, 0.08], flow: { n: 100, obs: 1.02 },
103
+ shells: [{ r: 1.02, atmo: [0.6, 0.7, 1.0], a: 0.12 }]
104
+ },
105
+ miranda: { halo: [0.55, 0.95, 0.9, 0.1], flow: { n: 130, obs: 1.02, c: [0.55, 0.95, 0.9] }, shells: [{ r: 1.02, atmo: [0.5, 0.9, 0.9], a: 0.15 }] },
106
+ ariel: {
107
+ halo: [0.55, 0.95, 0.9, 0.14], flow: { n: 140, obs: 1.03, c: [0.55, 0.95, 0.9] },
108
+ shells: [{ r: 1.02, atmo: [0.5, 0.9, 0.9], a: 0.18, lens: 0.7, lensSide: -1, lensC: [0.5, 1.0, 0.8], label: 'co2' }]
109
+ },
110
+ umbriel: { halo: [0.55, 0.95, 0.9, 0.08], flow: { n: 130, obs: 1.02, c: [0.55, 0.95, 0.9] }, shells: [{ r: 1.02, atmo: [0.5, 0.9, 0.9], a: 0.12 }] },
111
+ titania: { halo: [0.55, 0.95, 0.9, 0.12], flow: { n: 140, obs: 1.03, c: [0.55, 0.95, 0.9] }, tail: { n: 50, c: [0.5, 1.0, 0.85], len: 4 }, shells: [{ r: 1.02, atmo: [0.5, 0.9, 0.9], a: 0.2 }] },
112
+ oberon: { halo: [0.55, 0.95, 0.9, 0.1], flow: { n: 130, obs: 1.02, c: [0.55, 0.95, 0.9] }, shells: [{ r: 1.02, atmo: [0.5, 0.9, 0.9], a: 0.15 }] },
113
+ triton: {
114
+ halo: [0.6, 0.85, 1.0, 0.28],
115
+ flow: { n: 210, obs: 1.15 },
116
+ tail: { n: 150, c: [0.6, 0.9, 1.0], len: 6 },
117
+ shells: [{ r: 1.04, atmo: [0.55, 0.75, 1.0], a: 0.6, oval: 0.6, ovalLat: 1.05, c1: [0.5, 0.9, 1.0], c2: [0.7, 0.6, 1.0], rock: 0.4, label: 'aurora' }],
118
+ plumes: { type: 'geyser', label: 'n2geysers', h: 0.3, n: 45, vents: [[-50, 170], [-58, 140], [-55, -160], [-48, -130]], colors: [[0.75, 0.75, 0.8]] }
119
+ }
120
+ };
121
+
122
+ // Labels shown for a moon, in display order (keys under fx.* in the i18n files).
123
+ export function moonFxKeys(key) {
124
+ const f = FX[key];
125
+ if (!f) return [];
126
+ const out = [];
127
+ if (f.plumes) out.push(f.plumes.label);
128
+ f.shells?.forEach(s => s.label && out.push(s.label));
129
+ if (f.minimag) out.push('minimag');
130
+ if (f.drape) out.push('drape');
131
+ if (f.wings) out.push('wings');
132
+ if (f.tail) out.push('tail');
133
+ if (f.cloud) out.push(f.cloud.label);
134
+ if (f.flow) out.push(f.flow.label || 'flow');
135
+ if (f.wake) out.push('wake');
136
+ return out;
137
+ }
138
+
139
+ /* ------------------------------------------------------------ materials */
140
+ let GLOW = null;
141
+ function glowTex() {
142
+ if (GLOW) return GLOW;
143
+ const c = document.createElement('canvas'); c.width = c.height = 64;
144
+ const g = c.getContext('2d');
145
+ const r = g.createRadialGradient(32, 32, 0, 32, 32, 32);
146
+ r.addColorStop(0, 'rgba(255,255,255,1)'); r.addColorStop(0.3, 'rgba(255,255,255,0.45)'); r.addColorStop(1, 'rgba(255,255,255,0)');
147
+ g.fillStyle = r; g.fillRect(0, 0, 64, 64);
148
+ GLOW = new THREE.CanvasTexture(c);
149
+ return GLOW;
150
+ }
151
+
152
+ const additive = { transparent: true, depthWrite: false, blending: THREE.AdditiveBlending };
153
+
154
+ function pointsMaterial(size) {
155
+ return new THREE.PointsMaterial({ size, map: glowTex(), vertexColors: true, ...additive });
156
+ }
157
+
158
+ const NOISE = /* glsl */`
159
+ float h3(vec3 p){ p = fract(p*0.3183099 + 0.1); p *= 17.0; return fract(p.x*p.y*p.z*(p.x+p.y+p.z)); }
160
+ float n3(vec3 x){ vec3 i = floor(x); vec3 f = fract(x); f = f*f*(3.0-2.0*f);
161
+ return mix(mix(mix(h3(i), h3(i+vec3(1,0,0)), f.x), mix(h3(i+vec3(0,1,0)), h3(i+vec3(1,1,0)), f.x), f.y),
162
+ mix(mix(h3(i+vec3(0,0,1)), h3(i+vec3(1,0,1)), f.x), mix(h3(i+vec3(0,1,1)), h3(i+vec3(1,1,1)), f.x), f.y), f.z); }`;
163
+
164
+ function shellMaterial(s) {
165
+ const v3 = a => new THREE.Vector3(...(a || [0, 0, 0]));
166
+ return new THREE.ShaderMaterial({
167
+ uniforms: {
168
+ uTime: { value: 0 }, uAur: { value: 1 },
169
+ uAtmoC: { value: v3(s.atmo) }, uAtmo: { value: s.a || 0 },
170
+ uSpots: { value: s.spots || 0 }, uOval: { value: s.oval || 0 }, uOvalLat: { value: s.ovalLat || 0.8 },
171
+ uRock: { value: s.rock || 0.5 },
172
+ uLens: { value: s.lens || 0 }, uLensSide: { value: s.lensSide || 1 }, uLensC: { value: v3(s.lensC) },
173
+ uC1: { value: v3(s.c1) }, uC2: { value: v3(s.c2) }, uC3: { value: v3(s.c3 || s.c1) }
174
+ },
175
+ vertexShader: /* glsl */`
176
+ varying vec3 vObj; varying vec3 vN; varying vec3 vV;
177
+ void main(){
178
+ vObj = position;
179
+ vN = normalize(mat3(modelMatrix) * normal);
180
+ vec4 wp = modelMatrix * vec4(position, 1.0);
181
+ vV = cameraPosition - wp.xyz;
182
+ gl_Position = projectionMatrix * viewMatrix * wp;
183
+ }`,
184
+ fragmentShader: /* glsl */`
185
+ uniform float uTime, uAur, uAtmo, uSpots, uOval, uOvalLat, uRock, uLens, uLensSide;
186
+ uniform vec3 uAtmoC, uLensC, uC1, uC2, uC3;
187
+ varying vec3 vObj; varying vec3 vN; varying vec3 vV;
188
+ ${NOISE}
189
+ void main(){
190
+ vec3 n = normalize(vObj);
191
+ float mu = abs(dot(normalize(vN), normalize(vV)));
192
+ float limb = pow(1.0 - mu, 2.5);
193
+ vec3 col = uAtmoC * (limb * 1.4 + 0.04) * uAtmo;
194
+ // auroral ovals around both poles; they rock back and forth as the planet's field sweeps past
195
+ if (uOval > 0.0) {
196
+ float lat = asin(clamp(n.y, -1.0, 1.0));
197
+ float lon = atan(n.z, n.x);
198
+ float rock = 0.07 * sin(uTime * uRock) * sign(lat);
199
+ float d = (abs(lat) - uOvalLat - rock - 0.06 * n.z) / 0.085;
200
+ float band = exp(-d*d) * (0.45 + 0.9 * n3(vec3(cos(lon)*3.0, sin(lon)*3.0, uTime*0.45 + sign(lat)*4.0)));
201
+ col += mix(uC1, uC2, 0.5 + 0.5*n.z) * band * uOval * (0.7 + 1.2*limb) * uAur;
202
+ }
203
+ // bright equatorial spots facing towards and away from the planet (Io, Europa, Callisto)
204
+ if (uSpots > 0.0) {
205
+ float r = 0.32 * sin(uTime * uRock);
206
+ vec3 a = normalize(vec3(1.0, r, 0.15)), b = normalize(vec3(-1.0, -r, 0.15));
207
+ float da = length(n - a), db = length(n - b);
208
+ float sa = exp(-da*da / 0.07), sb = exp(-db*db / 0.07);
209
+ float flick = 0.75 + 0.25 * sin(uTime*3.1 + n.y*5.0) * n3(n*6.0 + uTime*0.8);
210
+ col += (uC1*sa + uC3*sb) * uSpots * flick * uAur;
211
+ col += uC2 * (sa + sb) * 0.6 * uSpots * limb * uAur;
212
+ }
213
+ // lens-shaped pattern where energetic electrons hit one hemisphere (Mimas, Tethys) / CO2 on Ariel
214
+ if (uLens > 0.0) {
215
+ float lens = exp(-pow(n.y / 0.38, 2.0)) * smoothstep(0.15, 0.75, n.z * uLensSide);
216
+ col += uLensC * lens * uLens * (0.35 + 0.65 * n3(n*9.0 + uTime*0.15));
217
+ }
218
+ gl_FragColor = vec4(col, 1.0);
219
+ }`,
220
+ ...additive
221
+ });
222
+ }
223
+
224
+ function lineMaterial(color, opacity = 0.75, speed = 0.6) {
225
+ return new THREE.ShaderMaterial({
226
+ uniforms: { uTime: { value: 0 }, uColor: { value: new THREE.Color(...color) }, uOpacity: { value: opacity }, uSpeed: { value: speed } },
227
+ vertexShader: /* glsl */`
228
+ attribute float aT; varying float vT;
229
+ void main(){ vT = aT; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }`,
230
+ fragmentShader: /* glsl */`
231
+ uniform float uTime, uOpacity, uSpeed; uniform vec3 uColor; varying float vT;
232
+ void main(){
233
+ float p = pow(fract(vT*4.0 - uTime*uSpeed), 8.0);
234
+ float f = 1.0 - smoothstep(0.65, 1.0, vT);
235
+ gl_FragColor = vec4(uColor * (0.22 + p*1.9) * uOpacity * f, 1.0);
236
+ }`,
237
+ ...additive
238
+ });
239
+ }
240
+
241
+ function fresnelMaterial(color, strength) {
242
+ return new THREE.ShaderMaterial({
243
+ uniforms: { uColor: { value: new THREE.Color(...color) }, uS: { value: strength }, uTime: { value: 0 } },
244
+ vertexShader: /* glsl */`
245
+ varying vec3 vN; varying vec3 vV; varying vec3 vObj;
246
+ void main(){ vObj = position; vN = normalize(mat3(modelMatrix) * normal); vec4 wp = modelMatrix * vec4(position, 1.0); vV = cameraPosition - wp.xyz; gl_Position = projectionMatrix * viewMatrix * wp; }`,
247
+ fragmentShader: /* glsl */`
248
+ uniform vec3 uColor; uniform float uS, uTime; varying vec3 vN; varying vec3 vV; varying vec3 vObj;
249
+ void main(){ float f = pow(1.0 - abs(dot(normalize(vN), normalize(vV))), 2.2);
250
+ float w = 0.8 + 0.2 * sin(vObj.z*3.0 - uTime*2.0);
251
+ gl_FragColor = vec4(uColor * f * uS * w, 1.0); }`,
252
+ side: THREE.DoubleSide, ...additive
253
+ });
254
+ }
255
+
256
+ function cloudMaterial(color, opacity) {
257
+ return new THREE.ShaderMaterial({
258
+ uniforms: { uColor: { value: new THREE.Color(...color) }, uOpacity: { value: opacity }, uTime: { value: 0 } },
259
+ vertexShader: /* glsl */`
260
+ varying vec2 vUv; varying vec3 vN; varying vec3 vV;
261
+ void main(){ vUv = uv; vN = normalize(mat3(modelMatrix) * normal); vec4 wp = modelMatrix * vec4(position, 1.0); vV = cameraPosition - wp.xyz; gl_Position = projectionMatrix * viewMatrix * wp; }`,
262
+ fragmentShader: /* glsl */`
263
+ uniform vec3 uColor; uniform float uOpacity, uTime; varying vec2 vUv; varying vec3 vN; varying vec3 vV;
264
+ void main(){
265
+ float u = vUv.x;
266
+ float along = smoothstep(0.0, 0.05, u) * pow(1.0 - u, 1.7);
267
+ float core = pow(abs(dot(normalize(vN), normalize(vV))), 1.3);
268
+ float shimmer = 0.85 + 0.15 * sin(u * 40.0 - uTime * 1.5);
269
+ gl_FragColor = vec4(uColor * along * core * shimmer * uOpacity, 1.0);
270
+ }`,
271
+ ...additive
272
+ });
273
+ }
274
+
275
+ function linesGeometry(polys) {
276
+ const pos = [], at = [];
277
+ polys.forEach(({ pts, t }) => {
278
+ for (let i = 1; i < pts.length; i++) {
279
+ const a = pts[i - 1], b = pts[i];
280
+ pos.push(a.x, a.y, a.z, b.x, b.y, b.z);
281
+ at.push(t[i - 1], t[i]);
282
+ }
283
+ });
284
+ const g = new THREE.BufferGeometry();
285
+ g.setAttribute('position', new THREE.Float32BufferAttribute(pos, 3));
286
+ g.setAttribute('aT', new THREE.Float32BufferAttribute(at, 1));
287
+ return g;
288
+ }
289
+
290
+ function ventDir([lat, lon]) {
291
+ return new THREE.Vector3(Math.cos(lat * D) * Math.cos(lon * D), Math.sin(lat * D), Math.cos(lat * D) * Math.sin(lon * D));
292
+ }
293
+
294
+ function makePoints(n, size) {
295
+ const g = new THREE.BufferGeometry();
296
+ g.setAttribute('position', new THREE.BufferAttribute(new Float32Array(n * 3), 3));
297
+ g.setAttribute('color', new THREE.BufferAttribute(new Float32Array(n * 3), 3));
298
+ const p = new THREE.Points(g, pointsMaterial(size));
299
+ p.frustumCulled = false;
300
+ return p;
301
+ }
302
+
303
+ /* ------------------------------------------------------------- builder */
304
+ const DEFAULT_FLOW = [0.6, 0.75, 1.0];
305
+ const tmpQ = new THREE.Quaternion(), tmpV = new THREE.Vector3(), Z = new THREE.Vector3(0, 0, 1);
306
+
307
+ export function createMoonFX(key, { size, dist, holder }) {
308
+ const f = FX[key];
309
+ if (!f) return null;
310
+ const group = new THREE.Group();
311
+ group.scale.setScalar(size);
312
+ const flowFrame = new THREE.Group(); // +z = direction of the plasma flow
313
+ group.add(flowFrame);
314
+ const anchors = []; // { key, obj, aurora }
315
+ const anchor = (k, parent, x, y, z, aurora = false) => {
316
+ const o = new THREE.Object3D(); o.position.set(x, y, z); parent.add(o); anchors.push({ key: k, obj: o, aurora });
317
+ };
318
+ const timed = []; // materials with uTime
319
+ const updaters = [];
320
+
321
+ let halo = null;
322
+ // halo, so the moon stands out at planet scale
323
+ if (f.halo) {
324
+ const [r, g, b, a] = f.halo;
325
+ const sp = new THREE.Sprite(new THREE.SpriteMaterial({ map: glowTex(), color: new THREE.Color(r, g, b), opacity: a, ...additive }));
326
+ sp.scale.set(5, 5, 1);
327
+ group.add(sp);
328
+ halo = sp;
329
+ }
330
+
331
+ // atmosphere / aurora shells
332
+ const shellMats = [];
333
+ f.shells?.forEach(s => {
334
+ const m = shellMaterial(s);
335
+ const mesh = new THREE.Mesh(new THREE.SphereGeometry(s.r, 64, 32), m);
336
+ mesh.renderOrder = 2;
337
+ group.add(mesh);
338
+ shellMats.push(m); timed.push(m);
339
+ if (s.label) {
340
+ if (s.label === 'spots') anchor(s.label, group, -1.15, 0.45, 0.2, true);
341
+ else if (s.label === 'aurora') anchor(s.label, group, 0, 1.25, 0.2, true);
342
+ else if (s.label === 'lens' || s.label === 'co2') anchor(s.label, group, 0, -0.35, 1.3 * (s.lensSide || 1));
343
+ else if (s.label === 'haze') anchor(s.label, group, -0.4, 1.3, 0);
344
+ else anchor(s.label, group, 0, -1.3, 0);
345
+ }
346
+ });
347
+
348
+ // background plasma flow, deflected around the obstacle
349
+ if (f.flow) {
350
+ const n = f.flow.n, obs = f.flow.obs, col = f.flow.c || DEFAULT_FLOW;
351
+ const pts = makePoints(n, size * 0.16);
352
+ flowFrame.add(pts);
353
+ const P = pts.geometry.attributes.position.array, C = pts.geometry.attributes.color.array;
354
+ const Z0 = -5, Z1 = 5, RAD = Math.max(3.4, obs * 1.9);
355
+ const spawn = (i, anywhere) => {
356
+ const a = Math.random() * TAU, r = Math.sqrt(Math.random()) * RAD;
357
+ P[i * 3] = Math.cos(a) * r; P[i * 3 + 1] = Math.sin(a) * r;
358
+ P[i * 3 + 2] = anywhere ? Z0 + Math.random() * (Z1 - Z0) : Z0 - Math.random() * 0.5;
359
+ };
360
+ for (let i = 0; i < n; i++) spawn(i, true);
361
+ updaters.push((dt, sp) => {
362
+ const v = 1.4 * dt * sp;
363
+ for (let i = 0; i < n; i++) {
364
+ const k = i * 3;
365
+ let x = P[k], y = P[k + 1], z = P[k + 2] + v;
366
+ let r = Math.hypot(x, y, z);
367
+ if (r < obs) { const s = obs * 1.01 / r; x *= s; y *= s; z *= s; r = obs * 1.01; }
368
+ if (z > Z1) { spawn(i, false); continue; }
369
+ P[k] = x; P[k + 1] = y; P[k + 2] = z;
370
+ const edge = Math.min(1, (z - Z0) / 1.2, (Z1 - z) / 1.5) * Math.max(0, 1 - Math.hypot(x, y) / RAD);
371
+ const pile = Math.exp(-(((r - obs) / 0.45) ** 2)) * (z < 0.3 ? 1.6 : 0.5);
372
+ const b = (0.28 + pile) * Math.max(0, edge);
373
+ C[k] = col[0] * b; C[k + 1] = col[1] * b; C[k + 2] = col[2] * b;
374
+ }
375
+ pts.geometry.attributes.position.needsUpdate = true;
376
+ pts.geometry.attributes.color.needsUpdate = true;
377
+ });
378
+ anchor(f.flow.label || 'flow', flowFrame, 0, Math.min(RAD, 2.6), -3.2);
379
+ if (f.wake) anchor('wake', flowFrame, 0, 0.35, 3.0);
380
+ }
381
+
382
+ // pick-up ions: gas from the moon is ionised and swept downstream in a helical tail
383
+ if (f.tail) {
384
+ const n = f.tail.n, col = f.tail.c, len = f.tail.len;
385
+ const pts = makePoints(n, size * 0.14);
386
+ flowFrame.add(pts);
387
+ const P = pts.geometry.attributes.position.array, C = pts.geometry.attributes.color.array;
388
+ const S = new Float32Array(n * 5); // bx, by, z, vz, phase
389
+ const spawn = (i, anywhere) => {
390
+ const u = Math.random() * 2 - 1, a = Math.random() * TAU, rr = 1.05 + Math.random() * 0.25;
391
+ const s = Math.sqrt(1 - u * u);
392
+ S[i * 5] = Math.cos(a) * s * rr; S[i * 5 + 1] = Math.sin(a) * s * rr;
393
+ S[i * 5 + 2] = anywhere ? Math.random() * len : u * rr;
394
+ S[i * 5 + 3] = anywhere ? 0.6 + Math.random() * 0.6 : 0.05;
395
+ S[i * 5 + 4] = Math.random() * TAU;
396
+ };
397
+ for (let i = 0; i < n; i++) spawn(i, true);
398
+ updaters.push((dt, sp) => {
399
+ const d = dt * sp;
400
+ for (let i = 0; i < n; i++) {
401
+ const s = i * 5, k = i * 3;
402
+ S[s + 3] = Math.min(1.8, S[s + 3] + 0.9 * d);
403
+ S[s + 2] += S[s + 3] * d;
404
+ S[s + 4] += 5.0 * d;
405
+ const z = S[s + 2];
406
+ if (z > len) { spawn(i, false); continue; }
407
+ const grow = Math.min(1, Math.max(0, z + 1) / 2);
408
+ const rg = 0.18 * grow, spread = 1 + 0.12 * Math.max(0, z);
409
+ P[k] = S[s] * spread + rg * Math.cos(S[s + 4]);
410
+ P[k + 1] = S[s + 1] * spread + rg * Math.sin(S[s + 4]);
411
+ P[k + 2] = z;
412
+ const b = 1.1 * Math.max(0, 1 - z / len) * Math.min(1, (z + 1.3) / 0.8);
413
+ C[k] = col[0] * b; C[k + 1] = col[1] * b; C[k + 2] = col[2] * b;
414
+ }
415
+ pts.geometry.attributes.position.needsUpdate = true;
416
+ pts.geometry.attributes.color.needsUpdate = true;
417
+ });
418
+ anchor('tail', flowFrame, 0, 0.9, len * 0.62);
419
+ }
420
+
421
+ // volcanic plumes (ballistic umbrellas), Enceladus jets, Triton geysers
422
+ if (f.plumes) {
423
+ const pl = f.plumes, vents = pl.vents.map(ventDir), nv = vents.length, per = pl.n, n = nv * per;
424
+ const sizeK = pl.type === 'jets' ? 0.12 : pl.type === 'geyser' ? 0.1 : 0.13;
425
+ const pts = makePoints(n, size * sizeK);
426
+ group.add(pts);
427
+ const P = pts.geometry.attributes.position.array, C = pts.geometry.attributes.color.array;
428
+ const V = new Float32Array(n * 3), A = new Float32Array(n * 3); // vel; age, life, palette
429
+ const g = pl.type === 'jets' ? 0.22 : 1.6;
430
+ const v0 = pl.type === 'jets' ? 2.0 : Math.sqrt(2 * g * (pl.h || 0.3));
431
+ const winds = vents.map(nv_ => new THREE.Vector3(0, 1, 0).cross(nv_).normalize().multiplyScalar(0.28));
432
+ const spawn = (i, anywhere) => {
433
+ const vi = (i / per) | 0, nvec = vents[vi];
434
+ const t1 = tmpV.set(0, 1, 0).cross(nvec); if (t1.lengthSq() < 1e-4) t1.set(1, 0, 0); t1.normalize();
435
+ const t2 = new THREE.Vector3().crossVectors(nvec, t1);
436
+ const a = Math.random() * TAU, sp = (pl.type === 'jets' ? 0.18 : 0.38) * Math.random();
437
+ const k = i * 3;
438
+ P[k] = nvec.x * 1.0; P[k + 1] = nvec.y * 1.0; P[k + 2] = nvec.z * 1.0;
439
+ const vv = v0 * (0.75 + Math.random() * 0.35);
440
+ V[k] = (nvec.x + (t1.x * Math.cos(a) + t2.x * Math.sin(a)) * sp) * vv;
441
+ V[k + 1] = (nvec.y + (t1.y * Math.cos(a) + t2.y * Math.sin(a)) * sp) * vv;
442
+ V[k + 2] = (nvec.z + (t1.z * Math.cos(a) + t2.z * Math.sin(a)) * sp) * vv;
443
+ A[k] = 0; A[k + 1] = pl.type === 'jets' ? 9 + Math.random() * 4 : pl.type === 'geyser' ? 4 + Math.random() * 2 : (2 * vv / g) * 1.05;
444
+ A[k + 2] = (Math.random() * pl.colors.length) | 0;
445
+ if (anywhere) { // fast-forward to a random point in its life
446
+ const steps = (Math.random() * A[k + 1] * 20) | 0;
447
+ for (let s = 0; s < steps; s++) step(i, 0.05);
448
+ }
449
+ };
450
+ const step = (i, dt) => {
451
+ const k = i * 3, vi = (i / per) | 0;
452
+ A[k] += dt;
453
+ if (pl.type === 'geyser') {
454
+ const nvec = vents[vi];
455
+ const h = P[k] * nvec.x + P[k + 1] * nvec.y + P[k + 2] * nvec.z - 1;
456
+ if (h < pl.h) { P[k] += nvec.x * v0 * dt; P[k + 1] += nvec.y * v0 * dt; P[k + 2] += nvec.z * v0 * dt; }
457
+ else { const w = winds[vi]; P[k] += w.x * dt; P[k + 1] += w.y * dt; P[k + 2] += w.z * dt; }
458
+ return;
459
+ }
460
+ const r = Math.hypot(P[k], P[k + 1], P[k + 2]) || 1;
461
+ V[k] -= P[k] / r * g * dt; V[k + 1] -= P[k + 1] / r * g * dt; V[k + 2] -= P[k + 2] / r * g * dt;
462
+ if (pl.type === 'jets') V[k + 2] += 0.22 * dt; // drift downstream to feed the E ring / torus
463
+ P[k] += V[k] * dt; P[k + 1] += V[k + 1] * dt; P[k + 2] += V[k + 2] * dt;
464
+ };
465
+ for (let i = 0; i < n; i++) spawn(i, true);
466
+ updaters.push((dt, sp) => {
467
+ const d = Math.min(dt * sp, 0.06);
468
+ for (let i = 0; i < n; i++) {
469
+ step(i, d);
470
+ const k = i * 3, life = A[k + 1], age = A[k];
471
+ const r = Math.hypot(P[k], P[k + 1], P[k + 2]);
472
+ if (age > life || r < 0.985 || r > 8) { spawn(i, false); continue; }
473
+ const x = age / life;
474
+ const fade = pl.type === 'umbrella' ? Math.sin(Math.PI * Math.min(1, x)) ** 0.6 : Math.min(1, x * 8) * (1 - x);
475
+ const c = pl.colors[A[k + 2]];
476
+ const b = (pl.type === 'jets' ? 1.0 : 1.5) * fade;
477
+ C[k] = c[0] * b; C[k + 1] = c[1] * b; C[k + 2] = c[2] * b;
478
+ }
479
+ pts.geometry.attributes.position.needsUpdate = true;
480
+ pts.geometry.attributes.color.needsUpdate = true;
481
+ });
482
+ const v = vents[0];
483
+ const lift = pl.type === 'jets' ? 2.4 : 1.55;
484
+ anchor(pl.label, group, v.x * lift, v.y * lift, v.z * lift);
485
+ }
486
+
487
+ // Alfvén wings: the moon disturbs the field, and waves carry energy along it to the planet's aurora
488
+ if (f.wings) {
489
+ const polys = [], R0 = f.wings.r;
490
+ for (const sg of [1, -1]) for (let k = 0; k < 6; k++) {
491
+ const ph = k / 6 * TAU, pts = [], t = [];
492
+ for (let i = 0; i <= 30; i++) {
493
+ const u = i / 30;
494
+ pts.push(new THREE.Vector3(Math.cos(ph) * R0 * (1 - 0.3 * u), sg * (0.25 + 7 * u), Math.sin(ph) * R0 * 0.6 + 2.6 * u + 0.4 * u * u));
495
+ t.push(u);
496
+ }
497
+ polys.push({ pts, t });
498
+ }
499
+ const m = lineMaterial(f.wings.c, 0.8, 0.7);
500
+ const lines = new THREE.LineSegments(linesGeometry(polys), m);
501
+ lines.frustumCulled = false;
502
+ group.add(lines); timed.push(m);
503
+ anchor('wings', group, 0, 4.6, 2.0);
504
+ }
505
+
506
+ // Ganymede's own magnetosphere: closed loops near the equator, open field lines over the poles
507
+ if (f.minimag) {
508
+ const polys = [];
509
+ for (const L of [1.5, 2.0, 2.6]) for (let k = 0; k < 8; k++) {
510
+ const ph = k / 8 * TAU + L, th0 = Math.asin(Math.sqrt(1 / L)), pts = [], t = [];
511
+ for (let i = 0; i <= 40; i++) {
512
+ const u = i / 40, th = th0 + (Math.PI - 2 * th0) * u, r = L * Math.sin(th) ** 2;
513
+ const p = new THREE.Vector3(r * Math.sin(th) * Math.cos(ph), r * Math.cos(th), r * Math.sin(th) * Math.sin(ph));
514
+ p.z *= p.z < 0 ? 0.75 : 1.35;
515
+ pts.push(p); t.push(u);
516
+ }
517
+ polys.push({ pts, t });
518
+ }
519
+ for (const sg of [1, -1]) for (let k = 0; k < 7; k++) {
520
+ const ph = k / 7 * TAU, c = 0.32, pts = [], t = [];
521
+ for (let i = 0; i <= 30; i++) {
522
+ const r = 1 + 5 * i / 30;
523
+ pts.push(new THREE.Vector3(Math.sin(c) * Math.cos(ph) * r, sg * Math.cos(c) * r, Math.sin(c) * Math.sin(ph) * r + 0.3 * (r - 1)));
524
+ t.push(i / 30);
525
+ }
526
+ polys.push({ pts, t });
527
+ }
528
+ const m = lineMaterial(f.minimag.c, 0.85, 0.5);
529
+ const lines = new THREE.LineSegments(linesGeometry(polys), m);
530
+ lines.frustumCulled = false;
531
+ group.add(lines); timed.push(m);
532
+ const bub = new THREE.Mesh(new THREE.SphereGeometry(1, 48, 24), fresnelMaterial([0.55, 0.5, 1.0], 0.22));
533
+ bub.scale.set(2.1, 2.3, 2.8); bub.position.z = 0.5;
534
+ group.add(bub); timed.push(bub.material);
535
+ anchor('minimag', group, 1.4, 2.4, 0.4);
536
+ }
537
+
538
+ // Titan: Saturn's field piles up and drapes around the ionosphere, forming an induced magnetotail
539
+ if (f.drape) {
540
+ const polys = [];
541
+ for (const x of [-1.8, -0.9, 0, 0.9, 1.8]) for (const dz of [0, 0.7]) {
542
+ const A = 3.4 - 0.5 * Math.abs(x) + dz, z0 = -1.6 + dz * 0.3, pts = [], t = [];
543
+ for (let i = 0; i <= 60; i++) {
544
+ const y = -4 + 8 * i / 60;
545
+ pts.push(new THREE.Vector3(x, y, z0 + A * Math.exp(-(y * y) / 2.25)));
546
+ t.push(Math.abs(y) / 4);
547
+ }
548
+ polys.push({ pts, t });
549
+ }
550
+ const m = lineMaterial(f.drape.c, 0.85, -0.5);
551
+ const lines = new THREE.LineSegments(linesGeometry(polys), m);
552
+ lines.frustumCulled = false;
553
+ flowFrame.add(lines); timed.push(m);
554
+ anchor('drape', flowFrame, 1.9, 2.6, 1.2);
555
+ }
556
+
557
+ // neutral cloud spread along the orbit ahead of the moon (Io's sodium "banana", Enceladus' water cloud)
558
+ let cloud = null;
559
+ if (f.cloud && holder) {
560
+ const c = f.cloud;
561
+ const geo = new THREE.TorusGeometry(dist, c.tube, 12, 96, c.arc);
562
+ geo.rotateX(-Math.PI / 2);
563
+ const m = cloudMaterial(c.c, c.a);
564
+ cloud = new THREE.Mesh(geo, m);
565
+ cloud.renderOrder = 1;
566
+ holder.add(cloud); timed.push(m);
567
+ const a = c.arc * 0.45;
568
+ const o = new THREE.Object3D(); o.position.set(dist * Math.cos(a), c.tube * 1.6, -dist * Math.sin(a)); cloud.add(o);
569
+ anchors.push({ key: c.label, obj: o, aurora: false });
570
+ }
571
+
572
+ return {
573
+ group,
574
+ anchors,
575
+ // dt: real seconds; ang: orbit angle; t: elapsed seconds; sp: time-speed factor
576
+ // camDist: camera distance in moon radii (halo and cloud fade out in close-up)
577
+ update(dt, ang, t, { aurora = true, speed = 1, camDist = 100 } = {}) {
578
+ const far = THREE.MathUtils.smoothstep(camDist, 10, 45);
579
+ if (halo) halo.material.opacity = f.halo[3] * far;
580
+ if (cloud) cloud.material.uniforms.uOpacity.value = f.cloud.a * (0.2 + 0.8 * far);
581
+ if (f.flow?.mode === 'sun') {
582
+ // flow from the Sun (world -x) expressed in this moon's frame
583
+ group.getWorldQuaternion(tmpQ).invert();
584
+ tmpV.set(-1, 0, 0).applyQuaternion(tmpQ).normalize();
585
+ flowFrame.quaternion.setFromUnitVectors(Z, tmpV);
586
+ }
587
+ const sp = Math.max(0.25, Math.min(speed, 3));
588
+ updaters.forEach(u => u(dt, sp));
589
+ timed.forEach(m => { m.uniforms.uTime.value = t; });
590
+ shellMats.forEach(m => { m.uniforms.uAur.value = aurora ? 1 : 0; });
591
+ if (cloud) cloud.rotation.y = ang - 0.06;
592
+ },
593
+ setVisible(v) { group.visible = v; if (cloud) cloud.visible = v; }
594
+ };
595
+ }
js/scene.js CHANGED
@@ -9,6 +9,7 @@ import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
9
  import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
10
  import { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js';
11
  import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';
 
12
 
13
  THREE.ColorManagement.enabled = false;
14
 
@@ -308,6 +309,36 @@ function boundaryMaterial(color, strength, tail) {
308
  });
309
  }
310
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
311
  function torusMaterial(color) {
312
  return new THREE.ShaderMaterial({
313
  uniforms: { uTime: { value: 0 }, uColor: { value: new THREE.Vector3(...color) } },
@@ -536,7 +567,7 @@ export function createScene(container, { t = k => k, onPlanetChange = () => {},
536
  const state = {
537
  name: null, cfg: null, root: null, time: 0, speed: 1,
538
  layers: { field: true, wind: true, mp: true, aurora: true, torus: true, moons: true, labels: true },
539
- objs: {}, tween: null, auroraBoost: 1, follow: null
540
  };
541
 
542
  /* ---------------------------------------------------- build a planet */
@@ -656,7 +687,14 @@ export function createScene(container, { t = k => k, onPlanetChange = () => {},
656
  tube.frustumCulled = false;
657
  root.add(tube);
658
  }
659
- moons.push({ cfg: m, holder, mesh, tube, label });
 
 
 
 
 
 
 
660
  });
661
 
662
  // Boundaries (fixed in the Sun-planet frame)
@@ -664,6 +702,7 @@ export function createScene(container, { t = k => k, onPlanetChange = () => {},
664
  const mpMesh = new THREE.Mesh(boundaryGeometry(cfg.mp, MP_ALPHA, tailLen), boundaryMaterial([0.3, 0.7, 1.0], 0.3, tailLen));
665
  const bsMesh = new THREE.Mesh(boundaryGeometry(cfg.mp * BS_SCALE, BS_ALPHA, tailLen * 0.7), boundaryMaterial([1.0, 0.55, 0.25], 0.18, tailLen * 0.7));
666
  mpMesh.renderOrder = 3; bsMesh.renderOrder = 3;
 
667
  const boundaries = new THREE.Group();
668
  boundaries.add(mpMesh, bsMesh);
669
  {
@@ -676,7 +715,7 @@ export function createScene(container, { t = k => k, onPlanetChange = () => {},
676
  root.add(boundaries);
677
 
678
  // Solar wind particles
679
- const N = 2600;
680
  const wpos = new Float32Array(N * 3), wcol = new Float32Array(N * 3), wvel = new Float32Array(N);
681
  const spawnX = cfg.mp * 3.2, spawnR = cfg.mp * 2.6, endX = -tailLen * 0.9;
682
  const respawn = (i, anywhere) => {
@@ -696,9 +735,18 @@ export function createScene(container, { t = k => k, onPlanetChange = () => {},
696
  wind.add(windLabel);
697
  root.add(wind);
698
 
 
 
 
 
 
 
 
 
 
699
  scene.add(root);
700
  state.root = root;
701
- state.objs = { tilt, spin, mag, planet, clouds, field, auroraGroup, auroraMats, rings, torus, moons, boundaries, mpMesh, bsMesh, wind, wpos, wcol, wvel, respawn, spawnX, endX, north, south };
702
  state.time = 0;
703
  applyLayers();
704
  refreshLabels();
@@ -708,7 +756,7 @@ export function createScene(container, { t = k => k, onPlanetChange = () => {},
708
  /* ------------------------------------------------------------ update */
709
  const tmpV = new THREE.Vector3(), tmpW = new THREE.Vector3(), magInv = new THREE.Matrix4();
710
 
711
- function updateMoons() {
712
  const { moons, mag, spin, auroraMats } = state.objs;
713
  const feet = [], weights = [];
714
  mag.updateWorldMatrix(true, false);
@@ -718,6 +766,10 @@ export function createScene(container, { t = k => k, onPlanetChange = () => {},
718
  const ang = m.phase + (2 * Math.PI / (m.period * 24)) * state.time;
719
  mo.mesh.position.set(m.dist * Math.cos(ang), 0, -m.dist * Math.sin(ang));
720
  mo.mesh.rotation.y = ang + Math.PI; // tidally locked: the same face always looks at the planet
 
 
 
 
721
  if (!mo.tube) return;
722
  mo.mesh.getWorldPosition(tmpW);
723
  const local = tmpV.copy(tmpW).applyMatrix4(magInv);
@@ -754,9 +806,17 @@ export function createScene(container, { t = k => k, onPlanetChange = () => {},
754
  function updateWind(dt) {
755
  if (!state.layers.wind) return;
756
  const { wpos, wcol, wvel, respawn, endX } = state.objs;
757
- const mp = state.cfg.mp;
758
- const speed = mp * 0.55 * dt * Math.max(0.25, Math.min(state.speed, 3));
759
- const n = wvel.length;
 
 
 
 
 
 
 
 
760
  for (let i = 0; i < n; i++) {
761
  const ix = i * 3;
762
  let x = wpos[ix], y = wpos[ix + 1], z = wpos[ix + 2];
@@ -774,13 +834,51 @@ export function createScene(container, { t = k => k, onPlanetChange = () => {},
774
  }
775
  wpos[ix] = x; wpos[ix + 1] = y; wpos[ix + 2] = z;
776
  if (x < endX) respawn(i, false);
777
- if (inSheath) { wcol[ix] = 1.0; wcol[ix + 1] = 0.55; wcol[ix + 2] = 0.25; }
778
- else { wcol[ix] = 1.0; wcol[ix + 1] = 0.9; wcol[ix + 2] = 0.6; }
779
  }
780
  state.objs.wind.geometry.attributes.position.needsUpdate = true;
781
  state.objs.wind.geometry.attributes.color.needsUpdate = true;
782
  }
783
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
784
  function applyLayers() {
785
  const o = state.objs, L = state.layers;
786
  if (!o.field) return;
@@ -836,7 +934,7 @@ export function createScene(container, { t = k => k, onPlanetChange = () => {},
836
  // look at the moon from its sunlit side, a little above the orbit plane, with the planet in view
837
  mo.mesh.getWorldPosition(followPos);
838
  const out = followPos.clone().normalize();
839
- const d = Math.max(mo.cfg.size * 9, 0.7);
840
  return out.multiplyScalar(0.55).add(new THREE.Vector3(0.45, 0.4, 0.5)).normalize().multiplyScalar(d);
841
  }
842
  function focusMoon(key, instant = false) {
@@ -875,7 +973,7 @@ export function createScene(container, { t = k => k, onPlanetChange = () => {},
875
  pointer.set(((e.clientX - r.left) / r.width) * 2 - 1, -((e.clientY - r.top) / r.height) * 2 + 1);
876
  raycaster.setFromCamera(pointer, camera);
877
  const targets = state.layers.moons ? state.objs.moons.map(m => m.mesh) : [];
878
- renderer.domElement.style.cursor = raycaster.intersectObjects(targets, true).length ? 'pointer' : '';
879
  });
880
 
881
  /* ------------------------------------------------------------- loop */
@@ -904,15 +1002,23 @@ export function createScene(container, { t = k => k, onPlanetChange = () => {},
904
  const dtHours = dt * 0.42 * state.speed;
905
  state.time += dtHours;
906
  o.spin.rotation.y = (2 * Math.PI / cfg.period) * state.time;
 
 
 
 
907
  const tsec = clock.elapsedTime;
908
  o.field.material.uniforms.uTime.value = tsec;
909
- o.auroraMats.forEach(m => { m.uniforms.uTime.value = tsec; m.uniforms.uBoost.value += (state.auroraBoost - m.uniforms.uBoost.value) * 0.05; });
910
  if (o.clouds) o.clouds.rotation.y += dt * 0.004 * state.speed;
911
  o.mpMesh.material.uniforms.uTime.value = tsec;
912
  o.bsMesh.material.uniforms.uTime.value = tsec;
913
  if (o.torus) o.torus.material.uniforms.uTime.value = tsec;
914
  o.moons.forEach(m => { if (m.tube) m.tube.material.uniforms.uTime.value = tsec; });
915
- updateMoons();
 
 
 
 
916
  updateWind(dt);
917
 
918
  if (state.follow && !state.tween) {
@@ -947,6 +1053,18 @@ export function createScene(container, { t = k => k, onPlanetChange = () => {},
947
  setLayers(obj) { Object.assign(state.layers, obj); applyLayers(); },
948
  getLayers() { return { ...state.layers }; },
949
  setSpeed(s) { state.speed = s; },
 
 
 
 
 
 
 
 
 
 
 
 
950
  view,
951
  refreshLabels,
952
  get planet() { return state.name; },
 
9
  import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
10
  import { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js';
11
  import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';
12
+ import { createMoonFX } from './moonfx.js';
13
 
14
  THREE.ColorManagement.enabled = false;
15
 
 
309
  });
310
  }
311
 
312
+ // Coronal mass ejection: a glowing, turbulent cap of plasma that sweeps from the Sun past the planet.
313
+ function cmeMaterial(R, cosCap) {
314
+ return new THREE.ShaderMaterial({
315
+ uniforms: { uTime: { value: 0 }, uFade: { value: 1 }, uR: { value: R }, uCap: { value: cosCap } },
316
+ vertexShader: /* glsl */`
317
+ uniform float uR;
318
+ varying float vC; varying vec3 vN; varying vec3 vV; varying vec3 vL;
319
+ void main(){
320
+ vC = position.y / uR; vL = position / uR;
321
+ vec4 wp = modelMatrix * vec4(position, 1.0);
322
+ vN = normalize(mat3(modelMatrix) * normal); vV = cameraPosition - wp.xyz;
323
+ gl_Position = projectionMatrix * viewMatrix * wp;
324
+ }`,
325
+ fragmentShader: /* glsl */`
326
+ uniform float uTime, uFade, uCap;
327
+ varying float vC; varying vec3 vN; varying vec3 vV; varying vec3 vL;
328
+ ${NOISE_GLSL}
329
+ void main(){
330
+ float edge = smoothstep(uCap, uCap + (1.0 - uCap) * 0.55, vC);
331
+ float n = noise3(vL * 7.0 + vec3(0.0, uTime * 0.6, 0.0));
332
+ float fil = pow(noise3(vL * 22.0 - vec3(uTime * 0.9)), 2.0);
333
+ float f = pow(1.0 - abs(dot(normalize(vN), normalize(vV))), 1.4);
334
+ vec3 col = mix(vec3(1.0, 0.35, 0.12), vec3(1.0, 0.85, 0.5), n);
335
+ float a = edge * (0.25 + 0.75 * n + fil * 1.2) * (0.2 + 1.2 * f) * uFade;
336
+ gl_FragColor = vec4(col * a * 0.45, 1.0);
337
+ }`,
338
+ transparent: true, depthWrite: false, blending: THREE.AdditiveBlending, side: THREE.DoubleSide
339
+ });
340
+ }
341
+
342
  function torusMaterial(color) {
343
  return new THREE.ShaderMaterial({
344
  uniforms: { uTime: { value: 0 }, uColor: { value: new THREE.Vector3(...color) } },
 
567
  const state = {
568
  name: null, cfg: null, root: null, time: 0, speed: 1,
569
  layers: { field: true, wind: true, mp: true, aurora: true, torus: true, moons: true, labels: true },
570
+ objs: {}, tween: null, auroraBoost: 1, follow: null, wind: 1, windK: 1
571
  };
572
 
573
  /* ---------------------------------------------------- build a planet */
 
687
  tube.frustumCulled = false;
688
  root.add(tube);
689
  }
690
+ // plasma, aurora, plumes and atmosphere around the moon
691
+ const fx = createMoonFX(m.key, { size: m.size, dist: m.dist, holder });
692
+ const fxLabels = [];
693
+ if (fx) {
694
+ mesh.add(fx.group);
695
+ fx.anchors.forEach(a => { const l = makeLabel('fx.' + a.key, 'fx'); l.visible = false; l.userData.aurora = a.aurora; l.userData.cond = a.cond; a.obj.add(l); fxLabels.push(l); });
696
+ }
697
+ moons.push({ cfg: m, holder, mesh, tube, label, fx, fxLabels });
698
  });
699
 
700
  // Boundaries (fixed in the Sun-planet frame)
 
702
  const mpMesh = new THREE.Mesh(boundaryGeometry(cfg.mp, MP_ALPHA, tailLen), boundaryMaterial([0.3, 0.7, 1.0], 0.3, tailLen));
703
  const bsMesh = new THREE.Mesh(boundaryGeometry(cfg.mp * BS_SCALE, BS_ALPHA, tailLen * 0.7), boundaryMaterial([1.0, 0.55, 0.25], 0.18, tailLen * 0.7));
704
  mpMesh.renderOrder = 3; bsMesh.renderOrder = 3;
705
+ mpMesh.userData.base = 0.3; bsMesh.userData.base = 0.18;
706
  const boundaries = new THREE.Group();
707
  boundaries.add(mpMesh, bsMesh);
708
  {
 
715
  root.add(boundaries);
716
 
717
  // Solar wind particles
718
+ const N = 4200;
719
  const wpos = new Float32Array(N * 3), wcol = new Float32Array(N * 3), wvel = new Float32Array(N);
720
  const spawnX = cfg.mp * 3.2, spawnR = cfg.mp * 2.6, endX = -tailLen * 0.9;
721
  const respawn = (i, anywhere) => {
 
735
  wind.add(windLabel);
736
  root.add(wind);
737
 
738
+ // CME shock front (hidden until launched)
739
+ const cmeR = cfg.mp * 3.2, cmeCap = Math.cos(42 * DEG);
740
+ const cme = new THREE.Mesh(new THREE.SphereGeometry(cmeR, 64, 24, 0, Math.PI * 2, 0, 42 * DEG), cmeMaterial(cmeR, cmeCap));
741
+ cme.rotation.z = Math.PI / 2; // cap apex points at the planet (−x)
742
+ cme.renderOrder = 4; cme.visible = false; cme.frustumCulled = false;
743
+ cme.userData.R = cmeR;
744
+ root.add(cme);
745
+ state.cme = null; state.kick = 0;
746
+
747
  scene.add(root);
748
  state.root = root;
749
+ state.objs = { tilt, spin, mag, planet, clouds, field, auroraGroup, auroraMats, rings, torus, moons, boundaries, mpMesh, bsMesh, wind, cme, wpos, wcol, wvel, respawn, spawnX, endX, north, south };
750
  state.time = 0;
751
  applyLayers();
752
  refreshLabels();
 
756
  /* ------------------------------------------------------------ update */
757
  const tmpV = new THREE.Vector3(), tmpW = new THREE.Vector3(), magInv = new THREE.Matrix4();
758
 
759
+ function updateMoons(dt = 0, tsec = 0) {
760
  const { moons, mag, spin, auroraMats } = state.objs;
761
  const feet = [], weights = [];
762
  mag.updateWorldMatrix(true, false);
 
766
  const ang = m.phase + (2 * Math.PI / (m.period * 24)) * state.time;
767
  mo.mesh.position.set(m.dist * Math.cos(ang), 0, -m.dist * Math.sin(ang));
768
  mo.mesh.rotation.y = ang + Math.PI; // tidally locked: the same face always looks at the planet
769
+ if (mo.fx && state.layers.moons) {
770
+ mo.mesh.getWorldPosition(tmpW);
771
+ mo.fx.update(dt, ang, tsec, { aurora: state.layers.aurora, speed: state.speed, camDist: camera.position.distanceTo(tmpW) / m.size });
772
+ }
773
  if (!mo.tube) return;
774
  mo.mesh.getWorldPosition(tmpW);
775
  const local = tmpV.copy(tmpW).applyMatrix4(magInv);
 
806
  function updateWind(dt) {
807
  if (!state.layers.wind) return;
808
  const { wpos, wcol, wvel, respawn, endX } = state.objs;
809
+ const k = state.windK;
810
+ const mp = state.cfg.mp * windScale();
811
+ // faster, denser, brighter stream when the solar wind is stronger
812
+ const speed = state.cfg.mp * 0.55 * dt * Math.max(0.25, Math.min(state.speed, 3)) * (0.55 + 0.45 * k);
813
+ const n = Math.round(wvel.length * THREE.MathUtils.clamp(0.2 + 0.45 * k, 0.15, 1));
814
+ state.objs.wind.geometry.setDrawRange(0, n);
815
+ const b = THREE.MathUtils.clamp(0.75 + 0.25 * k, 0.6, 1.6);
816
+ // colour shifts from pale blue (calm) through yellow-white to hot orange-red (storm)
817
+ const u = THREE.MathUtils.clamp((k - 0.3) / 0.7, 0, 1), v = THREE.MathUtils.clamp((k - 1) / 2.5, 0, 1);
818
+ const cr = b, cg = b * (0.85 + 0.05 * u - 0.45 * v), cb = b * ((1.0 - 0.4 * u) - 0.3 * v);
819
+ const sr = b, sg = b * (0.55 - 0.25 * v), sb = b * (0.25 + 0.1 * v);
820
  for (let i = 0; i < n; i++) {
821
  const ix = i * 3;
822
  let x = wpos[ix], y = wpos[ix + 1], z = wpos[ix + 2];
 
834
  }
835
  wpos[ix] = x; wpos[ix + 1] = y; wpos[ix + 2] = z;
836
  if (x < endX) respawn(i, false);
837
+ if (inSheath) { wcol[ix] = sr; wcol[ix + 1] = sg; wcol[ix + 2] = sb; }
838
+ else { wcol[ix] = cr; wcol[ix + 1] = cg; wcol[ix + 2] = cb; }
839
  }
840
  state.objs.wind.geometry.attributes.position.needsUpdate = true;
841
  state.objs.wind.geometry.attributes.color.needsUpdate = true;
842
  }
843
 
844
+ // Stand-off distance scales roughly as (dynamic pressure)^(-1/6); exaggerated a little so the change is easy to see.
845
+ function windScale() { return THREE.MathUtils.clamp(Math.pow(state.windK, -0.22), 0.7, 1.35); }
846
+ function windBoost() { return THREE.MathUtils.clamp(0.45 + 0.55 * state.windK, 0.5, 2.6); }
847
+ function applyWind() {
848
+ const o = state.objs, cfg = state.cfg, k = state.windK, s = windScale();
849
+ o.boundaries.scale.setScalar(s);
850
+ const glow = THREE.MathUtils.clamp(0.65 + 0.35 * k + state.kick * 1.5, 0.6, 3);
851
+ o.mpMesh.material.uniforms.uStrength.value = o.mpMesh.userData.base * glow;
852
+ o.bsMesh.material.uniforms.uStrength.value = o.bsMesh.userData.base * glow;
853
+ o.field.material.uniforms.uMp.value = cfg.mp * s;
854
+ o.moons.forEach(m => { if (m.tube) m.tube.material.uniforms.uMp.value = cfg.mp * s; });
855
+ // a stronger wind pushes the auroral oval towards the equator and widens it
856
+ const a = cfg.aurora;
857
+ const colat = a.colat * THREE.MathUtils.clamp(1 + 0.13 * (k - 1), 0.88, 1.42);
858
+ const width = a.width * THREE.MathUtils.clamp(1 + 0.3 * (k - 1), 0.8, 2.0);
859
+ o.auroraMats.forEach(m => { m.uniforms.uColat.value = colat; m.uniforms.uWidth.value = width; });
860
+ }
861
+
862
+ function launchCME(x0) {
863
+ const o = state.objs; if (!o.cme) return;
864
+ state.cme = { x: x0 ? x0 * state.cfg.mp : o.spawnX * 1.25, hit: false };
865
+ o.cme.visible = true;
866
+ }
867
+ function updateCME(dt, tsec) {
868
+ const o = state.objs, c = state.cme;
869
+ if (state.kick > 0) state.kick = Math.max(0, state.kick - dt * 0.11); // storm fades over ~9 s
870
+ if (!c) return;
871
+ const mp = state.cfg.mp;
872
+ c.x -= mp * 0.9 * dt;
873
+ o.cme.position.set(c.x + o.cme.userData.R, 0, 0);
874
+ const u = o.cme.material.uniforms;
875
+ u.uTime.value = tsec;
876
+ // fade in after launch, fade out once it has swept past the planet
877
+ u.uFade.value = THREE.MathUtils.clamp((o.spawnX * 1.25 - c.x) / (mp * 0.6), 0, 1) * THREE.MathUtils.clamp((c.x - o.endX) / (mp * 2.5), 0, 1);
878
+ if (!c.hit && c.x < mp * BS_SCALE * windScale()) { c.hit = true; state.kick = 1; }
879
+ if (c.x < o.endX) { state.cme = null; o.cme.visible = false; }
880
+ }
881
+
882
  function applyLayers() {
883
  const o = state.objs, L = state.layers;
884
  if (!o.field) return;
 
934
  // look at the moon from its sunlit side, a little above the orbit plane, with the planet in view
935
  mo.mesh.getWorldPosition(followPos);
936
  const out = followPos.clone().normalize();
937
+ const d = Math.max(mo.cfg.size * 15, 0.85);
938
  return out.multiplyScalar(0.55).add(new THREE.Vector3(0.45, 0.4, 0.5)).normalize().multiplyScalar(d);
939
  }
940
  function focusMoon(key, instant = false) {
 
973
  pointer.set(((e.clientX - r.left) / r.width) * 2 - 1, -((e.clientY - r.top) / r.height) * 2 + 1);
974
  raycaster.setFromCamera(pointer, camera);
975
  const targets = state.layers.moons ? state.objs.moons.map(m => m.mesh) : [];
976
+ renderer.domElement.style.cursor = raycaster.intersectObjects(targets, true).some(h => h.object.userData.pick) ? 'pointer' : '';
977
  });
978
 
979
  /* ------------------------------------------------------------- loop */
 
1002
  const dtHours = dt * 0.42 * state.speed;
1003
  state.time += dtHours;
1004
  o.spin.rotation.y = (2 * Math.PI / cfg.period) * state.time;
1005
+ updateCME(dt, clock.elapsedTime);
1006
+ const windTarget = Math.min(5, state.wind + 3 * state.kick);
1007
+ state.windK += (windTarget - state.windK) * Math.min(1, dt * (state.kick > 0 ? 4 : 2.5));
1008
+ applyWind();
1009
  const tsec = clock.elapsedTime;
1010
  o.field.material.uniforms.uTime.value = tsec;
1011
+ o.auroraMats.forEach(m => { m.uniforms.uTime.value = tsec; m.uniforms.uBoost.value += (state.auroraBoost * windBoost() - m.uniforms.uBoost.value) * 0.05; });
1012
  if (o.clouds) o.clouds.rotation.y += dt * 0.004 * state.speed;
1013
  o.mpMesh.material.uniforms.uTime.value = tsec;
1014
  o.bsMesh.material.uniforms.uTime.value = tsec;
1015
  if (o.torus) o.torus.material.uniforms.uTime.value = tsec;
1016
  o.moons.forEach(m => { if (m.tube) m.tube.material.uniforms.uTime.value = tsec; });
1017
+ updateMoons(dt, tsec);
1018
+ // feature labels around a moon appear only while the camera is following it
1019
+ o.moons.forEach(mo => mo.fxLabels.forEach(l => {
1020
+ l.visible = state.follow === mo && state.layers.labels && state.layers.moons && (!l.userData.aurora || state.layers.aurora) && (!l.userData.cond || l.userData.cond());
1021
+ }));
1022
  updateWind(dt);
1023
 
1024
  if (state.follow && !state.tween) {
 
1053
  setLayers(obj) { Object.assign(state.layers, obj); applyLayers(); },
1054
  getLayers() { return { ...state.layers }; },
1055
  setSpeed(s) { state.speed = s; },
1056
+ // Earth's Moon: is it inside Earth's magnetotail right now?
1057
+ moonInTail(key) { return !!moonEntry(key)?.fx?.inTail; },
1058
+ // move a moon along its orbit to the night side (directly behind the planet)
1059
+ moonToNight(key) {
1060
+ const mo = moonEntry(key); if (!mo) return;
1061
+ const m = mo.cfg, w = 2 * Math.PI / (m.period * 24);
1062
+ m.phase = Math.PI - w * state.time;
1063
+ mo.fx?.snapTail?.();
1064
+ },
1065
+ launchCME,
1066
+ windInfo() { return { k: state.windK, boost: windBoost(), scale: windScale(), cme: !!state.cme, kick: state.kick, cmeX: state.cme ? state.cme.x : null }; },
1067
+ setWind(k, instant = false) { state.wind = THREE.MathUtils.clamp(k, 0.2, 5); if (instant) state.windK = state.wind; },
1068
  view,
1069
  refreshLabels,
1070
  get planet() { return state.name; },