mirror of
https://git.j0bot.ch/admin_j0bot/ploxion-etoiles.git
synced 2026-11-29 06:22:07 +00:00
synchro du labo (0bf0da65) : _astres.blade.php, app.blade.php, README.md
This commit is contained in:
commit
f2f657a33f
21
README.md
Normal file
21
README.md
Normal file
@ -0,0 +1,21 @@
|
||||
# ✦ Étoiles
|
||||
|
||||
Toute la galaxie sous la main : ✦ chercher n'importe quelle étoile (Procyon, Véga, Proxima… le recueil + les 8 921 du catalogue) et voir ses specs et ses planètes, les objets classés (étoiles, naines blanches, étoiles à neutrons, magnétars, trous noirs, quasars, nébuleuses, amas, galaxies) ; ◎ la carte de la Voie lactée vue de dessus, du voisinage du Soleil aux galaxies lointaines ; ☆ mes étoiles ; ⟶ voyages au calendrier de Terra : partir, arriver, voir en telle année, itinéraire à étapes, technologies (actuelle + slingshot, voile laser, space-cubion, space-spherion, space-kion 1 g + flip, 3 g, trou de ver, lumière, la tienne), et au niveau stellaire la trajectoire (Hohmann et sa fenêtre de tir, slingshot par Jupiter, brachistochrone).
|
||||
|
||||
| | |
|
||||
| --- | --- |
|
||||
| id | `etoiles` |
|
||||
| fournit | `etoiles` `astres` `galaxie` `carte-galaxie` `trous-noirs` `exoplanetes` `voyage-interstellaire` `itineraire` `trajectoire` `calendrier-terra` `space-cubion` `vaisseau` |
|
||||
| bions qu'il nomme | `jOSApi` `jOSApps` `jOSAstres` `jOSBoxion` `jOSGalaxie` `jOSHyper` `jOSJournal` `jOSMobile` `jOSOp` `jOSPorts` |
|
||||
| fichiers | `_astres.blade.php` `app.blade.php` |
|
||||
| dans le labo | `resources/views/ploxions/etoiles/` (dépôt `my_website2`) |
|
||||
|
||||
## Contribuer
|
||||
|
||||
- **Dans le xer** : https://labo.j0bot.ch/px/atelier?ploxion=etoiles — prends-le, modifie-le, vois-le tourner, « ⧗ envoyer le tsoin ».
|
||||
- **Dans VS Code** : `xb prendre etoiles` (ou l'extension xerboxion › ⇩ Prendre), puis ⧗ Envoyer.
|
||||
- Le chemin complet : https://labo.j0bot.ch/px/contribuer
|
||||
|
||||
Ce dépôt est un **miroir** du labo (synchronisé par `bin/ploxions-forge.mjs`, depuis le commit `0bf0da65`) : une modif se propose par un tsoin ou une branche du labo, pas directement ici.
|
||||
|
||||
© 2026 chill-tekk · ne pas nuire
|
||||
134
_astres.blade.php
Normal file
134
_astres.blade.php
Normal file
@ -0,0 +1,134 @@
|
||||
{{-- Les astres du ploxion étoiles (recueil tenu à la main, valeurs publiées arrondies). ra en heures, de en degrés, d en années-lumière,
|
||||
m masse (M☉), r rayon (R☉), T température (K), L luminosité (L☉). pl = planètes [nom, masse, période (jours), demi-grand axe (UA), note].
|
||||
« ~ » dans note = valeur incertaine ou débattue. Le catalogue complet (8 921 étoiles à l'œil nu, HYG) vient de /stars.json. --}}
|
||||
<script>
|
||||
window.__ASTRES__ = [
|
||||
// ── le système solaire et ses voisines ──
|
||||
{id:'soleil',n:'Soleil',a:['Sol','Sun','Terra'],t:'etoile',ra:0,de:0,d:0,sp:'G2V',m:1,r:1,T:5772,L:1,age:'4,6 milliards d’années',note:'Notre étoile. Terra (la Terre) tourne autour à 1 UA.',
|
||||
pl:[['Mercure','0,055 M⊕',88,0.387,''],['Vénus','0,815 M⊕',225,0.723,''],['Terra (Terre)','1 M⊕',365.25,1,'nous'],['Mars','0,107 M⊕',687,1.524,''],['Jupiter','317,8 M⊕',4333,5.203,'géante gazeuse'],['Saturne','95,2 M⊕',10759,9.537,'anneaux'],['Uranus','14,5 M⊕',30687,19.19,'géante de glace'],['Neptune','17,1 M⊕',60190,30.07,'géante de glace']]},
|
||||
{id:'voyager1',n:'Voyager 1',a:['sonde Voyager'],t:'sonde',ra:17.2,de:12.0,d:0.0027,note:'La sonde humaine la plus lointaine (lancée en 1977), ~1 jour-lumière de Terra en 2026, 17 km/s. Le premier space-cubion, en quelque sorte.'},
|
||||
{id:'proxima',n:'Proxima du Centaure',a:['Proxima Centauri','Proxima','Alpha Centauri C'],t:'etoile',ra:14.4953,de:-62.6795,d:4.2465,sp:'M5.5Ve',m:0.122,r:0.154,T:3042,L:0.0017,note:'L’étoile la plus proche du Soleil. Naine rouge à éruptions.',
|
||||
pl:[['Proxima b','≥ 1,07 M⊕',11.19,0.0485,'zone habitable'],['Proxima d','≥ 0,26 M⊕',5.12,0.029,'']]},
|
||||
{id:'alpha-cen-a',n:'Alpha du Centaure A',a:['Rigil Kentaurus','Alpha Centauri A','Rigil Kent'],t:'etoile',ra:14.6601,de:-60.8354,d:4.37,sp:'G2V',m:1.08,r:1.22,T:5790,L:1.52,note:'Une jumelle du Soleil, en couple avec B (orbite de 80 ans), Proxima tourne autour des deux.',
|
||||
pl:[['Alpha Centauri Ab','~ masse de Saturne',null,2,'~ candidat JWST (2025)']]},
|
||||
{id:'alpha-cen-b',n:'Alpha du Centaure B',a:['Toliman','Alpha Centauri B'],t:'etoile',ra:14.6599,de:-60.8375,d:4.37,sp:'K1V',m:0.91,r:0.86,T:5260,L:0.5},
|
||||
{id:'barnard',n:'Étoile de Barnard',a:["Barnard's Star",'Barnard'],t:'etoile',ra:17.9634,de:4.6934,d:5.96,sp:'M4V',m:0.16,r:0.19,T:3134,L:0.0035,note:'Le plus grand mouvement propre du ciel. Cible du projet Daedalus (1978).',
|
||||
pl:[['Barnard b','~ 0,3 M⊕',3.15,0.023,''],['Barnard c','~ 0,3 M⊕',4.12,0.027,''],['Barnard d','~ 0,26 M⊕',2.34,0.019,''],['Barnard e','~ 0,19 M⊕',6.74,0.038,'4 planètes confirmées en 2025']]},
|
||||
{id:'wolf359',n:'Wolf 359',a:['Wolf359'],t:'etoile',ra:10.9405,de:7.0144,d:7.86,sp:'M6V',m:0.11,r:0.14,T:2800,L:0.0014},
|
||||
{id:'lalande',n:'Lalande 21185',a:['Gliese 411','Lalande'],t:'etoile',ra:11.0553,de:35.9699,d:8.31,sp:'M2V',m:0.39,r:0.39,T:3550,L:0.021,
|
||||
pl:[['Lalande 21185 b','~ 2,7 M⊕',12.9,0.079,'']]},
|
||||
{id:'sirius',n:'Sirius',a:['Sirius A','Alpha Canis Majoris','Canicule'],t:'etoile',ra:6.7525,de:-16.7161,d:8.6,sp:'A1V',m:2.06,r:1.71,T:9940,L:25.4,note:'L’étoile la plus brillante du ciel nocturne. Sirius B, une naine blanche, tourne autour en 50 ans.'},
|
||||
{id:'sirius-b',n:'Sirius B',a:['le Chiot'],t:'naine-blanche',ra:6.7525,de:-16.7161,d:8.6,sp:'DA2',m:1.02,r:0.0084,T:25000,L:0.056,note:'La naine blanche la plus proche : la masse du Soleil dans le volume de Terra.'},
|
||||
{id:'eps-eri',n:'Epsilon Eridani',a:['Ran','Eps Eridani'],t:'etoile',ra:3.5488,de:-9.4583,d:10.5,sp:'K2V',m:0.82,r:0.74,T:5084,L:0.34,note:'Jeune (~500 millions d’années), entourée de ceintures de débris.',
|
||||
pl:[['AEgir (Epsilon Eridani b)','~ 0,66 MJ',2690,3.5,'']]},
|
||||
{id:'procyon',n:'Procyon',a:['Procyon A','Alpha Canis Minoris'],t:'etoile',ra:7.655,de:5.225,d:11.46,sp:'F5IV-V',m:1.5,r:2.05,T:6530,L:6.9,note:'Le Petit Chien. En couple avec Procyon B, une naine blanche (orbite de 40 ans).'},
|
||||
{id:'procyon-b',n:'Procyon B',a:[],t:'naine-blanche',ra:7.655,de:5.225,d:11.46,sp:'DQZ',m:0.6,r:0.012,T:7740,L:0.00049},
|
||||
{id:'ross128',n:'Ross 128',a:['Gliese 447'],t:'etoile',ra:11.7958,de:0.8042,d:11.0,sp:'M4V',m:0.17,r:0.2,T:3192,L:0.0036,note:'Une naine rouge calme, peu d’éruptions.',
|
||||
pl:[['Ross 128 b','≥ 1,4 M⊕',9.87,0.05,'tempérée']]},
|
||||
{id:'tau-ceti',n:'Tau Ceti',a:['Tau Cet'],t:'etoile',ra:1.7344,de:-15.9375,d:11.9,sp:'G8V',m:0.78,r:0.79,T:5344,L:0.52,note:'Étoile solitaire la plus proche qui ressemble au Soleil.',
|
||||
pl:[['Tau Ceti g','~ 1,8 M⊕',20,0.13,'~ candidat'],['Tau Ceti h','~ 1,8 M⊕',49,0.24,'~ candidat'],['Tau Ceti e','~ 3,9 M⊕',163,0.54,'~ candidat'],['Tau Ceti f','~ 3,9 M⊕',636,1.33,'~ candidat']]},
|
||||
{id:'gj273',n:'Étoile de Luyten',a:['GJ 273','Luyten'],t:'etoile',ra:7.4605,de:5.2253,d:12.2,sp:'M3.5V',m:0.29,r:0.29,T:3382,L:0.0088,
|
||||
pl:[['GJ 273 b','≥ 2,9 M⊕',18.65,0.091,'zone habitable']]},
|
||||
{id:'teegarden',n:'Étoile de Teegarden',a:["Teegarden's Star",'Teegarden'],t:'etoile',ra:2.8894,de:16.8811,d:12.5,sp:'M7V',m:0.09,r:0.11,T:2904,L:0.0007,
|
||||
pl:[['Teegarden b','≥ 1,05 M⊕',4.91,0.025,'zone habitable'],['Teegarden c','≥ 1,11 M⊕',11.4,0.044,''],['Teegarden d','≥ 0,82 M⊕',26.1,0.079,'']]},
|
||||
{id:'40-eri-b',n:'40 Eridani B',a:['Keid B','Omicron2 Eridani B'],t:'naine-blanche',ra:4.2552,de:-7.6529,d:16.3,sp:'DA4',m:0.57,r:0.014,T:16500,L:0.013,note:'La naine blanche la plus facile à voir au petit télescope.'},
|
||||
{id:'altair',n:'Altaïr',a:['Altair','Alpha Aquilae'],t:'etoile',ra:19.8464,de:8.8683,d:16.7,sp:'A7V',m:1.86,r:1.79,T:7550,L:10.6,note:'Tourne sur elle-même en 9 heures : aplatie aux pôles. Un sommet du Triangle d’été.'},
|
||||
{id:'gj581',n:'Gliese 581',a:['GJ 581'],t:'etoile',ra:15.3253,de:-7.7224,d:20.5,sp:'M3V',m:0.31,r:0.3,T:3480,L:0.012,
|
||||
pl:[['Gliese 581 e','≥ 1,7 M⊕',3.15,0.028,''],['Gliese 581 b','≥ 15,8 M⊕',5.37,0.041,''],['Gliese 581 c','≥ 5,5 M⊕',12.9,0.073,'']]},
|
||||
{id:'vega',n:'Véga',a:['Vega','Alpha Lyrae','Wega'],t:'etoile',ra:18.6156,de:38.7837,d:25.04,sp:'A0V',m:2.1,r:2.5,T:9600,L:40,note:'Le zéro des magnitudes. Sera l’étoile polaire vers l’an 14 000 de Terra (précession). Entourée d’un disque de poussières.'},
|
||||
{id:'fomalhaut',n:'Fomalhaut',a:['Alpha Piscis Austrini'],t:'etoile',ra:22.9608,de:-29.6222,d:25,sp:'A3V',m:1.92,r:1.84,T:8590,L:16.6,note:'Un anneau de poussières géant. « Fomalhaut b » s’est révélé être un nuage de débris.'},
|
||||
{id:'pollux',n:'Pollux',a:['Beta Geminorum'],t:'etoile',ra:7.7553,de:28.0262,d:33.8,sp:'K0III',m:1.9,r:9.1,T:4666,L:33,note:'Géante orange, la plus proche étoile géante.',
|
||||
pl:[['Thestias (Pollux b)','≥ 2,3 MJ',590,1.64,'']]},
|
||||
{id:'arcturus',n:'Arcturus',a:['Alpha Bootis'],t:'etoile',ra:14.261,de:19.1824,d:36.7,sp:'K1.5III',m:1.08,r:25.4,T:4286,L:170,note:'L’étoile la plus brillante de l’hémisphère nord céleste.'},
|
||||
{id:'trappist1',n:'TRAPPIST-1',a:['Trappist','2MASS J23062928-0502285'],t:'etoile',ra:23.1081,de:-5.0414,d:40.7,sp:'M8V',m:0.09,r:0.12,T:2566,L:0.00055,note:'Sept planètes rocheuses, trois dans la zone habitable. Le système le plus étudié par JWST.',
|
||||
pl:[['TRAPPIST-1 b','1,37 M⊕',1.51,0.0115,''],['TRAPPIST-1 c','1,31 M⊕',2.42,0.0158,''],['TRAPPIST-1 d','0,39 M⊕',4.05,0.0223,''],['TRAPPIST-1 e','0,69 M⊕',6.1,0.0293,'zone habitable'],['TRAPPIST-1 f','1,04 M⊕',9.21,0.0385,'zone habitable'],['TRAPPIST-1 g','1,32 M⊕',12.35,0.0469,'zone habitable'],['TRAPPIST-1 h','0,33 M⊕',18.77,0.0619,'']]},
|
||||
{id:'55cnc',n:'55 Cancri',a:['Copernicus','Rho1 Cancri'],t:'etoile',ra:8.8775,de:28.3308,d:41,sp:'G8V',m:0.91,r:0.94,T:5196,L:0.58,
|
||||
pl:[['Janssen (55 Cnc e)','8 M⊕',0.74,0.015,'surface de lave'],['Galileo (55 Cnc b)','0,83 MJ',14.65,0.11,''],['Brahe (55 Cnc c)','0,17 MJ',44.4,0.24,''],['Harriot (55 Cnc f)','0,14 MJ',260,0.77,''],['Lipperhey (55 Cnc d)','3,8 MJ',5574,5.7,'']]},
|
||||
{id:'capella',n:'Capella',a:['Alpha Aurigae','la Chèvre'],t:'etoile',ra:5.2782,de:45.998,d:42.9,sp:'G3III + G0III',m:2.6,r:12,T:4970,L:79,note:'En fait deux géantes jaunes serrées (orbite de 104 jours).'},
|
||||
{id:'lhs1140',n:'LHS 1140',a:['GJ 3053'],t:'etoile',ra:0.7498,de:-15.2714,d:48.8,sp:'M4.5V',m:0.18,r:0.21,T:3096,L:0.0038,
|
||||
pl:[['LHS 1140 b','5,6 M⊕',24.7,0.096,'zone habitable, peut-être un monde océan'],['LHS 1140 c','1,9 M⊕',3.78,0.027,'']]},
|
||||
{id:'51peg',n:'51 Pegasi',a:['Helvetios','51 Peg'],t:'etoile',ra:22.9576,de:20.7688,d:50.6,sp:'G2IV',m:1.11,r:1.15,T:5768,L:1.36,note:'Helvetios : nommée par la Suisse. Autour d’elle, la première exoplanète d’une étoile comme le Soleil (Genève, 1995, Nobel 2019).',
|
||||
pl:[['Dimidium (51 Peg b)','0,47 MJ',4.23,0.053,'Jupiter chaud, la première']]},
|
||||
{id:'hd189733',n:'HD 189733',a:[],t:'etoile',ra:20.0068,de:22.7108,d:64.5,sp:'K1.5V',m:0.81,r:0.76,T:5050,L:0.33,
|
||||
pl:[['HD 189733 b','1,13 MJ',2.22,0.031,'bleue, pluie de verre à 8 000 km/h']]},
|
||||
{id:'aldebaran',n:'Aldébaran',a:['Aldebaran','Alpha Tauri'],t:'etoile',ra:4.5987,de:16.5093,d:65,sp:'K5III',m:1.16,r:45,T:3900,L:439,note:'L’œil du Taureau. Pioneer 10 passera près d’elle dans ~2 millions d’années.'},
|
||||
{id:'regulus',n:'Régulus',a:['Regulus','Alpha Leonis'],t:'etoile',ra:10.1395,de:11.9672,d:79,sp:'B8IVn',m:3.8,r:3.1,T:12460,L:288},
|
||||
{id:'algol',n:'Algol',a:['Beta Persei','l’étoile du démon'],t:'etoile',ra:3.136,de:40.9556,d:90,sp:'B8V + K0IV',m:3.17,r:2.73,T:13000,L:182,note:'Une étoile double à éclipses : elle faiblit toutes les 2,87 jours.'},
|
||||
{id:'hd209458',n:'HD 209458',a:['Osiris'],t:'etoile',ra:22.0516,de:18.8842,d:157,sp:'G0V',m:1.15,r:1.2,T:6070,L:1.6,
|
||||
pl:[['Osiris (HD 209458 b)','0,69 MJ',3.52,0.047,'premier transit observé (1999), elle s’évapore']]},
|
||||
{id:'k2-18',n:'K2-18',a:[],t:'etoile',ra:11.5025,de:7.5886,d:124,sp:'M2.5V',m:0.5,r:0.44,T:3457,L:0.023,
|
||||
pl:[['K2-18 b','8,6 M⊕',33,0.143,'méthane et CO₂ vus par JWST (2023)']]},
|
||||
{id:'achernar',n:'Achernar',a:['Alpha Eridani'],t:'etoile',ra:1.6286,de:-57.2368,d:139,sp:'B6Vep',m:6.7,r:8,T:15000,L:3150,note:'L’étoile la plus aplatie connue : elle tourne presque assez vite pour se déchirer.'},
|
||||
{id:'spica',n:'Spica',a:['Alpha Virginis','l’Épi'],t:'etoile',ra:13.4199,de:-11.1613,d:250,sp:'B1III-IV',m:11.4,r:7.5,T:22400,L:20500},
|
||||
{id:'mira',n:'Mira',a:['Omicron Ceti','la Merveilleuse'],t:'etoile',ra:2.3224,de:-2.9776,d:300,sp:'M7IIIe',m:1.2,r:350,T:3000,L:9000,note:'Variable : sa brillance change d’un facteur 1 000 en 332 jours. Une traîne de 13 al.'},
|
||||
{id:'canopus',n:'Canopus',a:['Alpha Carinae'],t:'etoile',ra:6.3992,de:-52.6957,d:310,sp:'A9II',m:8,r:71,T:7400,L:10700,note:'La 2e étoile du ciel. Les sondes s’orientent sur elle.'},
|
||||
{id:'polaris',n:'Polaris',a:['étoile polaire','Alpha Ursae Minoris','Polaire'],t:'etoile',ra:2.5303,de:89.2641,d:433,sp:'F7Ib',m:5.4,r:37.5,T:6000,L:1260,note:'L’étoile polaire de notre époque. Une céphéide.'},
|
||||
{id:'betelgeuse',n:'Bételgeuse',a:['Betelgeuse','Alpha Orionis'],t:'etoile',ra:5.9195,de:7.4071,d:550,sp:'M1-2Ia',m:18,r:760,T:3600,L:120000,note:'~ distance 500–650 al. Supergéante rouge en fin de vie : elle explosera en supernova (dans ~100 000 ans). Une compagne découverte en 2025.'},
|
||||
{id:'antares',n:'Antarès',a:['Antares','Alpha Scorpii'],t:'etoile',ra:16.4901,de:-26.432,d:550,sp:'M1.5Iab',m:12,r:680,T:3660,L:75000,note:'Le rival de Mars. Mise à la place du Soleil, elle avalerait Mars.'},
|
||||
{id:'rigel',n:'Rigel',a:['Beta Orionis'],t:'etoile',ra:5.2423,de:-8.2016,d:860,sp:'B8Ia',m:21,r:79,T:12100,L:120000},
|
||||
{id:'kepler186',n:'Kepler-186',a:[],t:'etoile',ra:19.91,de:43.955,d:580,sp:'M1V',m:0.54,r:0.52,T:3755,L:0.055,
|
||||
pl:[['Kepler-186 f','~ 1,2 R⊕',129.9,0.43,'première planète de taille terrestre en zone habitable (2014)']]},
|
||||
{id:'kepler22',n:'Kepler-22',a:[],t:'etoile',ra:19.2771,de:47.8843,d:640,sp:'G5V',m:0.97,r:0.98,T:5518,L:0.79,
|
||||
pl:[['Kepler-22 b','~ 2,1 R⊕',289.9,0.85,'zone habitable']]},
|
||||
{id:'tabby',n:'Étoile de Tabby',a:['KIC 8462852','Boyajian'],t:'etoile',ra:20.1038,de:44.4569,d:1470,sp:'F3V',m:1.43,r:1.58,T:6750,L:4.7,note:'Des baisses d’éclat jusqu’à 22 %, irrégulières : de la poussière, pas une sphère de Dyson (pour l’instant).'},
|
||||
{id:'kepler452',n:'Kepler-452',a:[],t:'etoile',ra:19.7336,de:44.2775,d:1800,sp:'G2V',m:1.04,r:1.11,T:5757,L:1.2,
|
||||
pl:[['Kepler-452 b','~ 1,6 R⊕',384.8,1.05,'~ la « cousine de la Terre »']]},
|
||||
{id:'deneb',n:'Deneb',a:['Alpha Cygni'],t:'etoile',ra:20.6905,de:45.2803,d:2600,sp:'A2Ia',m:19,r:200,T:8500,L:196000,note:'~ distance incertaine (1 500–2 600 al). Une des étoiles les plus lumineuses visibles à l’œil nu.'},
|
||||
{id:'vy-cma',n:'VY Canis Majoris',a:['VY CMa'],t:'etoile',ra:7.3798,de:-25.7676,d:3900,sp:'M3-5eIa',m:17,r:1420,T:3490,L:270000,note:'Hypergéante rouge, une des plus grandes étoiles connues.'},
|
||||
{id:'uy-scuti',n:'UY Scuti',a:['UY Sct'],t:'etoile',ra:18.4596,de:-12.4608,d:5900,sp:'M4Ia',m:8,r:900,T:3550,L:86000,note:'~ rayon revu à la baisse (~ 900 R☉).'},
|
||||
{id:'eta-car',n:'Êta Carinae',a:['Eta Carinae','Eta Car'],t:'etoile',ra:10.7514,de:-59.6845,d:7500,sp:'LBV + O',m:120,r:240,T:25000,L:5000000,note:'Un couple monstrueux (~90 + 30 M☉). La « Grande Éruption » de 1843 en a fait la 2e étoile du ciel. Candidate supernova.'},
|
||||
{id:'r136a1',n:'R136a1',a:['R136'],t:'etoile',ra:5.6447,de:-69.1011,d:163000,sp:'WN5h',m:200,r:40,T:46000,L:4700000,note:'L’étoile la plus massive connue, dans le Grand Nuage de Magellan.'},
|
||||
|
||||
// ── trous noirs ──
|
||||
{id:'gaia-bh1',n:'Gaia BH1',a:['Gaia DR3 4373465352415301632'],t:'trou-noir',ra:17.4781,de:-0.5811,d:1560,m:9.6,note:'Le trou noir connu le plus proche de Terra, en orbite avec une étoile comme le Soleil. Dormant : il n’avale rien.'},
|
||||
{id:'gaia-bh3',n:'Gaia BH3',a:[],t:'trou-noir',ra:19.6553,de:14.9306,d:1926,m:33,note:'Le trou noir stellaire le plus massif de la Voie lactée (2024).'},
|
||||
{id:'cyg-x1',n:'Cygnus X-1',a:['Cyg X-1'],t:'trou-noir',ra:19.9721,de:35.2016,d:7200,m:21,note:'Le premier trou noir identifié (1971). Il dévore une supergéante bleue.'},
|
||||
{id:'v404',n:'V404 Cygni',a:['V404 Cyg'],t:'trou-noir',ra:20.4034,de:33.8672,d:7800,m:9,note:'Se réveille par sursauts (1938, 1989, 2015).'},
|
||||
{id:'sgr-a',n:'Sagittarius A*',a:['Sgr A*','Sagittarius A','trou noir central','centre galactique'],t:'trou-noir',ra:17.7611,de:-29.0078,d:26670,m:4300000,note:'Le trou noir supermassif au centre de la Voie lactée (4,3 millions de Soleils). Photographié par l’EHT en 2022.'},
|
||||
{id:'m31-bh',n:'M31*',a:['trou noir d’Andromède'],t:'trou-noir',ra:0.7123,de:41.2692,d:2500000,m:140000000,note:'Le trou noir central d’Andromède.'},
|
||||
{id:'m87-bh',n:'M87*',a:['Pōwehi','Powehi'],t:'trou-noir',ra:12.5137,de:12.3911,d:53500000,m:6500000000,note:'Le premier trou noir photographié (EHT, 2019) : 6,5 milliards de Soleils. Un jet de 5 000 al.'},
|
||||
{id:'ton618',n:'TON 618',a:['Ton 618'],t:'quasar',ra:12.4747,de:31.4795,d:10800000000,m:40000000000,note:'~ un des trous noirs les plus massifs connus (~40 milliards de M☉), allumé en quasar. Distance = temps de trajet de la lumière.'},
|
||||
|
||||
// ── étoiles à neutrons, pulsars, magnétars ──
|
||||
{id:'rxj1856',n:'RX J1856.5-3754',a:['RX J1856'],t:'neutrons',ra:18.9424,de:-37.9103,d:400,m:1.5,r:0.000017,T:430000,note:'L’étoile à neutrons isolée la plus proche (~ 400 al). 1,5 Soleil dans 25 km.'},
|
||||
{id:'vela-psr',n:'Pulsar de Vela',a:['PSR B0833-45','Vela'],t:'neutrons',ra:8.5758,de:-45.1764,d:960,m:1.4,note:'Tourne 11 fois par seconde. Reste d’une supernova d’il y a ~11 000 ans.'},
|
||||
{id:'lich',n:'Lich',a:['PSR B1257+12','PSR 1257+12'],t:'neutrons',ra:13.0008,de:12.6819,d:2300,m:1.4,note:'Le pulsar autour duquel on a trouvé les toutes premières exoplanètes (1992).',
|
||||
pl:[['Draugr','0,02 M⊕',25.3,0.19,'la plus légère connue'],['Poltergeist','4,3 M⊕',66.5,0.36,''],['Phobetor','3,9 M⊕',98.2,0.46,'']]},
|
||||
{id:'crab-psr',n:'Pulsar du Crabe',a:['PSR B0531+21','Crab pulsar'],t:'neutrons',ra:5.5755,de:22.0145,d:6500,m:1.4,note:'30 tours par seconde, né de la supernova vue en l’an 1054 de Terra.'},
|
||||
{id:'sgr1806',n:'SGR 1806-20',a:[],t:'magnetar',ra:18.1408,de:-20.4111,d:28000,m:1.4,note:'Magnétar : le champ magnétique le plus intense connu. Son éruption de 2004 a touché l’atmosphère de Terra depuis 28 000 al.'},
|
||||
|
||||
// ── nébuleuses et restes de supernova ──
|
||||
{id:'helix',n:'Nébuleuse de l’Hélice',a:['NGC 7293','Œil de Dieu','Helix'],t:'nebuleuse',ra:22.4936,de:-20.8372,d:650,note:'Nébuleuse planétaire : ce que deviendra le Soleil dans ~5 milliards d’années.'},
|
||||
{id:'m42',n:'Nébuleuse d’Orion',a:['M42','Orion'],t:'nebuleuse',ra:5.588,de:-5.3911,d:1344,note:'La pouponnière d’étoiles la plus proche, visible à l’œil nu sous le Baudrier.'},
|
||||
{id:'horsehead',n:'Tête de Cheval',a:['Barnard 33','Horsehead'],t:'nebuleuse',ra:5.6833,de:-2.4583,d:1375,note:'Nébuleuse sombre en forme de tête de cheval.'},
|
||||
{id:'m57',n:'Nébuleuse de l’Anneau',a:['M57','Ring'],t:'nebuleuse',ra:18.8932,de:33.0292,d:2570,note:'Nébuleuse planétaire dans la Lyre.'},
|
||||
{id:'cats-eye',n:'Œil de Chat',a:['NGC 6543',"Cat's Eye"],t:'nebuleuse',ra:17.9764,de:66.6331,d:3300,note:'Nébuleuse planétaire aux coquilles concentriques.'},
|
||||
{id:'m8',n:'Nébuleuse de la Lagune',a:['M8','Lagoon'],t:'nebuleuse',ra:18.0606,de:-24.3833,d:4100},
|
||||
{id:'m16',n:'Nébuleuse de l’Aigle',a:['M16','Piliers de la création','Eagle'],t:'nebuleuse',ra:18.3133,de:-13.8,d:5700,note:'Les Piliers de la création (Hubble 1995, JWST 2022).'},
|
||||
{id:'crab',n:'Nébuleuse du Crabe',a:['M1','Crab'],t:'reste-supernova',ra:5.5755,de:22.0145,d:6500,note:'Reste de la supernova de 1054, notée par les astronomes chinois. Le pulsar du Crabe au centre.'},
|
||||
{id:'carina-neb',n:'Nébuleuse de la Carène',a:['NGC 3372','Carina'],t:'nebuleuse',ra:10.7514,de:-59.8667,d:7500,note:'Quatre fois Orion. Abrite Êta Carinae.'},
|
||||
{id:'cas-a',n:'Cassiopée A',a:['Cas A','Cassiopeia A'],t:'reste-supernova',ra:23.3906,de:58.8153,d:11000,note:'Le plus jeune reste de supernova de la galaxie (~ 1680).'},
|
||||
{id:'sn1987a',n:'SN 1987A',a:['Supernova 1987A'],t:'reste-supernova',ra:5.5925,de:-69.2697,d:168000,note:'La supernova la plus proche vue depuis l’invention du télescope (1987), dans le Grand Nuage de Magellan.'},
|
||||
|
||||
// ── amas d'étoiles ──
|
||||
{id:'hyades',n:'Hyades',a:['Melotte 25'],t:'amas',ra:4.45,de:15.87,d:153,note:'L’amas ouvert le plus proche, autour d’Aldébaran (qui n’en fait pas partie).'},
|
||||
{id:'pleiades',n:'Pléiades',a:['M45','Sept Sœurs','Subaru'],t:'amas',ra:3.7914,de:24.105,d:444,note:'Amas ouvert jeune (~100 millions d’années), ~1 000 étoiles.'},
|
||||
{id:'m44',n:'Praesepe',a:['M44','la Ruche','Beehive'],t:'amas',ra:8.6667,de:19.67,d:577},
|
||||
{id:'47tuc',n:'47 Tucanae',a:['NGC 104','47 Tuc'],t:'amas',ra:0.4014,de:-72.0811,d:14700,note:'Amas globulaire, des millions d’étoiles serrées.'},
|
||||
{id:'omega-cen',n:'Omega Centauri',a:['NGC 5139','Omega Cen'],t:'amas',ra:13.4462,de:-47.4794,d:17090,note:'Le plus grand amas globulaire de la galaxie, peut-être le cœur d’une galaxie avalée. Un trou noir intermédiaire (~ 8 000 M☉) y a été trouvé en 2024.'},
|
||||
{id:'m13',n:'Amas d’Hercule',a:['M13','Hercules'],t:'amas',ra:16.6948,de:36.4614,d:22200,note:'Cible du message d’Arecibo (1974) : réponse possible vers l’an 46 400 de Terra.'},
|
||||
|
||||
// ── galaxies ──
|
||||
{id:'sgr-dsph',n:'Galaxie naine du Sagittaire',a:['Sgr dSph','Sagittarius Dwarf'],t:'galaxie',ra:18.9183,de:-30.48,d:70000,note:'En train d’être avalée par la Voie lactée.'},
|
||||
{id:'lmc',n:'Grand Nuage de Magellan',a:['LMC','Large Magellanic Cloud'],t:'galaxie',ra:5.3923,de:-69.7561,d:163000,note:'Galaxie satellite, visible à l’œil nu depuis l’hémisphère sud.'},
|
||||
{id:'smc',n:'Petit Nuage de Magellan',a:['SMC','Small Magellanic Cloud'],t:'galaxie',ra:0.8772,de:-72.8286,d:200000},
|
||||
{id:'m31',n:'Galaxie d’Andromède',a:['Andromède','Andromeda','M31'],t:'galaxie',ra:0.7123,de:41.2692,d:2500000,note:'~1 000 milliards d’étoiles. Fusionnera avec la Voie lactée dans ~4,5 milliards d’années (Milkdromède). L’objet le plus lointain visible à l’œil nu.'},
|
||||
{id:'m33',n:'Galaxie du Triangle',a:['M33','Triangulum'],t:'galaxie',ra:1.5641,de:30.66,d:2730000},
|
||||
{id:'cen-a',n:'Centaurus A',a:['NGC 5128','Cen A'],t:'galaxie',ra:13.4243,de:-43.0191,d:12000000,note:'Galaxie active, un jet d’un million d’al.'},
|
||||
{id:'m82',n:'Galaxie du Cigare',a:['M82','Cigar'],t:'galaxie',ra:9.9312,de:69.6797,d:12000000,note:'Galaxie à flambée d’étoiles.'},
|
||||
{id:'m104',n:'Galaxie du Sombrero',a:['M104','Sombrero'],t:'galaxie',ra:12.666,de:-11.6231,d:29000000},
|
||||
{id:'m51',n:'Galaxie du Tourbillon',a:['M51','Whirlpool'],t:'galaxie',ra:13.498,de:47.1953,d:31000000,note:'La première galaxie dont on a vu les bras spiraux (1845).'},
|
||||
{id:'m87',n:'M87',a:['Virgo A','Messier 87'],t:'galaxie',ra:12.5137,de:12.3911,d:53500000,note:'Galaxie elliptique géante au cœur de l’amas de la Vierge. Abrite M87*.'},
|
||||
{id:'jades-z14',n:'JADES-GS-z14-0',a:['galaxie la plus lointaine'],t:'galaxie',ra:3.5539,de:-27.8728,d:13500000000,note:'~ une des galaxies les plus lointaines connues (JWST, 2024) : sa lumière est partie ~290 millions d’années après le Big Bang. Distance = temps de trajet de la lumière.'}
|
||||
];
|
||||
</script>
|
||||
600
app.blade.php
Normal file
600
app.blade.php
Normal file
@ -0,0 +1,600 @@
|
||||
{{-- PL0XION étoiles ✦ (RS-7, 27.10.2026 : « avoir sous la main le nom de mes étoiles préférées, une map de la galaxie, planifier un voyage
|
||||
interstellaire avec des space-cubions, calculer le temps de voyage, noter en quelle année on veut voir ou aller à un endroit — le calendrier
|
||||
de Terra ; chercher Procyon, Véga, Proxima et voir ses specs, ses planètes ; catégoriser les trous noirs, tous les objets célestes, voir
|
||||
toute la galaxie. Ici on construit l'OS d'un vaisseau : space-cubion → space-spherion → space-kion »).
|
||||
✦ astres : recherche (le recueil _astres + les 8 921 étoiles du catalogue HYG /stars.json, le même que carte-espace) et catégories.
|
||||
◎ carte : la Voie lactée vue de dessus (bras en schéma, positions réelles), du voisinage du Soleil jusqu'aux galaxies lointaines.
|
||||
☆ mes étoiles · ⟶ voyages : la physique de space-cubion (1 g, retournement, τ = (2c/a)·acosh(1 + a·d/2c²)), avec plafond de vitesse par vaisseau.
|
||||
Le bion jOSAstres (chercher, fiche, distance, voyage) sert à tout le xer. Rendu à la demande (0 rAF au repos). --}}
|
||||
<style>
|
||||
.et{position:relative;display:flex;flex-direction:column;height:100%;background:#05070d;color:#e4ecff;font-family:var(--xr-font-ui,ui-sans-serif,system-ui);overflow:hidden}
|
||||
.et__corps{flex:1;overflow:auto;min-height:0}
|
||||
.et__top{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid #18223a}
|
||||
.et__top b{font-size:.95rem}.et__terra{margin-left:auto;font-size:.72rem;color:#8ea2cc;font-variant-numeric:tabular-nums}
|
||||
.et__sec{padding:10px 12px}
|
||||
.et__h{margin:0 0 6px;font-size:.66rem;letter-spacing:.08em;text-transform:uppercase;color:#7f93c8}
|
||||
.et__in{width:100%;box-sizing:border-box;background:#0b1120;border:1px solid #233157;color:#eef3ff;border-radius:10px;padding:9px 10px;font:inherit;font-size:.86rem}
|
||||
.et__chips{display:flex;flex-wrap:wrap;gap:6px}
|
||||
.et__c{cursor:pointer;background:#0d1426;border:1px solid #233157;color:#cfdaf5;border-radius:9px;padding:6px 9px;font:inherit;font-size:.74rem}
|
||||
.et__c.on{border-color:#5fe0c0;background:#0f2a2a;color:#e8fff8}
|
||||
.et__c small{color:#7f93c8;margin-left:3px}
|
||||
.et__l{display:flex;align-items:center;gap:10px;padding:8px 12px;border-bottom:1px solid #111a2e;cursor:pointer}
|
||||
.et__l:hover{background:#0b1222}
|
||||
.et__g{width:22px;text-align:center;font-size:1rem;flex:none}
|
||||
.et__l .n{font-weight:700;font-size:.86rem}.et__l .s{font-size:.72rem;color:#8ea2cc}
|
||||
.et__l .d{margin-left:auto;font-size:.74rem;color:#b9c8ea;font-variant-numeric:tabular-nums;white-space:nowrap}
|
||||
.et__vide{padding:18px 12px;color:#7f93c8;font-size:.8rem}
|
||||
.et__dock{display:flex;border-top:1px solid #18223a;background:#070b15}
|
||||
.et__dock button{flex:1;cursor:pointer;background:none;border:0;color:#8ea2cc;font:inherit;font-size:.72rem;padding:9px 4px 11px;display:flex;flex-direction:column;align-items:center;gap:2px}
|
||||
.et__dock button span{font-size:1.1rem}.et__dock button.on{color:#5fe0c0}
|
||||
.et__carte{position:relative;height:100%;min-height:260px;touch-action:none}
|
||||
.et__carte canvas{display:block;width:100%;height:100%;cursor:grab}
|
||||
.et__outils{position:absolute;left:8px;right:8px;bottom:8px;display:flex;flex-wrap:wrap;gap:6px;pointer-events:none}
|
||||
.et__outils .et__c{pointer-events:auto;background:#0d1426e6}
|
||||
.et__echelle{position:absolute;top:8px;left:10px;font-size:.7rem;color:#8ea2cc;pointer-events:none}
|
||||
.et__fiche{position:absolute;left:0;right:0;bottom:54px;max-height:52%;overflow:auto;background:#080d19f7;border-top:1px solid #2a3a66;border-radius:14px 14px 0 0;padding:12px 14px 16px;z-index:3;box-shadow:0 -10px 30px #0008}
|
||||
.et__fiche.mini{max-height:none;overflow:hidden}.et__fiche.mini>*:not(h3){display:none}
|
||||
@media (min-width:760px){.et__fiche{left:auto;top:0;width:min(440px,46%);max-height:none;border-top:0;border-left:1px solid #2a3a66;border-radius:14px 0 0 14px;box-shadow:-10px 0 30px #0008}
|
||||
.et__fiche.mini{top:auto;border-radius:14px 0 0 0;border-top:1px solid #2a3a66}}
|
||||
.et__fiche h3{margin:0;font-size:1.05rem;display:flex;align-items:center;gap:8px}
|
||||
.et__x{cursor:pointer;background:none;border:1px solid #233157;color:#cfdaf5;border-radius:8px;padding:2px 9px;font:inherit}
|
||||
.et__alias{font-size:.72rem;color:#8ea2cc;margin:3px 0 8px}
|
||||
.et__kv{display:grid;grid-template-columns:auto 1fr;gap:3px 12px;font-size:.78rem;margin:6px 0}
|
||||
.et__kv dt{color:#7f93c8}.et__kv dd{margin:0;font-variant-numeric:tabular-nums}
|
||||
.et__note{font-size:.8rem;line-height:1.5;color:#d3ddf5;margin:8px 0}
|
||||
.et__pl{width:100%;border-collapse:collapse;font-size:.74rem;margin-top:4px}
|
||||
.et__pl th{text-align:left;color:#7f93c8;font-weight:600;padding:3px 6px 3px 0}
|
||||
.et__pl td{padding:4px 6px 4px 0;border-top:1px solid #111a2e;font-variant-numeric:tabular-nums}
|
||||
.et__act{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
|
||||
.et__res{background:#0a1222;border:1px solid #1d2a4a;border-radius:12px;padding:10px 12px;margin-top:10px}
|
||||
.et__big{font-size:1.25rem;font-weight:800;color:#8ff0c9;font-variant-numeric:tabular-nums}
|
||||
.et__tag{display:inline-block;font-size:.6rem;letter-spacing:.06em;text-transform:uppercase;border:1px solid #3a4a7a;border-radius:6px;padding:1px 5px;color:#9fb0dc;margin-left:4px}
|
||||
.et__row{display:flex;gap:8px;align-items:center}.et__row>*{flex:1}
|
||||
.et__pv{border-left:2px solid #2a3a66;padding:6px 0 6px 10px;margin:8px 0;font-size:.8rem}
|
||||
.et__pv b{color:#8ff0c9}
|
||||
.et__vis{display:flex;flex-wrap:wrap;gap:10px;margin:8px 0}
|
||||
.et__photo{position:relative;flex:1 1 200px;max-width:260px;margin:0}
|
||||
.et__photo img{display:block;width:100%;aspect-ratio:1;object-fit:cover;border-radius:10px;border:1px solid #233157;background:#0b1120}
|
||||
.et__photo .viseur{position:absolute;left:50%;top:50%;width:26px;height:26px;margin:-13px 0 0 -13px;border:1px solid #5fe0c0aa;border-radius:50%;pointer-events:none}
|
||||
.et__photo figcaption,.et__leg{font-size:.64rem;color:#7f93c8;margin-top:4px;line-height:1.35}
|
||||
.et__modele{flex:0 0 110px;align-self:flex-start;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border:1px dashed #233157;border-radius:10px;padding:8px}
|
||||
.et__disque{border-radius:50%}
|
||||
.et__sys{flex:1 1 240px;max-width:300px}
|
||||
.et__sys svg{display:block;width:100%;height:auto;background:#060a14;border:1px solid #1d2a4a;border-radius:10px}
|
||||
.et__savoir{font-size:.78rem;line-height:1.55;color:#d3ddf5;background:#0a1222;border:1px solid #1d2a4a;border-radius:10px;padding:8px 10px;margin-top:8px}
|
||||
.et__tag.reel{border-color:#5fe0c0;color:#8ff0c9}.et__tag.modele{border-color:#7f93c8}.et__tag.proc{border-color:#c79bff;color:#d8c2ff}
|
||||
.et__ko{color:#ff9b6a}
|
||||
.et__jal{border:1px solid #1d2a4a;border-radius:10px;padding:8px 10px;margin:6px 0;background:#0a1222}
|
||||
.et__jal .t{display:flex;align-items:center;gap:8px;font-size:.84rem}
|
||||
.et__jal .t input{width:92px;flex:none;padding:4px 6px}
|
||||
.et__leg2{margin:2px 0 2px 14px;padding:4px 0 4px 10px;border-left:2px dashed #2a3a66;font-size:.74rem;color:#b9c8ea}
|
||||
</style>
|
||||
@include('partials._astres_bion')
|
||||
@include('partials._galaxie_bion')
|
||||
@include('partials._journal_spatial_bion')
|
||||
<script>
|
||||
(function () {
|
||||
'use strict';
|
||||
if (window.jOSApps && window.jOSApps.etoiles) return; // déjà chargé (space-nav le monte aussi)
|
||||
var K = 'xb:etoiles', A0 = window.jOSAstres, X = A0._; // le cœur astro vit dans le bion jOSAstres (partials/_astres_bion)
|
||||
var AL_PC = X.AL_PC, R0 = X.R0, SC = X.SC, AG = X.AG, KMS = X.KMS, depuisCubion = X.depuisCubion, MU = X.MU, KM_UA = X.KM_UA, MOIS = X.MOIS, norm = X.norm, AN_S = X.AN_S, MG = X.MG, eq = X.eq, gal = X.gal, poser = X.poser, lb = X.lb, ASTRES = X.ASTRES, PAR_ID = X.PAR_ID, T_CLASSE = X.T_CLASSE, classeLum = X.classeLum, couleur = X.couleur, Lmoy = X.Lmoy, posPlanete = X.posPlanete, distPlanetes = X.distPlanetes, hash = X.hash, graine = X.graine, lum = X.lum, tempe = X.tempe;
|
||||
var TYPES = A0.types, VAISSEAUX = A0.vaisseaux, PLANETES = A0.planetesSolaires, get = A0.get, canon = A0.canon, chercher = A0.chercher, catalogue = A0.catalogue,
|
||||
exoplanetes = A0.exoplanetes, distance = A0.distance, posA = A0.position, voyage = A0.voyage, cible = A0.cible, bulle = A0.bulle, planetesDe = A0.planetes,
|
||||
hohmann = A0.hohmann, slingshot = A0.slingshot, F = A0.fmt, nb = F.nb, grand = F.grand, dist = F.dist, duree = F.duree, an = F.an, dateAn = F.dateAn, anNow = F.anNow;
|
||||
var VISIONS = [];
|
||||
function esc(s) { return window.jOSb.esc(s); }
|
||||
function lire(k, d) { try { var v = JSON.parse(localStorage.getItem(k) || 'null'); return v == null ? d : v; } catch (e) { return d; } }
|
||||
function ecrire(k, v) { try { localStorage.setItem(k, JSON.stringify(v)); } catch (e) {} }
|
||||
function temps(t, tau) { var e = Math.max(0, t - tau);
|
||||
return '<dt>temps sur Terra</dt><dd class="et__big" style="color:#ffd76a">' + duree(t) + '</dd><dt>temps propre à bord</dt><dd class="et__big">' + duree(tau) + '</dd>'
|
||||
+ '<dt>écart</dt><dd>' + (t <= 0 ? '—' : tau <= 0 ? 'tout : 0 à bord (la lumière ne vieillit pas)' : 'l’équipage a vécu ' + duree(e) + ' de moins que Terra' + (t / tau > 1.0001 ? ' (Terra ×' + nb(t / tau, t / tau < 1.01 ? 4 : 2) + ')' : '')) + '</dd>'; }
|
||||
function dureeVol(t, tau) { return duree(t) + ' sur Terra · ' + duree(tau) + ' à bord'; }
|
||||
// ── tout reste sur le xerboxion : les services externes passent par le proxy /px/api (cache serveur) ──
|
||||
function apiUrl(prov, chemin, params) { if (window.jOSApi && jOSApi.img) return jOSApi.img(prov, chemin, params);
|
||||
return '/px/api/' + prov + '/' + chemin + '?' + Object.keys(params).map(function (k) { return encodeURIComponent(k) + '=' + encodeURIComponent(params[k]); }).join('&'); }
|
||||
function tag(k) { return '<span class="et__tag ' + { 'RÉEL': 'reel', 'MODÈLE': 'modele', 'PROCÉDURAL': 'proc' }[k] + '">' + k + '</span>'; }
|
||||
// la photo RÉELLE : un cutout du ciel (DSS2 couleur) centré sur l'astre, gardé par le xerboxion
|
||||
function champ(o) { if (o.fov) return o.fov; if (o.t === 'galaxie') return o.d < 3e5 ? 8 : o.d < 4e6 ? 2 : 0.25;
|
||||
if (/nebuleuse|amas|reste-supernova/.test(o.t)) return 0.8; return o.mag != null && o.mag < 1 ? 1.2 : o.mag != null && o.mag < 3 ? 0.6 : 0.25; }
|
||||
function photo(o) { if (o.id === 'soleil' || o.t === 'sonde' || o.ra == null) return '';
|
||||
var f = champ(o), u = apiUrl('hips2fits', 'hips2fits', { hips: 'CDS/P/DSS2/color', width: 400, height: 400, fov: f, projection: 'TAN', ra: (o.ra * 15).toFixed(5), dec: (+o.de).toFixed(5), format: 'jpg' });
|
||||
return '<figure class="et__photo"><img data-photo loading="lazy" alt="le ciel autour de ' + esc(o.n) + '" src="' + esc(u) + '"><span class="viseur"></span>'
|
||||
+ '<figcaption>' + tag('RÉEL') + ' photo du ciel (DSS2), champ ' + nb(f, 2) + '° · ' + (o.t === 'etoile' ? 'l’étoile est le point au centre' : 'au centre') + '. This research made use of hips2fits, a service provided by CDS.</figcaption></figure>'; }
|
||||
// le disque MODÈLE : la couleur vient de la température, la taille du rayon (échelle log)
|
||||
function couleurT(T) { return T > 30000 ? '#9bb0ff' : T > 10000 ? '#aabfff' : T > 7500 ? '#cfd8ff' : T > 6000 ? '#f8f7ff' : T > 5200 ? '#fff1d6' : T > 3900 ? '#ffd9a8' : '#ffae78'; }
|
||||
function disque(o) { if (o.t !== 'etoile' && o.t !== 'naine-blanche') return ''; var T = tempe(o), r = o.r || (o.cat ? Math.sqrt(lum(o)) * Math.pow(5772 / T, 2) : 1), c = couleurT(T);
|
||||
var px = Math.max(14, Math.min(90, 40 + 16 * Math.log10(Math.max(r, 0.005))));
|
||||
return '<div class="et__modele"><div class="et__disque" style="width:' + px + 'px;height:' + px + 'px;background:radial-gradient(circle at 42% 40%,#fff 0%,' + c + ' 38%,' + c + 'cc 62%,' + c + '00 72%);box-shadow:0 0 ' + Math.round(px / 2) + 'px ' + c + '66"></div>'
|
||||
+ '<div class="et__leg" style="text-align:center">' + tag('MODÈLE') + '<br>~' + nb(T) + ' K · ' + (r < 0.01 ? nb(r * 696000, 0) + ' km' : nb(r, r < 10 ? 2 : 0) + ' R☉') + '<br>Soleil = 40 px</div></div>'; }
|
||||
function systeme(o) { var S0 = planetesDe(o); if (!S0) return '';
|
||||
var pl = S0.pl, hz = [0.95 * Math.sqrt(S0.L), 1.67 * Math.sqrt(S0.L)], amax = Math.max(pl.length ? pl[pl.length - 1].a : hz[1], hz[1]) * 1.12, a0 = amax / 40, R = 108;
|
||||
pl.forEach(function (x) { amax = Math.max(amax, x.a * 1.12); });
|
||||
function rp(a) { return R * Math.log(1 + a / a0) / Math.log(1 + amax / a0); }
|
||||
var t = anNow(), svg = '<svg viewBox="0 0 280 280" role="img" aria-label="le système de ' + esc(o.n) + '"><g transform="translate(140 140)">'
|
||||
+ '<path fill="rgba(95,224,192,.12)" fill-rule="evenodd" d="M' + rp(hz[1]) + ' 0A' + rp(hz[1]) + ' ' + rp(hz[1]) + ' 0 1 0 ' + (-rp(hz[1])) + ' 0A' + rp(hz[1]) + ' ' + rp(hz[1]) + ' 0 1 0 ' + rp(hz[1]) + ' 0M' + rp(hz[0]) + ' 0A' + rp(hz[0]) + ' ' + rp(hz[0]) + ' 0 1 0 ' + (-rp(hz[0])) + ' 0A' + rp(hz[0]) + ' ' + rp(hz[0]) + ' 0 1 0 ' + rp(hz[0]) + ' 0Z"/>'
|
||||
+ '<circle r="5" fill="' + couleurT(tempe(o)) + '"/>';
|
||||
pl.forEach(function (x, i) { var rr = rp(x.a), jpl = o.id === 'soleil' ? PLANETES.filter(function (p) { return norm(p[0]).slice(0, 4) === norm(x.n).slice(0, 4); })[0] : null;
|
||||
var ang = jpl ? Lmoy(jpl, t) * Math.PI / 180 : 2 * Math.PI * ((hash(o.id + x.n) / 4294967296 + (t - 2026) * 365.25 / x.P) % 1);
|
||||
var px = rr * Math.cos(ang), py = -rr * Math.sin(ang);
|
||||
svg += '<circle r="' + rr.toFixed(1) + '" fill="none" stroke="rgba(150,170,230,.28)" stroke-width="0.8"/><circle cx="' + px.toFixed(1) + '" cy="' + py.toFixed(1) + '" r="3.4" fill="' + (x.dec ? '#ffd76a' : S0.reel ? '#8ff0c9' : '#d8c2ff') + '"/>'
|
||||
+ (pl.length <= 9 ? '<text x="' + (px + 5).toFixed(1) + '" y="' + (py - 4).toFixed(1) + '" fill="#b9c8ea" font-size="8.5" font-family="ui-sans-serif,system-ui">' + esc(x.n.replace(o.n + ' ', '').replace(' (Terre)', '')) + '</text>' : ''); });
|
||||
svg += '</g></svg>';
|
||||
return '<div class="et__sys">' + svg + '<div class="et__leg">' + (S0.reel ? tag('RÉEL') + (o.exo ? ' NASA Exoplanet Archive · ' : ' orbites connues · ') + (S0.dec ? '<span style="color:#ffd76a">● ' + S0.dec + ' découverte(s) (ton journal + le journal commun)</span> · ' : '') : tag('PROCÉDURAL') + ' aucune planète connue : système généré (graine = l’astre, le même pour tout le monde ; une découverte l’écrasera) · ')
|
||||
+ tag('MODÈLE') + ' positions au ' + dateAn(t) + ' · rayon en échelle log · ▢ vert = zone habitable (' + nb(hz[0], 2) + '–' + nb(hz[1], 2) + ' UA)</div></div>'; }
|
||||
// ── l'état : favoris, voyages notés, mon vaisseau — fusion (jamais newest-wins) avec le boxion ──
|
||||
function etat0() { return { favs: [], voyages: [], jalons: [], journal: [], retires: [], perso: { g: 1, b: 0.9 }, maj: 0 }; }
|
||||
var S = lire(K, null) || etat0(); ['favs', 'voyages', 'jalons', 'journal', 'retires'].forEach(function (k) { if (!Array.isArray(S[k])) S[k] = []; }); if (!S.perso) S.perso = { g: 1, b: 0.9 };
|
||||
function fusion(o) { if (!o) return; var ret = {}; S.retires.concat(o.retires || []).forEach(function (r) { ret[r] = 1; }); S.retires = Object.keys(ret).slice(-500);
|
||||
S.favs = S.favs.concat((o.favs || []).filter(function (f) { return S.favs.indexOf(f) < 0; })).filter(function (f) { return !ret['f:' + f]; });
|
||||
var ids = {}; S.voyages.forEach(function (v) { ids[v.id] = 1; }); (o.voyages || []).forEach(function (v) { if (v && v.id && !ids[v.id]) S.voyages.push(v); });
|
||||
S.voyages = S.voyages.filter(function (v) { return !ret['v:' + v.id]; });
|
||||
var jid = {}; S.jalons.forEach(function (j) { jid[j.id] = 1; }); (o.jalons || []).forEach(function (j) { if (j && j.id && !jid[j.id]) S.jalons.push(j); });
|
||||
S.jalons = S.jalons.filter(function (j) { return !ret['j:' + j.id]; });
|
||||
var lid = {}; S.journal.forEach(function (l) { lid[l.id] = 1; }); (o.journal || []).forEach(function (l) { if (l && l.id && !lid[l.id]) S.journal.push(l); });
|
||||
S.journal = S.journal.filter(function (l) { return !ret['l:' + l.id]; }); }
|
||||
// le journal de bord d'un astre : ✓ visite, ✎ log, ◉ découverte — en ajout seul (un tsoin par entrée), au calendrier de Terra
|
||||
var JK = { visite: ['✓', 'j’y suis allé'], log: ['✎', 'log'], decouverte: ['◉', 'découverte'] };
|
||||
function journalDe(id) { return S.journal.filter(function (l) { return l.astre === id; }).sort(function (a, b) { return b.an - a.an || b.cree - a.cree; }); }
|
||||
if (!S.vaisseauNom) { S.vaisseauNom = 'vaisseau ' + Math.random().toString(36).slice(2, 6); ecrire(K, S); }
|
||||
function commun() { return (window.jOSJournal && jOSJournal.tsoins) || []; }
|
||||
function sauver() { S.maj = Date.now(); ecrire(K, S);
|
||||
try { window.jOSBoxion && jOSBoxion.authed && jOSBoxion.authed() && jOSBoxion.saveSoon && jOSBoxion.saveSoon('etoiles', 'etat', S, 'mes étoiles'); } catch (e) {} }
|
||||
function estFav(id) { return S.favs.indexOf(id) >= 0; }
|
||||
function basculerFav(id) { var i = S.favs.indexOf(id); if (i >= 0) { S.favs.splice(i, 1); S.retires.push('f:' + id); } else { S.favs.push(id); S.retires = S.retires.filter(function (r) { return r !== 'f:' + id; }); } sauver(); }
|
||||
function vaisseau(id) { if (id === 'moncubion') { var c = SC.maConfig(); return depuisCubion(id, 'mon space-cubion « ' + c.nom + ' »', c); }
|
||||
if (String(id).indexOf('vision:') === 0) { var w = VISIONS[+id.slice(7)]; if (w) return depuisCubion(id, '« ' + w.nom + ' »', w.config || {}, 'registre · ' + (w.user_name || '?')); }
|
||||
var v = VAISSEAUX.filter(function (x) { return x.id === id; })[0] || VAISSEAUX.filter(function (x) { return x.id === 'kion'; })[0]; if (v.id === 'perso') { v.g = +S.perso.g || 0; v.b = +S.perso.b || 0; } return v; }
|
||||
|
||||
// un jalon = {id, lieu, an, note} ; lieu = l'id d'un astre, ou 'pl:<i>' pour une planète du système solaire (Terra, Mars, Pluton…)
|
||||
function lieu(l) { if (/^pl:\d+$/.test(l)) { var p = PLANETES[+l.slice(3)]; return p ? { n: p[0].replace(' (Terre)', ''), p: p, star: PAR_ID.soleil } : null; }
|
||||
var o = get(l); return o ? { n: o.n, star: o } : null; }
|
||||
function chercherLieu(t) { var n = norm(t); if (!n) return null; if (n === 'terre') n = 'terra';
|
||||
for (var i = 0; i < PLANETES.length; i++) if (norm(PLANETES[i][0]).indexOf(n) === 0) return 'pl:' + i;
|
||||
var o = chercher(t, 1)[0]; return o ? o.id : null; }
|
||||
function troncon(A, B, tA, techId, tB) { var v = vaisseau(techId);
|
||||
if (A.star === B.star) { var dUA = A.p && B.p ? distPlanetes(A.p, B.p, tA) : (A.p || B.p) ? (A.p || B.p)[1] : 0;
|
||||
var r0 = dUA > 0 ? voyage(dUA / 63241.077, v.ver ? vaisseau('kion') : v) : { t: 0, tau: 0, vmax: 0 }; r0.d = dUA / 63241.077; return r0; }
|
||||
return cible(A.star, B.star, v.ver ? vaisseau('kion') : v, false, tB, 'arr'); }
|
||||
// le planificateur à jalons : pour chaque paire A → B, séjour dispo = écart de dates − durée du trajet (négatif = impossible)
|
||||
function planJalons(jalons, techId) { var H = window.jOSHyper, l = jalons.slice().sort(function (a, b) { if ((a.anT || b.anT) && H) return H.cmp(a.anT || a.an, b.anT || b.an); return a.an - b.an; }), out = [], tau = 0;
|
||||
for (var i = 0; i < l.length; i++) { var A = lieu(l[i].lieu), e = { j: l[i], L: A };
|
||||
if (i + 1 < l.length && A && !l[i].anT && !l[i + 1].anT) { var B = lieu(l[i + 1].lieu); if (B) { var r = troncon(A, B, l[i].an, techId, l[i + 1].an); e.r = r; e.dispo = (l[i + 1].an - l[i].an) - r.t; e.depMax = l[i + 1].an - r.t;
|
||||
tau += r.tau + Math.max(0, e.dispo); } }
|
||||
out.push(e); }
|
||||
var reel = out.filter(function (e) { return !e.j.anT; }); // la durée du plan : sans les jalons profonds
|
||||
return { l: out, tau: tau, T: reel.length > 1 ? reel[reel.length - 1].j.an - reel[0].j.an : 0 }; }
|
||||
|
||||
function describe() { var p = S.voyages.slice().sort(function (a, b) { return (a.depart || 0) - (b.depart || 0); }).filter(function (v) { return (v.depart || 0) >= anNow() - 1; })[0];
|
||||
return { v: 1, id: 'etoiles', title: 'Étoiles', icon: '✦', items: [
|
||||
{ p: 1, kind: 'stat', label: 'mes étoiles', value: String(S.favs.length) },
|
||||
{ p: 2, kind: 'stat', label: 'prochain voyage', value: p ? (p.versN || '?') + ' · ' + an(p.depart) : '—' },
|
||||
{ p: 3, kind: 'stat', label: 'jalons', value: String(S.jalons.length) },
|
||||
{ p: 4, kind: 'stat', label: 'journal', value: String(S.journal.length) }] }; }
|
||||
|
||||
// l'état d'étoiles s'ajoute au bion : jalons, journal, et les découvertes (mon journal + le journal commun) que le bion met dans les systèmes
|
||||
Object.assign(A0, { jalons: function (techId) { return planJalons(S.jalons, techId || 'kion'); }, journal: function (id) { return id ? journalDe(id) : S.journal.slice(); },
|
||||
decouvertes: function (id) { var out = S.journal.filter(function (l) { return l.astre === id && l.type === 'decouverte' && l.sorte === 'planète' && l.a > 0; }).map(function (l) { return { nom: l.nom, a: +l.a }; });
|
||||
commun().forEach(function (t) { if (t.type !== 'decouverte' || t.objet !== id || t.sorte !== 'planète' || !(t.a > 0)) return; var nn = String(t.nom || '').toLowerCase();
|
||||
if (!out.some(function (x) { return String(x.nom || '').toLowerCase() === nn; })) out.push({ nom: t.nom, a: +t.a, par: t.auteur }); });
|
||||
return out; } });
|
||||
|
||||
function mount(container, ctx) {
|
||||
var onglet = (ctx && ctx.onglet) || lire(K + ':onglet', 'astres'), q = '', filtre = 'tout', fiche = null, ficheMini = false, favSel = [], form = null;
|
||||
var V = { de: 'soleil', vers: 'proxima', vaisseau: 'kion', mode: 'partir', annee: Math.floor(anNow()) + 1, note: '', survol: false, verE: '', verS: '', p1: 2, p2: 3, etapes: [{ id: 'soleil' }, { id: 'proxima', tech: 'kion', escale: 0 }] };
|
||||
var vue = { cx: 0, cy: R0, s: 0.25, d3: false, yaw: 0, pitch: 0 }, SAVOIR = {}, cv = null, gx = null, sale = false, ptrs = {}, glisse = null, raf = 0, ro = null;
|
||||
|
||||
function terra() { var d = new Date(); return 'Terra · ' + d.getDate() + ' ' + MOIS[d.getMonth()] + ' an ' + d.getFullYear(); }
|
||||
function ligne(o) { var ty = TYPES[o.t] || TYPES.etoile, sous = o.cat ? (o.sp || '') + (o.con ? ' · ' + o.con : '') + ' · catalogue' : ty[1] + (o.sp ? ' · ' + o.sp : '') + (o.pl ? ' · ' + o.pl.length + ' planète' + (o.pl.length > 1 ? 's' : '') : '');
|
||||
if (o.exo) sous += ' · ◉ ' + o.exo.length + ' exoplanète' + (o.exo.length > 1 ? 's' : '');
|
||||
return '<div class="et__l" data-fiche="' + esc(o.id) + '"><span class="et__g" style="color:' + couleur(o) + '">' + ty[0] + '</span><div><div class="n">' + esc(o.n) + (estFav(o.id) ? ' <span style="color:#ffd76a">★</span>' : '') + '</div><div class="s">' + esc(sous) + '</div></div><span class="d">' + (o.id === 'soleil' ? '8,3 min-lumière' : dist(o.d)) + '</span></div>'; }
|
||||
|
||||
function vueAstres() {
|
||||
var compte = {}; ASTRES.forEach(function (o) { compte[o.t] = (compte[o.t] || 0) + 1; }); var avecPl = ASTRES.filter(function (o) { return o.pl || o.exo; }).length;
|
||||
var chips = '<button class="et__c' + (filtre === 'tout' ? ' on' : '') + '" data-filtre="tout">tout</button><button class="et__c' + (filtre === 'planetes' ? ' on' : '') + '" data-filtre="planetes">◉ avec planètes<small>' + avecPl + '</small></button>'
|
||||
+ '<button class="et__c' + (filtre === 'exo' ? ' on' : '') + '" data-filtre="exo">◉ exoplanètes réelles<small>' + (X.exoN() ? nb(X.exoN()) + ' systèmes' : '…') + '</small></button>'
|
||||
+ Object.keys(TYPES).filter(function (t) { return compte[t]; }).map(function (t) { return '<button class="et__c' + (filtre === t ? ' on' : '') + '" data-filtre="' + t + '"><span style="color:' + TYPES[t][2] + '">' + TYPES[t][0] + '</span> ' + TYPES[t][1] + '<small>' + compte[t] + '</small></button>'; }).join('');
|
||||
var l = q ? chercher(q, 60) : ASTRES.slice();
|
||||
if (filtre === 'exo') l = (q ? l : ASTRES.concat(X.hyg() || [], X.exo()).filter(function (o) { return o.exo && !o.double; }).sort(function (a, b) { return a.d - b.d; })).filter(function (o) { return o.exo; }).slice(0, 300);
|
||||
else if (filtre === 'planetes') l = l.filter(function (o) { return o.pl || o.exo; }); else if (filtre !== 'tout') l = l.filter(function (o) { return o.t === filtre; });
|
||||
if (!q && filtre !== 'exo') l.sort(function (a, b) { return a.d - b.d; });
|
||||
return '<div class="et__sec"><input class="et__in" data-q type="search" placeholder="Procyon, Véga, Proxima, Sgr A*, Andromède…" value="' + esc(q) + '" autocomplete="off">'
|
||||
+ '<div class="et__chips" style="margin-top:8px">' + chips + '</div></div>'
|
||||
+ (l.length ? l.map(ligne).join('') : '<div class="et__vide">' + (X.hyg() ? 'rien de ce nom.' : 'le catalogue se charge…') + '</div>')
|
||||
+ '<div class="et__vide">' + ASTRES.length + ' astres dans le recueil' + (X.hyg() ? ' + ' + nb(X.hyg().length) + ' étoiles nommées du catalogue (HYG) : cherche par nom.' : ' · catalogue d’étoiles en chargement') + '</div>';
|
||||
}
|
||||
function entree(l) { var k = JK[l.type] || ['·', l.type];
|
||||
return '<div style="font-size:.76rem;margin:3px 0">' + k[0] + ' <b>' + an(l.an) + '</b> · ' + k[1] + (l.nom ? ' : <b>' + esc(l.nom) + '</b>' + (l.sorte ? ' (' + esc(l.sorte) + (l.a ? ', ' + nb(l.a, 2) + ' UA' : '') + ')' : '') : '')
|
||||
+ (l.texte ? ' — ' + esc(l.texte) : '') + (l.pub ? ' <span class="et__tag reel" title="publié au journal commun">⇪ publié</span>' : ' <button class="et__c" data-lpub="' + esc(l.id) + '" style="padding:0 6px;font-size:.66rem" title="publier au journal commun">⇪</button>') + ' <button class="et__c" data-lsuppr="' + esc(l.id) + '" style="padding:0 6px;font-size:.66rem">✕</button></div>'; }
|
||||
function formulaire(id) { if (!form || form.id !== id) return ''; var k = form.k, an0 = Math.floor(anNow());
|
||||
return '<div class="et__res" style="margin:4px 0 6px">' + '<div class="et__h">' + (k === 'jalon' ? '◇ un jalon : être là en…' : (JK[k] || [])[0] + ' ' + (JK[k] || [])[1]) + '</div>'
|
||||
+ '<div class="et__row"><label style="flex:0 0 110px"><span class="et__h">an (Terra)</span><input class="et__in" data-ff-an type="number" step="1" value="' + an0 + '"></label>'
|
||||
+ (k === 'decouverte' ? '<label><span class="et__h">nom</span><input class="et__in" data-ff-nom placeholder="' + esc((get(id) || {}).n || '') + ' b"></label><label style="flex:0 0 120px"><span class="et__h">quoi</span><select class="et__in" data-ff-sorte>'
|
||||
+ ['planète', 'lune', 'astéroïde', 'comète', 'anneau', 'autre'].map(function (x) { return '<option>' + x + '</option>'; }).join('') + '</select></label><label style="flex:0 0 90px"><span class="et__h">orbite UA</span><input class="et__in" data-ff-a type="number" step="0.01" min="0"></label>' : '')
|
||||
+ '</div><input class="et__in" data-ff-txt placeholder="' + (k === 'log' ? 'ce que tu as vu, fait, pensé…' : k === 'jalon' ? 'à faire là-bas' : 'une note') + '" style="margin-top:6px">'
|
||||
+ '<div class="et__act"><button class="et__c on" data-fok>+ noter</button><button class="et__c" data-fannule>annuler</button></div></div>'; }
|
||||
function vueFavs() {
|
||||
var ids = S.favs.slice(); S.journal.forEach(function (l) { if (ids.indexOf(l.astre) < 0) ids.push(l.astre); }); if (form && ids.indexOf(form.id) < 0) ids.unshift(form.id);
|
||||
var l = ids.map(get).filter(Boolean); favSel = favSel.filter(function (id) { return ids.indexOf(id) >= 0; });
|
||||
var barre = '<div class="et__chips" style="margin-top:6px">' + (favSel.length ? '<button class="et__c on" data-fitin>⋯ itinéraire : Terra → ' + favSel.map(function (id) { return esc((get(id) || {}).n || id); }).join(' → ') + '</button><button class="et__c" data-fdesel>désélectionner</button>'
|
||||
: '<span style="font-size:.72rem;color:#7f93c8">coche des étoiles (☐) pour en faire un itinéraire, dans l’ordre où tu les coches</span>') + '</div>';
|
||||
return '<div class="et__sec"><p class="et__h">☆ mes étoiles · journal de bord</p>' + (ids.length && !l.length && !X.hyg() ? '<div class="et__vide">chargement…</div>' : '') + (l.length ? barre : '') + '</div>'
|
||||
+ (l.length ? l.map(function (o) { var jo = journalDe(o.id), k = favSel.indexOf(o.id);
|
||||
return ligne(o) + '<div class="et__pv" style="margin:-2px 12px 6px 44px">lumière vue ce soir : partie en <b>' + an(anNow() - o.d) + '</b>' + (o.id !== 'soleil' ? ' · en space-kion : ' + (function (r) { return dureeVol(r.t, r.tau); })(voyage(o.d, vaisseau('kion'))) : '')
|
||||
+ '<div class="et__chips" style="margin-top:5px"><button class="et__c' + (k >= 0 ? ' on' : '') + '" data-fsel="' + esc(o.id) + '">' + (k >= 0 ? '☑ ' + (k + 1) : '☐') + '</button>'
|
||||
+ [['visite', '✓ j’y suis allé'], ['log', '✎ log'], ['decouverte', '◉ découverte'], ['jalon', '◇ jalon']].map(function (x) { return '<button class="et__c' + (form && form.id === o.id && form.k === x[0] ? ' on' : '') + '" data-fform="' + esc(o.id) + '|' + x[0] + '">' + x[1] + '</button>'; }).join('') + '</div>'
|
||||
+ formulaire(o.id) + jo.map(entree).join('') + '</div>'; }).join('')
|
||||
: '<div class="et__vide">Aucune encore. Ouvre une fiche et touche ☆ pour la garder sous la main.</div>')
|
||||
+ vueCommun();
|
||||
}
|
||||
var GT = { plan: '◇', visite: '✓', log: '✎', decouverte: '◉', position: '⊳', message: '✉' };
|
||||
function ligneCommun(t) { var now = anNow(), st = window.jOSJournal ? jOSJournal.statut(t) : '';
|
||||
return '<div class="et__pv" style="margin:4px 0">' + (GT[t.type] || '·') + ' <b>' + esc(t.auteur || '?') + '</b>' + (t.mien ? ' <span class="et__tag">toi</span>' : '')
|
||||
+ ' · ' + (t.type === 'plan' ? 'plan : ' + esc((t.jalons || []).map(function (j) { return (j.lieu_n || j.lieu) + ' ' + an(j.an); }).join(' → '))
|
||||
: (JK[t.type] ? JK[t.type][1] : t.type) + (t.objet_n ? ' · <span data-fiche="' + esc(t.objet || '') + '" style="cursor:pointer;text-decoration:underline dotted">' + esc(t.objet_n) + '</span>' : '') + (t.an != null ? ' · ' + an(t.an) : '')
|
||||
+ (t.nom ? ' : <b>' + esc(t.nom) + '</b>' + (t.sorte ? ' (' + esc(t.sorte) + (t.a ? ', ' + nb(t.a, 2) + ' UA' : '') + ')' : '') : '') + (st ? ' <span class="et__tag ' + (st === 'découverte' ? 'reel' : 'modele') + '">' + st + '</span>' : ''))
|
||||
+ (t.texte ? '<div style="color:#9fb0dc;font-size:.74rem">' + esc(t.texte) + '</div>' : '')
|
||||
+ '<div style="color:#7f93c8;font-size:.66rem">émis le ' + dateAn(t.emis_an) + (t.visible_an > t.emis_an + 1e-6 ? ' · visible chez les autres le ' + dateAn(t.visible_an) + (t.visible_an > now ? ' (la lumière est en route)' : '') : ' depuis Terra : visible tout de suite') + '</div></div>'; }
|
||||
function vueCommun() { var J = window.jOSJournal; if (!J) return '';
|
||||
var l = commun().slice(0, 60);
|
||||
return '<div class="et__sec"><p class="et__h">◌ journal commun · délai lumière compris</p>'
|
||||
+ '<div class="et__row" style="margin-bottom:6px"><label><span class="et__h">ton vaisseau (ton nom public)</span><input class="et__in" data-vnom maxlength="40" value="' + esc(S.vaisseauNom) + '"></label></div>'
|
||||
+ (l.length ? l.map(ligneCommun).join('') : '<div class="et__vide" style="padding:4px 0">Rien encore (ou connecte-toi). Touche ⇪ sur une entrée de ton journal, ou publie ton plan dans voyages → ◇ jalons. Une entrée n’apparaît chez les autres qu’une fois sa lumière arrivée sur Terra.</div>')
|
||||
+ '</div>'; }
|
||||
function choixAstre(attr, val) { return '<input class="et__in" list="et-noms" data-' + attr + ' value="' + esc((get(val) || {}).n || val) + '">'; }
|
||||
function puce(x, attr, on) { return '<button class="et__c' + (on ? ' on' : '') + '" data-' + attr + '="' + x.id + '" title="' + esc(x.note) + '">' + esc(x.n) + ' <small>' + esc(x.gen) + '</small></button>'; }
|
||||
function choixTech(attr, val) { return '<div class="et__chips">' + VAISSEAUX.map(function (x) { return puce(x.id === 'moncubion' ? vaisseau('moncubion') : x, attr, val === x.id); }).join('') + '</div>'
|
||||
+ (VISIONS.length ? '<p class="et__h" style="margin-top:8px">les vaisseaux du registre des visions (space-cubion)</p><div class="et__chips">' + VISIONS.slice(0, 24).map(function (w, i) { return puce(vaisseau('vision:' + i), attr, val === 'vision:' + i); }).join('') + '</div>' : ''); }
|
||||
function noteTech(v) { return '<div class="et__note" style="font-size:.74rem;color:#9fb0dc">' + esc(v.note) + (v.g && !v.cubion ? ' · ' + nb(v.g, 2) + ' g' : '') + (v.b && v.b < 1 ? (v.g ? ' · plafond ' : ' · ') + (v.b < 0.01 ? nb(v.b / KMS, 0) + ' km/s' : nb(v.b * 100, 1) + ' % c') : '') + '<span class="et__tag">' + esc(v.tag) + '</span></div>'
|
||||
+ (v.id === 'perso' ? '<div class="et__row"><label><span class="et__h">accélération (g)</span><input class="et__in" data-pg type="number" min="0" max="100" step="0.01" value="' + esc(S.perso.g) + '"></label><label><span class="et__h">plafond (fraction de c, 0 = aucun)</span><input class="et__in" data-pb type="number" min="0" max="0.999999" step="0.01" value="' + esc(S.perso.b) + '"></label></div>' : '')
|
||||
+ (v.ver ? '<div class="et__row"><label><span class="et__h">bouche d’entrée</span>' + choixAstre('ventree', V.verE || V.de) + '</label><label><span class="et__h">bouche de sortie</span>' + choixAstre('vsortie', V.verS || V.vers) + '</label></div>' : ''); }
|
||||
// un trajet entre deux astres avec une technologie (le trou de ver : approche + transit + sortie, et le temps d'ouverture)
|
||||
function trajet(a, b, techId, survol, t, sens) { var v = vaisseau(techId);
|
||||
if (!v.ver) return cible(a, b, v, survol, t, sens || 'dep');
|
||||
var e = get(V.verE || a.id) || a, s = get(V.verS || b.id) || b, k = vaisseau('kion'), r1 = voyage(distance(a, e), k), r2 = voyage(distance(s, b), k), ouv = voyage(distance(e, s), k);
|
||||
return { t: r1.t + r2.t, tau: r1.tau + r2.tau, vmax: Math.max(r1.vmax, r2.vmax), ver: { e: e, s: s, ouverture: ouv } }; }
|
||||
function resultat(r, dep, arr, d, vers) { var now = anNow(), kv = [];
|
||||
kv.push('<dt>départ</dt><dd><b>' + an(dep) + '</b> de Terra' + (dep < now - 0.5 ? ' <span style="color:#ff9b6a">△ déjà passé : au plus tôt, arrivée en ' + an(now + r.t) + '</span>' : '') + '</dd>');
|
||||
kv.push('<dt>arrivée</dt><dd><b>' + an(arr) + '</b> de Terra</dd>' + temps(r.t, r.tau));
|
||||
if (r.vmax) kv.push('<dt>vitesse max</dt><dd>' + (r.vmax < 0.01 ? nb(r.vmax / KMS, 0) + ' km/s' : nb(r.vmax * 100, r.vmax > 0.999 ? 5 : 1) + ' % de c') + (r.vmax < 1 && r.vmax > 0.05 ? ' (γ = ' + nb(1 / Math.sqrt(1 - r.vmax * r.vmax), 2) + ')' : '') + '</dd>');
|
||||
if (r.croisiere) kv.push('<dt>dont croisière</dt><dd>' + duree(r.croisiere) + ' (Terra)</dd>');
|
||||
if (r.flip) kv.push('<dt>⟲ flip</dt><dd>en ' + an(dep + r.flip.t) + ' de Terra · après ' + dureeVol(r.flip.t, r.flip.tau) + ' · à ' + dist(r.flip.d) + ' du départ</dd>');
|
||||
if (r.impossible) kv.push('<dt>△</dt><dd>impossible : ' + esc(r.impossible) + ' (ajoute de l’ergol dans space-cubion → Mon cubion)</dd>');
|
||||
if (r.survol) kv.push('<dt>arrivée</dt><dd>survol : on passe sans s’arrêter</dd>');
|
||||
if (r.ver) kv.push('<dt>⊚ trou de ver</dt><dd>' + esc(r.ver.e.n) + ' ⇝ ' + esc(r.ver.s.n) + ' · transit ~ instantané · l’ouvrir : transporter la bouche ' + duree(r.ver.ouverture.t) + ' (Terra), prête en ' + an(dep + r.ver.ouverture.t) + ' si on part maintenant</dd>');
|
||||
kv.push('<dt>un message vers Terra</dt><dd>reçu en ' + an(arr + distance(vers, PAR_ID.soleil)) + '</dd>');
|
||||
return '<dl class="et__kv">' + kv.join('') + '</dl>'; }
|
||||
function vueStellaire() {
|
||||
var p1 = PLANETES[V.p1], p2 = PLANETES[V.p2], A = +V.annee || anNow(), sel = '<select class="et__in" data-p%>' + PLANETES.map(function (p, i) { return '<option value="' + i + '">' + esc(p[0]) + '</option>'; }).join('') + '</select>';
|
||||
var h = p1 !== p2 ? hohmann(p1, p2, Math.max(A, anNow())) : null, sl = p1 !== p2 ? slingshot(p1, p2) : null, v = vaisseau(V.vaisseau), vb = v.g ? v : vaisseau('kion'), dAU = distPlanetes(p1, p2, Math.max(A, anNow()));
|
||||
var rb = voyage(dAU / 63241.077, vb);
|
||||
return '<div class="et__row"><label><span class="et__h">de</span>' + sel.replace('%', '1').replace('value="' + V.p1 + '"', 'value="' + V.p1 + '" selected') + '</label><label><span class="et__h">vers</span>' + sel.replace('%', '2').replace('value="' + V.p2 + '"', 'value="' + V.p2 + '" selected') + '</label></div>'
|
||||
+ '<div class="et__row" style="margin-top:8px"><label><span class="et__h">pas avant l’année</span><input class="et__in" data-annee type="number" step="1" value="' + esc(V.annee) + '"></label></div>'
|
||||
+ (!h ? '<div class="et__vide">choisis deux planètes différentes.</div>'
|
||||
: '<div class="et__res"><div class="et__h">◠ transfert de Hohmann · actuelle (poussées précises)</div><dl class="et__kv">'
|
||||
+ '<dt>fenêtre de tir</dt><dd><b>' + dateAn(h.fenetre) + '</b> · puis tous les ' + duree(h.synodique) + '</dd>' + temps(h.t, h.t - h.t * h.v2m)
|
||||
+ '<dt>arrivée</dt><dd>' + dateAn(h.fenetre + h.t) + '</dd><dt>poussées</dt><dd>Δv ' + nb(h.dv1, 2) + ' km/s au départ + ' + nb(h.dv2, 2) + ' km/s à l’arrivée (hors puits des planètes)</dd>' + (function () { var mc = vaisseau('moncubion'), need = h.dv1 + h.dv2;
|
||||
return '<dt>' + esc(mc.n) + '</dt><dd>Δv ' + nb(mc.dv / 1000, 1) + ' km/s pour ' + nb(need, 1) + ' km/s demandés · ' + (mc.dv / 1000 >= need ? '<b>✓ il peut le faire</b>' : '<span style="color:#ff9b6a">✗ il manque ' + nb(need - mc.dv / 1000, 1) + ' km/s</span>') + '</dd>'; })() + '</dl>'
|
||||
+ '<div class="et__note" style="font-size:.74rem;color:#9fb0dc">L’ellipse qui touche les deux orbites : la trajectoire la moins chère en carburant. La cible doit avoir la bonne avance au départ, d’où la fenêtre.</div></div>'
|
||||
+ (sl ? '<div class="et__res"><div class="et__h">↷ slingshot par Jupiter</div><dl class="et__kv">' + temps(sl.t, sl.t * (1 - 1.6e-9)) + '<dt>au lieu de</dt><dd>' + duree(h.t) + ' en Hohmann direct</dd>'
|
||||
+ '<dt>après Jupiter</dt><dd>' + nb(sl.vJ, 1) + ' km/s autour du Soleil (Jupiter atteint en ' + duree(sl.tJ) + ')</dd></dl><div class="et__note" style="font-size:.74rem;color:#9fb0dc">~ estimation : la vitesse relative à Jupiter retournée vers l’avant, puis tir quasi radial. Demande l’alignement de Jupiter avec la cible (rare : le Grand Tour de Voyager, 1977). Survol sans freinage.</div></div>' : '')
|
||||
+ '<div class="et__res"><div class="et__h">⟲ brachistochrone · ' + esc(vb.n) + '</div><dl class="et__kv"><dt>distance à cette date</dt><dd>' + nb(dAU, 2) + ' UA</dd>' + temps(rb.t, rb.tau)
|
||||
+ '<dt>⟲ flip</dt><dd>à mi-chemin, après ' + duree(rb.flip ? rb.flip.t : rb.t / 2) + ' (Terra), à ' + nb(rb.vmax / KMS, 0) + ' km/s</dd></dl><div class="et__note" style="font-size:.74rem;color:#9fb0dc">Accélération constante, flip, freinage : la ligne droite (la cible bouge peu en quelques jours). Choisis la technologie avec une accélération dans « vaisseau » ; sinon 1 g.</div></div>')
|
||||
+ '<p class="et__h" style="margin-top:10px">vaisseau pour la brachistochrone</p>' + choixTech('vaisseau', V.vaisseau);
|
||||
}
|
||||
function vueItin() {
|
||||
var et = V.etapes, lignes = [], t0 = +V.annee || Math.floor(anNow()), t = t0, tau = 0, ok = true;
|
||||
for (var i = 0; i < et.length; i++) { var o = get(et[i].id); if (!o) { ok = false; continue; }
|
||||
var bloc = '<div class="et__pv"><b>' + (i + 1) + '. ' + esc(o.n) + '</b>';
|
||||
if (i > 0) { var pr = get(et[i - 1].id); if (pr) { var r = trajet(pr, o, et[i].tech, undefined, t); t += r.t; tau += r.tau;
|
||||
bloc += ' · arrivée <b>' + an(t) + '</b> · ' + esc(vaisseau(et[i].tech).n) + ' : ' + dist(r.d || distance(pr, o)) + ', ' + dureeVol(r.t, r.tau) + (r.flip ? ', flip en ' + an(t - r.t + r.flip.t) : ''); } }
|
||||
else bloc += ' · départ <b>' + an(t) + '</b>';
|
||||
if (i > 0 || et[i].escale) bloc += '<div class="et__row" style="margin-top:4px"><label><span class="et__h">escale (ans)</span><input class="et__in" data-escale="' + i + '" type="number" min="0" step="0.5" value="' + esc(et[i].escale || 0) + '"></label>' + (i > 0 ? '<label><span class="et__h">techno de ce saut</span><select class="et__in" data-etech="' + i + '">' + VAISSEAUX.map(function (x) { return '<option value="' + x.id + '"' + (x.id === et[i].tech ? ' selected' : '') + '>' + esc(x.n) + '</option>'; }).join('') + '</select></label>' : '') + '</div>';
|
||||
if (et[i].escale) { t += +et[i].escale; tau += +et[i].escale; bloc += '<div style="font-size:.72rem;color:#9fb0dc">reparti en ' + an(t) + '</div>'; }
|
||||
lignes.push(bloc + (i > 0 ? ' <button class="et__c" data-etsuppr="' + i + '" style="padding:1px 7px;margin-top:4px">✕</button>' : '') + '</div>'); }
|
||||
return '<div class="et__row"><label><span class="et__h">année du départ</span><input class="et__in" data-annee type="number" step="1" value="' + esc(V.annee) + '"></label></div>'
|
||||
+ lignes.join('') + '<div class="et__row"><label><span class="et__h">+ étape suivante</span>' + choixAstre('etape', '') + '</label></div>'
|
||||
+ '<div class="et__res"><div class="et__h">tout l’itinéraire</div><dl class="et__kv"><dt>départ</dt><dd><b>' + an(t0) + '</b> de Terra</dd><dt>fin</dt><dd><b>' + an(t) + '</b> de Terra</dd>' + temps(t - t0, tau) + '<dt>étapes</dt><dd>' + et.length + ' (une escale compte pareil sur Terra et à bord)</dd></dl></div>';
|
||||
}
|
||||
function vueJalons() {
|
||||
var P0 = planJalons(S.jalons, V.vaisseau), v = vaisseau(V.vaisseau), h = '';
|
||||
P0.l.forEach(function (e, i) { var j = e.j;
|
||||
h += '<div class="et__jal"><div class="t">◇ <input class="et__in" data-jan="' + esc(j.id) + '" type="text" inputmode="decimal" aria-label="année Terra (2077, 10^67, 10^10^122)" value="' + esc(j.anT && window.jOSHyper ? jOSHyper.fmt(j.anT) : Math.round(j.an)) + '"><b>' + esc(e.L ? e.L.n : '?') + '</b>'
|
||||
+ '<button class="et__c" data-jsuppr="' + esc(j.id) + '" style="margin-left:auto;padding:1px 7px">✕</button></div>' + (j.note ? '<div style="font-size:.74rem;color:#9fb0dc;margin-top:3px">' + esc(j.note) + '</div>' : '') + '</div>';
|
||||
if (e.r) { var r = e.r, ok = e.dispo >= 0;
|
||||
h += '<div class="et__leg2">⟶ ' + dist(r.d) + ' · ' + dureeVol(r.t, r.tau) + (r.flip ? ' · flip en ' + an(e.depMax + r.flip.t) : '')
|
||||
+ (ok ? '<br>' + (i === 0 ? 'temps libre avant de partir' : 'séjour max sur place') + ' : <b style="color:#8ff0c9">' + duree(e.dispo) + '</b> · départ au plus tard en <b>' + an(e.depMax) + '</b>'
|
||||
: '<br><span class="et__ko">✗ impossible : il manque ' + duree(-e.dispo) + ' · au plus tôt, arrivée en ' + an(j.an + r.t) + '</span>') + '</div>'; } });
|
||||
var premier = P0.l[0] && P0.l[0].L, dernier = P0.l.length > 1 && P0.l[P0.l.length - 1].L, sol = PAR_ID.soleil;
|
||||
var R = premier && dernier && premier.star === sol && dernier.star === sol ? bulle(P0.T, 0, v.g ? v : vaisseau('kion')) : 0;
|
||||
return '<p class="et__h">technologie de tout le plan</p>' + choixTech('vaisseau', V.vaisseau)
|
||||
+ '<div class="et__note" style="font-size:.76rem;color:#9fb0dc">Pose juste où tu veux être et en quelle année (calendrier de Terra). Le plan calcule le reste : le séjour max, le départ au plus tard, le temps à bord. Ajoute au fil du temps.</div>'
|
||||
+ (P0.l.length ? h : '<div class="et__vide" style="padding:4px 0">Aucun jalon. <button class="et__c" data-jexemple>exemple : Terra 2077 → Pluton 2120 → Véga 7000 → Terra 7077</button></div>')
|
||||
+ '<div class="et__res"><div class="et__h">+ un jalon</div><div class="et__row"><label><span class="et__h">où</span><input class="et__in" list="et-noms" data-jlieu placeholder="Véga, Pluton, Terra, Proxima…"></label>'
|
||||
+ '<label style="flex:0 0 100px"><span class="et__h">an (Terra)</span><input class="et__in" data-jannee type="text" inputmode="decimal" placeholder="2077 · 10^67" aria-label="année Terra (2077, 10^67, 10^10^122)" value="' + esc(V.annee) + '"></label></div>'
|
||||
+ '<input class="et__in" data-jnote placeholder="à faire là-bas (optionnel)" style="margin-top:6px"><div class="et__act"><button class="et__c on" data-jajout>+ ajouter</button></div></div>'
|
||||
+ (P0.l.length > 1 ? '<div class="et__res"><div class="et__h">tout le plan</div><dl class="et__kv"><dt>de</dt><dd><b>' + anJ(P0.l[0].j) + '</b></dd><dt>à</dt><dd><b>' + anJ(P0.l[P0.l.length - 1].j) + '</b></dd>'
|
||||
+ temps(P0.T, P0.tau) + (R ? '<dt>◌ bulle de balade</dt><dd>aller-retour depuis Terra : jusqu’à <b>' + dist(R) + '</b> (sans séjour ; chaque année sur place la réduit)</dd>' : '') + '</dl>'
|
||||
+ '<div class="et__act"><button class="et__c" data-jpub>⇪ publier mon plan au journal commun</button></div>'
|
||||
+ '<div class="et__note" style="font-size:.72rem;color:#9fb0dc">À bord = les trajets + les séjours max. ' + tag('MODÈLE') + ' chaque trajet vise l’étoile là où elle sera à l’arrivée (vitesses HYG / NASA, mouvement en ligne droite).</div></div>' : '');
|
||||
}
|
||||
function vueVoyages() {
|
||||
var de = get(V.de), vers = get(V.vers), v = vaisseau(V.vaisseau), corps = '';
|
||||
if (V.mode === 'stellaire') corps = vueStellaire();
|
||||
else if (V.mode === 'jalons') corps = vueJalons();
|
||||
else if (V.mode === 'itin') corps = vueItin();
|
||||
else {
|
||||
var res = '';
|
||||
if (de && vers) { var A = +V.annee || Math.floor(anNow());
|
||||
if (V.mode === 'voir') res = '<div class="et__res"><div class="et__h">en l’' + an(A) + ' de Terra, on verra ' + esc(vers.n) + '</div><div class="et__big">tel qu’en l’' + an(A - vers.d) + '</div><div class="et__note">La lumière met ' + duree(vers.d) + ' pour arriver jusqu’à Terra.</div></div>';
|
||||
else { var r = trajet(de, vers, V.vaisseau, V.survol, A, V.mode === 'partir' ? 'dep' : 'arr'), dep = V.mode === 'partir' ? A : A - r.t;
|
||||
res = '<div class="et__res"><div class="et__h">' + esc(de.n) + ' → ' + esc(vers.n) + ' · ' + dist(r.d || distance(de, vers)) + (r.d && Math.abs(r.d - distance(de, vers)) > 0.005 ? ' <span style="font-weight:400;color:#9fb0dc">(là où elle sera à l’arrivée ; aujourd’hui ' + dist(distance(de, vers)) + ')</span>' : '') + '</div>' + resultat(r, dep, dep + r.t, distance(de, vers), vers) + '</div>'; } }
|
||||
corps = '<div class="et__row">' + (V.mode !== 'voir' ? '<label><span class="et__h">de</span>' + choixAstre('de', V.de) + '</label>' : '') + '<label><span class="et__h">' + (V.mode === 'voir' ? 'quoi' : 'vers') + '</span>' + choixAstre('vers', V.vers) + '</label></div>'
|
||||
+ '<div class="et__row" style="margin-top:8px"><label><span class="et__h">' + (V.mode === 'partir' ? 'année du départ' : V.mode === 'arriver' ? 'année d’arrivée voulue' : 'année') + '</span><input class="et__in" data-annee type="number" step="1" value="' + esc(V.annee) + '"></label></div>'
|
||||
+ (V.mode !== 'voir' ? '<p class="et__h" style="margin-top:10px">technologie</p>' + choixTech('vaisseau', V.vaisseau) + noteTech(v)
|
||||
+ (v.g ? '<div class="et__chips" style="margin-top:6px"><button class="et__c' + (V.survol ? ' on' : '') + '" data-survol>⊳ sonde : survol sans freiner</button></div>' : '') : '')
|
||||
+ res;
|
||||
}
|
||||
var plans = S.voyages.slice().sort(function (a, b) { return (a.cle || 0) - (b.cle || 0); });
|
||||
return '<datalist id="et-noms">' + ASTRES.map(function (o) { return '<option value="' + esc(o.n) + '">'; }).join('') + S.favs.filter(function (f) { return f.indexOf('h:') === 0; }).map(function (f) { return '<option value="' + esc(f.slice(2)) + '">'; }).join('')
|
||||
+ PLANETES.map(function (p) { return '<option value="' + esc(p[0].replace(' (Terre)', '')) + '">'; }).join('') + '</datalist>'
|
||||
+ '<div class="et__sec"><p class="et__h">⟶ planifier · calendrier de Terra</p>'
|
||||
+ '<div class="et__chips" style="margin-bottom:8px">' + [['jalons', '◇ jalons'], ['partir', 'partir en'], ['arriver', 'arriver en'], ['voir', 'voir en'], ['itin', '⋯ itinéraire'], ['stellaire', '☉ système solaire']].map(function (m) { return '<button class="et__c' + (V.mode === m[0] ? ' on' : '') + '" data-mode="' + m[0] + '">' + m[1] + '</button>'; }).join('') + '</div>'
|
||||
+ corps
|
||||
+ (V.mode !== 'stellaire' && V.mode !== 'jalons' ? '<input class="et__in" data-vnote placeholder="une note (pourquoi, avec qui…)" value="' + esc(V.note) + '" style="margin-top:10px"><div class="et__act"><button class="et__c on" data-noter>+ noter dans mon calendrier</button></div>' : '') + '</div>'
|
||||
+ '<div class="et__sec"><p class="et__h">mon calendrier interstellaire</p>' + (plans.length ? plans.map(function (p) {
|
||||
return '<div class="et__pv">' + (p.mode === 'voir' ? '◌ <b>' + an(p.cle) + '</b> · voir ' + esc(p.versN) + ' (lumière de l’' + an(p.cle - (p.dist || 0)) + ')'
|
||||
: p.mode === 'itin' ? '⋯ <b>' + an(p.depart) + '</b> → <b>' + an(p.arrivee) + '</b> · ' + esc((p.etapesN || []).join(' → ')) + ' · ' + dureeVol(p.arrivee - p.depart, p.tau)
|
||||
: '⟶ <b>' + an(p.depart) + '</b> → <b>' + an(p.arrivee) + '</b> · ' + esc(p.deN) + ' → ' + esc(p.versN) + ' en ' + esc(p.vaisseauN) + ' · ' + dureeVol(p.arrivee - p.depart, p.tau))
|
||||
+ (p.note ? '<div style="color:#9fb0dc;font-size:.74rem">' + esc(p.note) + '</div>' : '') + ' <button class="et__c" data-retirer="' + esc(p.id) + '" style="padding:1px 7px;margin-top:4px">✕</button></div>'; }).join('')
|
||||
: '<div class="et__vide" style="padding:4px 0">Rien de noté. Le calendrier de Terra sert d’horloge commune : chaque voyage y a un départ et une arrivée.</div>') + '</div>';
|
||||
}
|
||||
function vueCarte() {
|
||||
return '<div class="et__carte"><canvas></canvas><div class="et__echelle" data-echelle></div><div class="et__outils">'
|
||||
+ '<button class="et__c" data-zoom="soleil">☉ Soleil</button><button class="et__c" data-zoom="voisinage">voisinage</button><button class="et__c" data-zoom="bulle">1 000 al</button>'
|
||||
+ '<button class="et__c" data-zoom="galaxie">◎ la galaxie</button><button class="et__c" data-zoom="groupe">groupe local</button><button class="et__c" data-zoom="univers">univers</button>'
|
||||
+ '<button class="et__c" data-zoom="+">+</button><button class="et__c" data-zoom="-">−</button><button class="et__c' + (vue.d3 ? ' on' : '') + '" data-d3>' + (vue.d3 ? '◇ 3D' : '▭ 2D') + '</button></div></div>';
|
||||
}
|
||||
function vueFiche(o) {
|
||||
var ty = TYPES[o.t] || TYPES.etoile, p = lb(o), now = anNow(), kv = [];
|
||||
function k(a, b) { if (b != null && b !== '' && b !== '—') kv.push('<dt>' + a + '</dt><dd>' + b + '</dd>'); }
|
||||
k('type', ty[1] + (o.sp ? ' · ' + esc(o.sp) : '') + (o.t === 'etoile' && classeLum(o.sp) ? ' · ' + classeLum(o.sp) : ''));
|
||||
if (o.id !== 'soleil') { k('distance', dist(o.d) + (o.d < 1e6 ? ' · ' + nb(o.d / AL_PC, o.d < 100 ? 2 : 0) + ' pc' : ''));
|
||||
k('sa lumière', 'partie en l’' + an(now - o.d) + ', vue ce soir'); }
|
||||
if (o.t !== 'sonde' && o.id !== 'soleil') { k('constellation', esc(o.con || '')); k('position', 'α ' + nb(o.ra, 3) + ' h · δ ' + nb(o.de, 2) + '°'); k('galactique', 'l ' + nb(p.l, 1) + '° · b ' + nb(p.b, 1) + '°'); }
|
||||
k('au centre galactique', o.d < 2e5 || o.id === 'soleil' ? dist(Math.hypot(o.gx - R0, o.gy, o.gz)) : '');
|
||||
if (o.m != null) k('masse', grand(o.m) + ' M☉'); if (o.r != null) k('rayon', (o.r < 0.01 ? nb(o.r * 696000, 0) + ' km' : nb(o.r, o.r < 10 ? 2 : 0) + ' R☉'));
|
||||
if (o.T) k('température', nb(o.T) + ' K'); else if (o.cat && T_CLASSE[String(o.sp)[0]]) k('température', '~ ' + nb(T_CLASSE[String(o.sp)[0]]) + ' K (d’après la classe)');
|
||||
if (o.L != null) k('luminosité', grand(o.L) + ' L☉');
|
||||
if (o.mag != null) { k('magnitude', nb(o.mag, 2) + (o.mag < 6.5 ? ' · visible à l’œil nu' : ''));
|
||||
var M = o.mag - 5 * Math.log10(o.d / AL_PC / 10); k('magn. absolue', nb(M, 2) + ' · ~ ' + grand(Math.pow(10, (4.83 - M) / 2.5)) + ' L☉ (visible)'); }
|
||||
if (o.age) k('âge', esc(o.age));
|
||||
if (o.v) { var kms = Math.hypot(o.v[0], o.v[1], o.v[2]) * 299792.458, p7 = posA(o, 7000), p0 = posA(o, now), dr = (Math.hypot(p7[0], p7[1], p7[2]) - Math.hypot(p0[0], p0[1], p0[2])) / (7000 - now);
|
||||
k('vitesse', nb(kms, 0) + ' km/s par rapport au Soleil · ' + (dr < 0 ? 's’approche' : 's’éloigne') + ' de ' + nb(Math.abs(dr) * 299792.458, 1) + ' km/s');
|
||||
k('en l’an 7000', 'à ' + dist(Math.hypot(p7[0], p7[1], p7[2])) + ' de Terra ' + tag('MODÈLE')); }
|
||||
if (o.id !== 'soleil' && o.t !== 'sonde') { var vk = voyage(o.d, vaisseau('kion')), vc = voyage(o.d, vaisseau('cubion'));
|
||||
k('en space-kion', dureeVol(vk.t, vk.tau)); k('en space-cubion', dureeVol(vc.t, vc.tau)); }
|
||||
var pls = o.exo ? '<p class="et__h" style="margin-top:10px">◉ planètes (' + o.exo.length + ') ' + tag('RÉEL') + '</p><table class="et__pl"><tr><th>nom</th><th>masse</th><th>rayon</th><th>année</th><th>orbite</th><th>T</th><th>découverte</th></tr>'
|
||||
+ o.exo.map(function (x) { return '<tr><td>' + esc(x.n) + '</td><td>' + (x.me != null ? nb(x.me, x.me < 10 ? 2 : 0) + ' M⊕' : '—') + '</td><td>' + (x.re != null ? nb(x.re, 2) + ' R⊕' : '—') + '</td><td>' + (x.P == null ? '—' : x.P < 1000 ? nb(x.P, x.P < 10 ? 2 : 1) + ' j' : nb(x.P / 365.25, 1) + ' ans') + '</td><td>' + (x.a == null ? '—' : nb(x.a, x.a < 0.1 ? 3 : 2) + ' UA') + '</td><td>' + (x.teq ? nb(x.teq) + ' K' : '—') + '</td><td style="color:#9fb0dc">' + esc((x.an || '') + (x.meth ? ' · ' + x.meth : '')) + '</td></tr>'; }).join('')
|
||||
+ '</table><div class="et__leg">source : NASA Exoplanet Archive' + (X.exoDate() ? ' (copie du ' + esc(X.exoDate()) + ')' : '') + ', gardée par le xerboxion</div>'
|
||||
: o.pl ? '<p class="et__h" style="margin-top:10px">◉ planètes (' + o.pl.length + ')</p><table class="et__pl"><tr><th>nom</th><th>masse</th><th>année</th><th>orbite</th><th></th></tr>'
|
||||
+ o.pl.map(function (x) { return '<tr><td>' + esc(x[0]) + '</td><td>' + esc(x[1]) + '</td><td>' + (x[2] == null ? '—' : x[2] < 1000 ? nb(x[2], x[2] < 10 ? 2 : 1) + ' j' : nb(x[2] / 365.25, 1) + ' ans') + '</td><td>' + (x[3] == null ? '—' : nb(x[3], x[3] < 0.1 ? 3 : 2) + ' UA') + '</td><td style="color:#9fb0dc">' + esc(x[4] || '') + '</td></tr>'; }).join('') + '</table>' : '';
|
||||
var sv = SAVOIR[o.id], savoir = !sv ? '' : sv === 1 ? '<div class="et__savoir">chargement…</div>' : sv === 2 ? '<div class="et__savoir">rien trouvé sur cet astre (ou connecte-toi : le xerboxion va le chercher pour toi).</div>'
|
||||
: '<div class="et__savoir"><b>' + esc(sv.titre) + '</b><br>' + esc(sv.txt) + '<div class="et__leg">texte : Wikipédia (' + sv.lang + ', CC BY-SA), servi et gardé par le xerboxion</div></div>';
|
||||
return '<div class="et__fiche' + (ficheMini ? ' mini' : '') + '" role="dialog" aria-label="' + esc(o.n) + '"><h3><span style="color:' + couleur(o) + '">' + ty[0] + '</span>' + esc(o.n) + '<span style="margin-left:auto"></span><button class="et__x" data-mini aria-label="' + (ficheMini ? 'déplier' : 'réduire') + '">' + (ficheMini ? '▴' : '▾') + '</button><button class="et__x" data-fermer aria-label="fermer">✕</button></h3>'
|
||||
+ '<div class="et__alias">' + esc((o.a || []).join(' · ')) + '</div>' + (o.note ? '<div class="et__note">' + esc(o.note) + '</div>' : '')
|
||||
+ '<div class="et__vis">' + photo(o) + disque(o) + systeme(o) + '</div>'
|
||||
+ '<dl class="et__kv">' + kv.join('') + '</dl>' + pls
|
||||
+ (journalDe(o.id).length ? '<p class="et__h" style="margin-top:10px">✎ journal de bord</p>' + journalDe(o.id).map(entree).join('') : '')
|
||||
+ (function () { var cm = commun().filter(function (t) { return t.objet === o.id && !t.mien; }); return cm.length ? '<p class="et__h" style="margin-top:10px">◌ journal commun</p>' + cm.slice(0, 20).map(ligneCommun).join('') : ''; })() + savoir
|
||||
+ '<div class="et__act"><button class="et__c' + (estFav(o.id) ? ' on' : '') + '" data-fav="' + esc(o.id) + '">' + (estFav(o.id) ? '★ dans mes étoiles' : '☆ mes étoiles') + '</button>'
|
||||
+ '<button class="et__c" data-voircarte="' + esc(o.id) + '">◎ sur la carte</button>' + (o.id !== 'soleil' ? '<button class="et__c" data-yaller="' + esc(o.id) + '">⟶ y aller</button>' : '')
|
||||
+ '<button class="et__c" data-fdepuisfiche="' + esc(o.id) + '">✎ journal</button>' + ((o.t === 'trou-noir' || o.t === 'quasar') && o.m > 0 ? '<button class="et__c" data-trounoir="' + esc(o.id) + '">● trou noir : le frigo, le thermostat</button>' : '') + (sv ? '' : '<button class="et__c" data-savoir="' + esc(o.id) + '">≡ en savoir plus</button>') + '</div></div>';
|
||||
}
|
||||
|
||||
function rendre() {
|
||||
var corps = onglet === 'carte' ? vueCarte() : onglet === 'favs' ? vueFavs() : onglet === 'voyages' ? vueVoyages() : vueAstres();
|
||||
var actif = document.activeElement, focusQ = actif && actif.matches && actif.matches('[data-q]') ? actif.selectionStart : null;
|
||||
container.innerHTML = '<div class="et"><div class="et__top"><span style="font-size:1.2rem;color:#ffe7a3">✦</span><b>Étoiles</b><span class="et__terra">' + terra() + '</span></div>'
|
||||
+ '<div class="et__corps">' + corps + '</div>' + (fiche ? vueFiche(fiche) : '')
|
||||
+ '<nav class="et__dock">' + [['astres', '✦', 'astres'], ['carte', '◎', 'carte'], ['favs', '☆', 'mes étoiles'], ['voyages', '⟶', 'voyages']].map(function (t) { return '<button class="' + (onglet === t[0] ? 'on' : '') + '" data-onglet="' + t[0] + '"><span>' + t[1] + '</span>' + t[2] + '</button>'; }).join('') + '</nav></div>';
|
||||
if (focusQ != null) { var iq = container.querySelector('[data-q]'); if (iq) { iq.focus(); try { iq.setSelectionRange(focusQ, focusQ); } catch (e) {} } }
|
||||
if (onglet === 'carte') brancherCarte(); else { cv = null; if (ro) { ro.disconnect(); ro = null; } }
|
||||
}
|
||||
|
||||
// ── la carte (canvas, rendu à la demande) ──
|
||||
function brancherCarte() {
|
||||
cv = container.querySelector('.et__carte canvas'); if (!cv) return; gx = cv.getContext('2d');
|
||||
if (window.ResizeObserver) { if (ro) ro.disconnect(); ro = new ResizeObserver(function () { dessiner(); }); ro.observe(cv); }
|
||||
cv.addEventListener('pointerdown', function (e) { cv.setPointerCapture(e.pointerId); ptrs[e.pointerId] = [e.offsetX, e.offsetY]; glisse = { x: e.offsetX, y: e.offsetY, cx: vue.cx, cy: vue.cy, yaw: vue.yaw, pitch: vue.pitch, bouge: 0 }; });
|
||||
cv.addEventListener('pointermove', function (e) { if (!ptrs[e.pointerId]) return; var ids = Object.keys(ptrs);
|
||||
if (ids.length === 2) { var o = ptrs[ids[0]], p = ptrs[ids[1]], d0 = Math.hypot(o[0] - p[0], o[1] - p[1]); ptrs[e.pointerId] = [e.offsetX, e.offsetY];
|
||||
o = ptrs[ids[0]]; p = ptrs[ids[1]]; var d1 = Math.hypot(o[0] - p[0], o[1] - p[1]); if (d0 > 0 && d1 > 0) zoomEn((o[0] + p[0]) / 2, (o[1] + p[1]) / 2, d0 / d1); if (glisse) glisse.bouge = 99; return; }
|
||||
ptrs[e.pointerId] = [e.offsetX, e.offsetY]; if (!glisse) return;
|
||||
var dx = e.offsetX - glisse.x, dy = e.offsetY - glisse.y; glisse.bouge = Math.max(glisse.bouge, Math.abs(dx) + Math.abs(dy));
|
||||
if (vue.d3) { vue.yaw = glisse.yaw + dx * 0.008; vue.pitch = Math.max(0, Math.min(1.55, glisse.pitch + dy * 0.006)); }
|
||||
else { vue.cx = glisse.cx - dx * vue.s; vue.cy = glisse.cy - dy * vue.s; } planifier(); });
|
||||
function fin(e) { var g = glisse; delete ptrs[e.pointerId]; if (Object.keys(ptrs).length === 0) { glisse = null; if (g && g.bouge < 6 && e.type === 'pointerup') toucher(e.offsetX, e.offsetY); } }
|
||||
cv.addEventListener('pointerup', fin); cv.addEventListener('pointercancel', fin);
|
||||
cv.addEventListener('wheel', function (e) { e.preventDefault(); zoomEn(e.offsetX, e.offsetY, Math.exp(e.deltaY * 0.0015)); }, { passive: false });
|
||||
catalogue().then(function () { planifier(); });
|
||||
dessiner();
|
||||
}
|
||||
function zoomEn(px, py, f) { if (vue.d3) { vue.s = Math.min(1e8, Math.max(0.002, vue.s * f)); planifier(); return; } var W = cv.clientWidth, H = cv.clientHeight, mx = vue.cx + (px - W / 2) * vue.s, my = vue.cy + (py - H / 2) * vue.s;
|
||||
vue.s = Math.min(1e8, Math.max(0.002, vue.s * f)); vue.cx = mx - (px - W / 2) * vue.s; vue.cy = my - (py - H / 2) * vue.s; planifier(); }
|
||||
function planifier() { if (raf) return; raf = requestAnimationFrame(function () { raf = 0; dessiner(); }); }
|
||||
var VISIBLES = [];
|
||||
function dessiner() {
|
||||
if (!cv || !cv.isConnected) return; var dpr = Math.min(2, window.devicePixelRatio || 1), W = cv.clientWidth, H = cv.clientHeight; if (!W || !H) return;
|
||||
if (cv.width !== Math.round(W * dpr) || cv.height !== Math.round(H * dpr)) { cv.width = Math.round(W * dpr); cv.height = Math.round(H * dpr); }
|
||||
var g = gx; g.setTransform(dpr, 0, 0, dpr, 0, 0); g.fillStyle = '#05070d'; g.fillRect(0, 0, W, H);
|
||||
var s = vue.s, cyw = Math.cos(vue.yaw), syw = Math.sin(vue.yaw), cpt = Math.cos(vue.pitch), spt = Math.sin(vue.pitch);
|
||||
function P(mx, my, mz) { var dx = mx - vue.cx, dy = my - vue.cy, x1 = dx * cyw - dy * syw, y1 = dx * syw + dy * cyw; return [W / 2 + x1 / s, H / 2 + (y1 * cpt - (mz || 0) * spt) / s]; }
|
||||
// la Voie lactée MODÈLE (bion jOSGalaxie, partagé avec carte-espace), en 2D comme en 3D
|
||||
if (s > 8) window.jOSGalaxie.dessiner(g, P, s, W, H, { incl: cpt, labels: s > 30 && s < 600 });
|
||||
var occ = {}; function libre(px, py, w) { var c0 = Math.floor(px / 70), r = Math.floor(py / 14), c1 = Math.floor((px + w) / 70); for (var c = c0; c <= c1; c++) if (occ[c + ':' + r]) return false; for (c = c0; c <= c1; c++) occ[c + ':' + r] = 1; return true; }
|
||||
VISIBLES = [];
|
||||
// le catalogue : les étoiles à l'œil nu, quand on est assez près
|
||||
if (X.hyg() && s < 40) { g.font = '10px ui-sans-serif,system-ui';
|
||||
X.hyg().forEach(function (o) { var q = P(o.mx, o.my, o.gz), px = q[0], py = q[1]; if (px < -4 || py < -4 || px > W + 4 || py > H + 4) return;
|
||||
var rr = Math.max(0.7, Math.min(2.6, 2.2 - o.mag * 0.3)); g.fillStyle = couleur(o); g.globalAlpha = 0.85; g.beginPath(); g.arc(px, py, rr, 0, 7); g.fill(); g.globalAlpha = 1;
|
||||
VISIBLES.push([px, py, o]);
|
||||
if ((o.mag < 1.6 || s < 0.15 || estFav(o.id)) && libre(px + 4, py - 6, o.n.length * 6)) { g.fillStyle = estFav(o.id) ? '#ffd76a' : 'rgba(200,212,240,.65)'; g.fillText(o.n, px + 4, py + 3); } }); }
|
||||
// les systèmes d'exoplanètes hors catalogue (hôtes de la NASA Exoplanet Archive)
|
||||
if (X.exo().length && s < 40) { g.fillStyle = 'rgba(143,240,201,.7)'; X.exo().forEach(function (o) { var q = P(o.mx, o.my, o.gz); if (q[0] < -4 || q[1] < -4 || q[0] > W + 4 || q[1] > H + 4) return; g.fillRect(q[0] - 1, q[1] - 1, 2, 2); VISIBLES.push([q[0], q[1], o]); }); }
|
||||
// les voyages notés : la route
|
||||
g.setLineDash([4, 4]); g.strokeStyle = 'rgba(95,224,192,.55)'; g.lineWidth = 1.2;
|
||||
S.voyages.forEach(function (p) { if (p.mode === 'voir') return; var ids = p.etapes ? p.etapes.map(function (x) { return x.id; }) : [p.de, p.vers], pts = ids.map(get).filter(Boolean); if (pts.length < 2) return;
|
||||
g.beginPath(); pts.forEach(function (o, i) { var q = P(o.mx, o.my, o.gz); if (i) g.lineTo(q[0], q[1]); else g.moveTo(q[0], q[1]); }); g.stroke(); });
|
||||
g.setLineDash([]);
|
||||
// les jalons : la route du plan (or), chaque étoile à sa position à la date du jalon
|
||||
var PJ = planJalons(S.jalons, 'kion').l.filter(function (e) { return e.L && !e.j.anT; }); // un jalon profond n'a pas de position sur la carte
|
||||
if (PJ.length > 1) { g.setLineDash([6, 4]); g.strokeStyle = 'rgba(255,215,106,.7)'; g.lineWidth = 1.4; g.beginPath();
|
||||
PJ.forEach(function (e, i) { var gg = gal(posA(e.L.star, e.j.an)), q = P(-gg[1], R0 - gg[0], gg[2]); if (i) g.lineTo(q[0], q[1]); else g.moveTo(q[0], q[1]); }); g.stroke(); g.setLineDash([]); }
|
||||
// les plans publiés par les autres (journal commun), en violet
|
||||
commun().forEach(function (t) { if (t.type !== 'plan' || t.mien || !t.jalons || t.jalons.length < 2) return; g.setLineDash([3, 5]); g.strokeStyle = 'rgba(199,155,255,.6)'; g.lineWidth = 1; g.beginPath();
|
||||
t.jalons.forEach(function (j, i) { var pz = j.pos || (get(j.lieu) ? posA(get(j.lieu), j.an) : [0, 0, 0]), gg = gal(pz), q = P(-gg[1], R0 - gg[0], gg[2]); if (i) g.lineTo(q[0], q[1]); else g.moveTo(q[0], q[1]); });
|
||||
g.stroke(); g.setLineDash([]); });
|
||||
// les marqueurs d'un hôte (jOSAstres.marqueurs = [{pos:[x,y,z] équatorial al, n, c}]) : le vaisseau de space-nav
|
||||
(window.jOSAstres.marqueurs || []).forEach(function (m) { var gg = gal(m.pos), q = P(-gg[1], R0 - gg[0], gg[2]); g.fillStyle = m.c || '#5fe0c0'; g.font = 'bold 15px ui-sans-serif,system-ui'; g.textAlign = 'center'; g.textBaseline = 'middle'; g.fillText('⊳', q[0], q[1]); g.textAlign = 'left';
|
||||
g.font = '11px ui-sans-serif,system-ui'; g.fillText(m.n || '', q[0] + 10, q[1]); g.textBaseline = 'alphabetic'; });
|
||||
// le recueil : glyphe par type
|
||||
var ordre = ASTRES.slice().sort(function (a, b) { return (estFav(b.id) ? 1 : 0) - (estFav(a.id) ? 1 : 0) || a.d - b.d; });
|
||||
g.textBaseline = 'middle';
|
||||
ordre.forEach(function (o) { var q = P(o.mx, o.my, o.gz), px = q[0], py = q[1]; if (px < -20 || py < -20 || px > W + 20 || py > H + 20) return; var ty = TYPES[o.t] || TYPES.etoile, sel = fiche && fiche.id === o.id;
|
||||
g.font = (sel ? 'bold 16px' : '13px') + ' ui-sans-serif,system-ui'; g.fillStyle = o.t === 'etoile' ? couleur(o) : ty[2]; g.textAlign = 'center'; g.fillText(o.id === 'soleil' ? '☉' : ty[0], px, py); g.textAlign = 'left';
|
||||
VISIBLES.push([px, py, o]);
|
||||
if (sel) { g.strokeStyle = '#5fe0c0'; g.lineWidth = 1.5; g.beginPath(); g.arc(px, py, 11, 0, 7); g.stroke(); }
|
||||
g.font = '11px ui-sans-serif,system-ui';
|
||||
if (sel || estFav(o.id) ? libre(px + 9, py - 6, o.n.length * 6.2) || true : libre(px + 9, py - 6, o.n.length * 6.2)) { g.fillStyle = estFav(o.id) ? '#ffd76a' : sel ? '#e8fff8' : 'rgba(220,230,255,.8)'; g.fillText(o.n, px + 9, py); } });
|
||||
g.textBaseline = 'alphabetic';
|
||||
// l'échelle
|
||||
var cible = 110 * s, p10 = Math.pow(10, Math.floor(Math.log10(cible))), pas = [1, 2, 5, 10].map(function (m) { return m * p10; }).filter(function (v) { return v <= cible; }).pop() || p10, lpx = pas / s;
|
||||
g.strokeStyle = '#8ea2cc'; g.lineWidth = 1; g.beginPath(); g.moveTo(10, H - 52); g.lineTo(10 + lpx, H - 52); g.stroke();
|
||||
g.fillStyle = '#8ea2cc'; g.font = '11px ui-sans-serif,system-ui'; g.fillText(dist(pas), 10, H - 58);
|
||||
var ech = container.querySelector('[data-echelle]'); if (ech) ech.textContent = (vue.d3 ? '3D · glisse pour tourner' : 'vue de dessus du disque · centre galactique en haut') + ' · ' + (s < 40 ? (X.hyg() ? nb(X.hyg().length) + ' étoiles du catalogue (réel)' : 'catalogue…') : 'galaxie : MODÈLE (aucune photo de dessus n’existe), astres : réel');
|
||||
}
|
||||
function toucher(px, py) { var best = null, bd = 18; VISIBLES.forEach(function (v) { var d = Math.hypot(v[0] - px, v[1] - py); if (d < bd) { bd = d; best = v[2]; } });
|
||||
fiche = canon(best); ficheMini = false; rendre(); }
|
||||
function centrer(o) { poser(o); vue.cx = o.mx; vue.cy = o.my; vue.s = o.id === 'soleil' ? 0.25 : o.t === 'galaxie' || o.t === 'quasar' || o.d > 2e5 ? Math.max(500, o.d / 300) : Math.max(0.08, Math.min(200, o.d / 250)); }
|
||||
var ZOOMS = { soleil: [0, R0, 0.25], voisinage: [0, R0, 0.08], bulle: [0, R0, 6], galaxie: [0, 0, 160], groupe: [0, 0, 12000], univers: [0, 0, 1e8 * 0.9] };
|
||||
|
||||
container.addEventListener('click', function (e) { var t = e.target, b;
|
||||
if ((b = t.closest('[data-onglet]'))) { onglet = b.getAttribute('data-onglet'); if (onglet === 'voyages') chargerVisions(); ecrire(K + ':onglet', onglet); fiche = null; rendre(); if (onglet !== 'carte') catalogue().then(function () { if (onglet === 'favs' || q) rendre(); }); return; }
|
||||
if ((b = t.closest('[data-fiche]'))) { fiche = canon(get(b.getAttribute('data-fiche'))); ficheMini = false; rendre(); return; }
|
||||
if (t.closest('[data-mini]')) { ficheMini = !ficheMini; rendre(); return; }
|
||||
if (fiche && ficheMini && t.closest('.et__fiche h3')) { ficheMini = false; rendre(); return; }
|
||||
if (t.closest('[data-fermer]')) { fiche = null; rendre(); return; }
|
||||
if ((b = t.closest('[data-filtre]'))) { filtre = b.getAttribute('data-filtre'); rendre(); return; }
|
||||
if ((b = t.closest('[data-fav]'))) { basculerFav(b.getAttribute('data-fav')); rendre(); return; }
|
||||
if ((b = t.closest('[data-voircarte]'))) { var o = get(b.getAttribute('data-voircarte')); if (o) { centrer(o); fiche = o; ficheMini = container.clientWidth < 760; onglet = 'carte'; rendre(); } return; }
|
||||
if ((b = t.closest('[data-yaller]'))) { V.vers = b.getAttribute('data-yaller'); if (V.mode === 'voir') V.mode = 'partir'; fiche = null; onglet = 'voyages'; rendre(); return; }
|
||||
if ((b = t.closest('[data-zoom]'))) { var z = b.getAttribute('data-zoom');
|
||||
if (z === '+' || z === '-') { if (cv) zoomEn(cv.clientWidth / 2, cv.clientHeight / 2, z === '+' ? 0.5 : 2); return; }
|
||||
var Z = ZOOMS[z]; if (Z) { vue.cx = Z[0]; vue.cy = Z[1]; vue.s = Z[2]; dessiner(); } return; }
|
||||
if ((b = t.closest('[data-fsel]'))) { var fs = b.getAttribute('data-fsel'), fi = favSel.indexOf(fs); if (fi >= 0) favSel.splice(fi, 1); else favSel.push(fs); rendre(); return; }
|
||||
if (t.closest('[data-fdesel]')) { favSel = []; rendre(); return; }
|
||||
if (t.closest('[data-fitin]')) { V.etapes = [{ id: 'soleil' }].concat(favSel.map(function (id) { return { id: id, tech: V.vaisseau || 'kion', escale: 0 }; })); V.mode = 'itin'; onglet = 'voyages'; ecrire(K + ':onglet', onglet); fiche = null; rendre(); return; }
|
||||
if ((b = t.closest('[data-fform]'))) { var ff = b.getAttribute('data-fform').split('|'); form = form && form.id === ff[0] && form.k === ff[1] ? null : { id: ff[0], k: ff[1] }; rendre(); return; }
|
||||
if (t.closest('[data-fannule]')) { form = null; rendre(); return; }
|
||||
if ((b = t.closest('[data-trounoir]'))) { try { localStorage.setItem('xb:trou-noir:cible', b.getAttribute('data-trounoir')); } catch (x) {} var idp = 'trou-noir';
|
||||
try { if (window.jOSOp && jOSOp.openPloxion) { var rr = jOSOp.openPloxion(idp); if (rr && rr.ok) return; } } catch (x) {} try { if (window.jOSMobile && jOSMobile.open && jOSMobile.open(idp, idp)) return; } catch (x) {}
|
||||
try { if (window.jOS && jOS.openPloxion && jOS.openPloxion(idp)) return; } catch (x) {} location.href = '/local#px=' + idp; return; }
|
||||
if ((b = t.closest('[data-fdepuisfiche]'))) { form = { id: b.getAttribute('data-fdepuisfiche'), k: 'log' }; fiche = null; onglet = 'favs'; ecrire(K + ':onglet', onglet); rendre(); return; }
|
||||
if (t.closest('[data-fok]') && form) { var v0 = function (sel) { var e0 = container.querySelector(sel); return e0 ? e0.value : ''; }, anF = Math.round(+v0('[data-ff-an]') || anNow());
|
||||
if (form.k === 'jalon') ajouterJalon(form.id, anF, v0('[data-ff-txt]'));
|
||||
else { var en = { id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6), astre: form.id, type: form.k, an: anF, texte: v0('[data-ff-txt]').slice(0, 1000), cree: Date.now() };
|
||||
if (form.k === 'decouverte') { en.nom = v0('[data-ff-nom]').slice(0, 80) || ((get(form.id) || {}).n || '?') + ' ?'; en.sorte = v0('[data-ff-sorte]') || 'planète'; var aa = +v0('[data-ff-a]'); if (aa > 0) en.a = Math.min(1e6, aa); }
|
||||
S.journal.push(en); sauver(); try { window.jOSPorts && jOSPorts.emit('etoiles', 'journal', { astre: (get(form.id) || {}).n, type: en.type, an: en.an }); } catch (x) {} }
|
||||
form = null; rendre(); return; }
|
||||
if ((b = t.closest('[data-lpub]')) && window.jOSJournal) { var lp = S.journal.filter(function (l) { return l.id === b.getAttribute('data-lpub'); })[0]; if (!lp) return; b.disabled = true; b.textContent = '…';
|
||||
var ob = get(lp.astre) || {}; jOSJournal.publier({ type: lp.type, vaisseau: S.vaisseauNom, objet: lp.astre, objet_n: ob.n || lp.astre, an: lp.an, texte: lp.texte || null, nom: lp.nom || null, sorte: lp.sorte || null, a: lp.a || null, emis_pos: [0, 0, 0] })
|
||||
.then(function (tz) { lp.pub = tz.id; sauver(); rendre(); }).catch(function (er) { b.disabled = false; b.textContent = '⇪'; b.title = 'échec : ' + er.message + ' (connecté ?)'; b.style.borderColor = '#ff9b6a'; }); return; }
|
||||
if ((b = t.closest('[data-jpub]')) && window.jOSJournal) { var Pz = planJalons(S.jalons, V.vaisseau).l.filter(function (e) { return e.L; }); if (Pz.length < 1) return; b.disabled = true; b.textContent = '⇪ publication…';
|
||||
jOSJournal.publier({ type: 'plan', vaisseau: S.vaisseauNom, an: Pz[0].j.an, emis_pos: [0, 0, 0], texte: (vaisseau(V.vaisseau) || {}).n || null,
|
||||
jalons: Pz.map(function (e) { var pz = posA(e.L.star, e.j.an); return { lieu: e.j.lieu, lieu_n: e.L.n, an: e.j.an, pos: [+pz[0].toFixed(6), +pz[1].toFixed(6), +pz[2].toFixed(6)] }; }) })
|
||||
.then(function () { b.textContent = '✓ plan publié'; }).catch(function (er) { b.disabled = false; b.textContent = '✗ ' + er.message + ' (connecté ?)'; }); return; }
|
||||
if ((b = t.closest('[data-lsuppr]'))) { var ls = b.getAttribute('data-lsuppr'); S.journal = S.journal.filter(function (l) { return l.id !== ls; }); S.retires.push('l:' + ls); sauver(); rendre(); return; }
|
||||
if (t.closest('[data-d3]')) { vue.d3 = !vue.d3; vue.yaw = 0; vue.pitch = vue.d3 ? 1.05 : 0; rendre(); return; }
|
||||
if ((b = t.closest('[data-savoir]'))) { enSavoirPlus(get(b.getAttribute('data-savoir'))); return; }
|
||||
if (t.closest('[data-jexemple]')) { [['pl:2', 2077, 'départ de Terra'], ['pl:8', 2120, 'Pluton'], ['vega', 7000, 'être sur Véga'], ['pl:2', 7077, 'retour : se resynchroniser avec le xerboxion de Terra']].forEach(function (x) { ajouterJalon(x[0], x[1], x[2]); }); rendre(); return; }
|
||||
if (t.closest('[data-jajout]')) { var il = container.querySelector('[data-jlieu]'), ia = container.querySelector('[data-jannee]'), inn = container.querySelector('[data-jnote]'), li = il && chercherLieu(il.value);
|
||||
if (!li) { if (il) { il.focus(); il.style.borderColor = '#ff9b6a'; } return; } ajouterJalon(li, lireAn(ia && ia.value, Math.floor(anNow())), inn ? inn.value : ''); rendre(); return; }
|
||||
if ((b = t.closest('[data-jsuppr]'))) { var jd = b.getAttribute('data-jsuppr'); S.jalons = S.jalons.filter(function (j) { return j.id !== jd; }); S.retires.push('j:' + jd); sauver(); rendre(); return; }
|
||||
if ((b = t.closest('[data-mode]'))) { V.mode = b.getAttribute('data-mode'); rendre(); return; }
|
||||
if ((b = t.closest('[data-vaisseau]'))) { V.vaisseau = b.getAttribute('data-vaisseau'); V.survol = !!vaisseau(V.vaisseau).survol; rendre(); return; }
|
||||
if (t.closest('[data-survol]')) { V.survol = !V.survol; rendre(); return; }
|
||||
if ((b = t.closest('[data-etsuppr]'))) { V.etapes.splice(+b.getAttribute('data-etsuppr'), 1); rendre(); return; }
|
||||
if (t.closest('[data-noter]')) { var A = +V.annee || Math.floor(anNow()), nid = Date.now().toString(36) + Math.random().toString(36).slice(2, 6), p;
|
||||
if (V.mode === 'itin') { var ets = V.etapes.map(function (x) { return Object.assign({}, x, { o: get(x.id) }); }).filter(function (x) { return x.o; }); if (ets.length < 2) return;
|
||||
var tt = A, ta = 0; ets.forEach(function (x, i) { if (i) { var r0 = trajet(ets[i - 1].o, x.o, x.tech, undefined, tt); tt += r0.t; ta += r0.tau; } if (x.escale) { tt += +x.escale; ta += +x.escale; } });
|
||||
p = { id: nid, mode: 'itin', etapes: ets.map(function (x) { return { id: x.id, tech: x.tech, escale: x.escale || 0 }; }), etapesN: ets.map(function (x) { return x.o.n; }), versN: ets[ets.length - 1].o.n, depart: A, arrivee: tt, tau: ta, cle: A, de: ets[0].id, vers: ets[ets.length - 1].id, note: V.note.slice(0, 300), cree: Date.now() };
|
||||
} else { var de = get(V.de), vers = get(V.vers); if (!vers || (V.mode !== 'voir' && !de)) return;
|
||||
p = { id: nid, mode: V.mode, de: V.de, vers: V.vers, deN: de ? de.n : '', versN: vers.n, note: V.note.slice(0, 300), cree: Date.now() };
|
||||
if (V.mode === 'voir') { p.cle = A; p.dist = vers.d; }
|
||||
else { var v = vaisseau(V.vaisseau), r = trajet(de, vers, V.vaisseau, V.survol, A, V.mode === 'partir' ? 'dep' : 'arr'); p.vaisseau = v.id; p.vaisseauN = v.n + (V.survol && v.g ? ' (survol)' : ''); p.tau = r.tau; p.depart = V.mode === 'partir' ? A : A - r.t; p.arrivee = p.depart + r.t; p.cle = p.depart; } }
|
||||
var vers = get(p.vers) || { n: p.versN };
|
||||
S.voyages.push(p); V.note = ''; sauver(); try { window.jOSPorts && jOSPorts.emit('etoiles', 'voyage', { vers: vers.n, an: p.cle }); } catch (x) {} rendre(); return; }
|
||||
if ((b = t.closest('[data-retirer]'))) { var id = b.getAttribute('data-retirer'); S.voyages = S.voyages.filter(function (v) { return v.id !== id; }); S.retires.push('v:' + id); sauver(); rendre(); return; }
|
||||
});
|
||||
var tq = 0;
|
||||
container.addEventListener('input', function (e) { var t = e.target;
|
||||
if (t.matches('[data-q]')) { q = t.value.slice(0, 80); clearTimeout(tq); tq = setTimeout(function () { if (!X.hyg()) catalogue().then(rendre); rendre(); }, 120); return; }
|
||||
if (t.matches('[data-annee]')) { V.annee = Math.max(-1e10, Math.min(1e10, Math.round(+t.value || 0))); return; }
|
||||
if (t.matches('[data-vnote]')) { V.note = t.value; return; }
|
||||
if (t.matches('[data-vnom]')) { S.vaisseauNom = (t.value || '').slice(0, 40) || S.vaisseauNom; ecrire(K, S); return; }
|
||||
if (t.matches('[data-pg]')) { S.perso.g = Math.max(0.001, Math.min(100, +t.value || 1)); ecrire(K, S); return; }
|
||||
if (t.matches('[data-pb]')) { S.perso.b = Math.max(0, Math.min(0.999999, +t.value || 0)); ecrire(K, S); return; }
|
||||
});
|
||||
container.addEventListener('change', function (e) { var t = e.target;
|
||||
if (t.matches('[data-de],[data-vers],[data-ventree],[data-vsortie],[data-etape]')) { var r = chercher(t.value, 1)[0];
|
||||
if (r) { if (t.matches('[data-de]')) V.de = r.id; else if (t.matches('[data-vers]')) V.vers = r.id; else if (t.matches('[data-ventree]')) V.verE = r.id; else if (t.matches('[data-vsortie]')) V.verS = r.id;
|
||||
else V.etapes.push({ id: r.id, tech: (V.etapes[V.etapes.length - 1] || {}).tech || 'kion', escale: 0 }); } rendre(); return; }
|
||||
if (t.matches('[data-escale]')) { var ei = V.etapes[+t.getAttribute('data-escale')]; if (ei) ei.escale = Math.max(0, Math.min(1e9, +t.value || 0)); rendre(); return; }
|
||||
if (t.matches('[data-etech]')) { var ej = V.etapes[+t.getAttribute('data-etech')]; if (ej) ej.tech = t.value; rendre(); return; }
|
||||
if (t.matches('[data-jan]')) { var jo = S.jalons.filter(function (j) { return j.id === t.getAttribute('data-jan'); })[0];
|
||||
if (jo) { S.jalons = S.jalons.filter(function (j) { return j !== jo; }); S.retires.push('j:' + jo.id); ajouterJalon(jo.lieu, lireAn(t.value, jo.anT || jo.an), jo.note); } rendre(); return; }
|
||||
if (t.matches('[data-p1],[data-p2]')) { V[t.matches('[data-p1]') ? 'p1' : 'p2'] = +t.value; rendre(); return; }
|
||||
if (t.matches('[data-vnom]')) { sauver(); return; }
|
||||
if (t.matches('[data-annee],[data-pg],[data-pb]')) { if (t.matches('[data-pg],[data-pb]')) sauver(); rendre(); }
|
||||
});
|
||||
|
||||
// (03.11, braindump convergence §4.5 : « un jalon en 10^67 ou en 10^(10^122) est impossible ») un jalon PROFOND : au-delà de 10^10 ans,
|
||||
// l'année est une tour jOSHyper (j.anT = {h,x}, « an 10^67 », « an 10^10^122 ») ; j.an reste borné pour l'arithmétique du planificateur,
|
||||
// qui ne trace aucun trajet vers lui (la physique du voyage n'a plus de sens là-bas). Les anciens jalons ne changent pas.
|
||||
function ajouterJalon(l, a, note) { var H = window.jOSHyper, prof = !!(a && typeof a === 'object') || Math.abs(+a) > 1e10;
|
||||
var j = { id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6), lieu: l, an: prof ? 1e10 : Math.max(-1e10, Math.min(1e10, Math.round(+a))), note: String(note || '').slice(0, 300) };
|
||||
if (prof && H) { var T = H.lire(a); if (H.cmp(T, 0) < 0) { j.an = -1e10; } else j.anT = H.json(T); }
|
||||
S.jalons.push(j); sauver(); try { window.jOSPorts && jOSPorts.emit('etoiles', 'jalon', { lieu: (lieu(l) || {}).n, an: j.an, anT: j.anT || null }); } catch (x) {} }
|
||||
// une année tapée : « 2077 », « -500 », « 1e67 », « 10^67 », « 10^10^122 » (virgule ou point)
|
||||
function lireAn(v, defaut) { var s = String(v == null ? '' : v).replace(/\s/g, '').replace(/,/g, '.'); if (!s) return defaut; var H = window.jOSHyper;
|
||||
if (/^(10\^)+-?\d+(\.\d+)?$/.test(s) && H) { var p = s.split('^'); return H.json(H.T(p.length - 1, +p[p.length - 1])); }
|
||||
var n = +s; return isFinite(n) ? n : defaut; }
|
||||
function anJ(j) { return j && j.anT && window.jOSHyper ? 'an ' + jOSHyper.fmt(j.anT) : an(j.an); }
|
||||
// « en savoir plus » reste dans la fiche : le résumé passe par le xerboxion (proxy + cache), jamais un lien sortant
|
||||
function enSavoirPlus(o) { if (!o) return; SAVOIR[o.id] = 1; rendre();
|
||||
var noms = o.wiki ? [o.wiki] : [o.n].concat(o.a || []).slice(0, 3), essais = [], suff = { fr: ' (étoile)', en: ' (star)' };
|
||||
['fr', 'en'].forEach(function (lg) { noms.forEach(function (n) { if (o.t === 'etoile' && o.id !== 'soleil') essais.push([lg, n + suff[lg]]); essais.push([lg, n]); }); });
|
||||
var ASTRO = /étoile|star|constellation|naine|géante|giant|dwarf|pulsar|magn[ée]tar|trou noir|black hole|n[ée]buleuse|nebula|galax|amas|cluster|quasar|supernova|exoplan|planète|planet|sonde|probe|astre|astronom/i;
|
||||
(function suivant(i) { if (i >= essais.length) { SAVOIR[o.id] = 2; if (fiche === o) rendre(); return; }
|
||||
fetch(apiUrl('wikipedia-' + essais[i][0], 'page/summary/' + encodeURIComponent(String(essais[i][1]).replace(/ /g, '_')), {}).replace(/\?$/, ''), { credentials: 'same-origin', headers: { Accept: 'application/json' } })
|
||||
.then(function (r) { return r.ok ? r.json() : null; }).catch(function () { return null; })
|
||||
.then(function (d) { if (d && d.type === 'standard' && d.extract && ASTRO.test((d.description || '') + ' ' + d.extract.slice(0, 300))) { SAVOIR[o.id] = { titre: d.title, txt: d.extract, lang: essais[i][0] }; if (fiche === o) rendre(); } else suivant(i + 1); }); })(0); }
|
||||
container.addEventListener('error', function (e) { var im = e.target; if (im && im.matches && im.matches('img[data-photo]')) { var f = im.closest('figure');
|
||||
if (f) f.innerHTML = '<div class="et__leg" style="padding:10px;border:1px dashed #233157;border-radius:10px">photo indisponible (connecte-toi : le xerboxion va la chercher une fois et la garde).</div>'; } }, true);
|
||||
function chargerVisions() { SC.visions().then(function (l) { var n = VISIONS.length; VISIONS = l.filter(function (w) { return w && w.nom && w.config; }); if (VISIONS.length !== n && onglet === 'voyages') rendre(); }); }
|
||||
if (onglet === 'voyages') chargerVisions();
|
||||
rendre();
|
||||
catalogue().then(function () { if (onglet !== 'carte' && (q || onglet === 'favs' || onglet === 'astres')) rendre(); });
|
||||
exoplanetes().then(function () { if (onglet === 'carte') planifier(); else if (!document.activeElement || !document.activeElement.matches || !document.activeElement.matches('input,select,textarea')) rendre(); });
|
||||
try { if (window.jOSBoxion && jOSBoxion.authed && jOSBoxion.authed() && jOSBoxion.load) Promise.resolve(jOSBoxion.load('etoiles', 'etat')).then(function (it) { if (it && it.data) { fusion(it.data); ecrire(K, S); rendre(); } }).catch(function () {}); } catch (e) {}
|
||||
function surRedessin() { if (onglet === 'carte') planifier(); }
|
||||
function surJournal() { if (onglet === 'carte') planifier(); else if ((onglet === 'favs' || fiche) && !(document.activeElement && document.activeElement.matches && document.activeElement.matches('input,select,textarea'))) rendre(); }
|
||||
window.addEventListener('xb:journal', surJournal);
|
||||
try { if (window.jOSJournal) jOSJournal.lire(); } catch (e) {}
|
||||
window.addEventListener('xb:etoiles:redessiner', surRedessin);
|
||||
return { redessiner: surRedessin, unmount: function () { window.removeEventListener('xb:etoiles:redessiner', surRedessin); window.removeEventListener('xb:journal', surJournal); if (ro) ro.disconnect(); if (raf) cancelAnimationFrame(raf); container.innerHTML = ''; } };
|
||||
}
|
||||
window.jOSApps = window.jOSApps || {};
|
||||
window.jOSApps['etoiles'] = { manifest: { id: 'etoiles', name: 'Étoiles', icon: '✦' }, mount: mount, describe: describe };
|
||||
})();
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user