@johnmorrisdotca/wakusei-planets 0.73.0 → 0.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.74.0] - 2026-11-20
6
+
7
+ - **Every moon, by group** (MODULES-1723). `groups.html` puts a giant planet on top and every moon of the catalogue below it, in the families `moonFamilies` already uses, numbered in that order. A moon the package draws in full keeps that picture. The rest are the estimated rocks, pulled back so a turned rock stays inside its tile, named with the star those rocks already carry (`Himalia*`), and the page shows that star's one legend line. Jupiter's globe is clipped to a circle. English and Japanese.
8
+
9
+ - **All the moons** (MODULES-1724). `all.html` lists Mercury through Pluto with the moon catalogue's count for each, and draws a few of that world's moons. The rest are a number, never a picture the package does not have. Kerberos and Styx are the estimated rocks. Saturn, which has the most, is marked. English and Japanese.
10
+
11
+
12
+ - **Who has the most moons** (MODULES-1725). `counts.html` on the demo draws Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto, each already painted, with the count of moons `moonCounts()` gives that host (a host the catalogue does not list shows none). The planet with the highest count is marked. Jupiter, Saturn, Uranus and Neptune are zoomed so the globe fills the tile and the rings run to its edge, where the tile crops them. Jupiter's globe is clipped to a circle so its faint ring plane does not show as a rectangle beside the disc. A line under the grid names the moon catalogue and the day it was read. A giant planet's tile opens its moon page; the others open that body on the demo. English and Japanese. Linked from the first page. `test/moon-counts.test.ts` checks the rows against the catalogue, and `e2e/moon-counts.demo.ts` checks the page.
13
+
14
+
15
+ - **Moons by distance, as dots** (MODULES-1726). `dots.html` on the demo shows a giant planet's painted edge and the moons numbered I to XVI as dots sized by diameter, nearest at the top. The moons are not photographs. Jupiter's column is Metis through Sinope. A moon whose size is estimated says so, and one with no size is an open circle. English and Japanese. `test/moon-dots.test.ts` and `e2e/moon-dots.demo.ts`.
16
+
17
+
18
+ - **The moon-page hero is sharper and reads in one line** (MODULES-1722). The hero planet's still is 960 pixels on its long side, and every other still stays 160, with 36 MB for the small ones plus that one picture. Jupiter's globe is clipped to a circle, which drops the dark strip of its faint rings beside the limb. Saturn is pitched over its pole, so the near half of the rings, drawn in front of the globe, crosses the lower part of it, and the ring picture is mipmapped so the edges stay smooth. Jupiter's globe is the whole disc at about half the hero, which the 960-pixel still can hold. Iapetus sits clear of Titan. The arc uses the height of the picture, and a moon of 1,000 km is drawn large enough to see its map; the circles under the picture stay the true diameters, each named, in the same order as the picture, on one line. A moon with no photo map is named with a star, and the line under the picture says what the star means.
19
+
20
+ - **The moon page opens on the planet's edge** (MODULES-1722). Above the four tabs, the planet is drawn huge and cropped at the right, and its main moons sit in an arc down the open side, farthest at the top, each a painted sphere at a size that follows its diameter, with a gap between the nearest moon and the planet. Jupiter's arc is Callisto, Ganymede, Europa and Io, and the globe is turned so the Great Red Spot faces them. Saturn's is Iapetus, Titan, Rhea, Dione, Tethys, Enceladus and Mimas, with the rings as the planet draws them and the moons clear of the rings. A smaller row under the arc holds the other named moons the package draws (Saturn's small moons, and Jupiter's Thebe and Amalthea), each marked estimated because it has no photo map. Methone is not in that row. Under the picture, the same moons are outline circles at their true diameters. Every disc and every circle is a button: it names the moon's diameter, distance and discovery. Full screen fills the picture. English and Japanese.
21
+
22
+ - **The portrait builder starts from the moon posters** (MODULES-1729). Start from now includes a giant planet's edge (Jupiter, Saturn, Uranus, Neptune): the planet is large at the right and its main moons stand in an arc, farthest at the top. Saturn's first step is the longer one, so Iapetus sits clear of Titan, and Saturn looks over its pole so the near half of the rings crosses the lower globe. Moons beside their planet puts every moon the package draws in a row next to its giant. Each of these is a manual scene, so a drag, a resize, a saved PNG and the code start from that layout.
23
+
5
24
  ## [0.73.0] - 2026-11-20
6
25
 
7
26
  - **An irregular moon is an estimated rock** (MODULES-1720). `<wakusei-body body="himalia">`, or a designation such as `S/2003 J 18`, draws a coarse rock sized from the catalogue and coloured from its albedo (dark, mid, bright, or grey when the albedo is unknown). The shape is a guess from the id and the same id always matches. Under 100 km it is a potato (axes about 1 : 0.6–0.9 : 0.5–0.8, plus lumps); from 200 km it stays nearly round; between, the two blend. Each rock is turned by its id, so the long axis does not point the same way on every moon. A dark albedo is charcoal, and an unknown albedo is a mid grey. The picture shows the catalogue name and a star (`Himalia*`); the star means the shape or the size is estimated (`* shape or size estimated`, and in Japanese `* 形や大きさは推定`), which a picture shows once. The line drawing follows the shape with a smooth outline and a soft light-to-dark fill, not a flat polygon. The accessible name keeps the full words. A size worked out from the brightness says so there (`data-size="derived"`); a moon with no size is drawn at 1 km and marked `unknown`. The moons drawn in full are unchanged, and any other unknown name stays the Earth. One surface shader is shared. Stills are 160 pixels on a side so a whole family fits in the 32 MB still budget: a 480-pixel still of every moon of Jupiter was dropped, and the view showed a broken image.
package/README.md CHANGED
@@ -19,7 +19,7 @@ Wakusei Planets runs in the browser of a phone, a tablet or a computer: nothing
19
19
 
20
20
  <p align="center"><img alt="The demo on a desk: Saturn in the painted look, turning in the big view, with the page's links to the portrait builder, the colouring sheets, the space view, the star page and the size line-up above it, and the choice of body and its moons below" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/main/docs/images/home-desk.webp" width="620"> <img alt="The same page on a phone: the same links in rows, and Saturn in the painted look below them" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/main/docs/images/home-phone.webp" width="200"></p>
21
21
 
22
- <p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.73.0/docs/images/lineup-desk.png" width="640"></p>
22
+ <p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.74.0/docs/images/lineup-desk.png" width="640"></p>
23
23
 
24
24
  ## Who it is for
25
25
 
@@ -423,7 +423,7 @@ The tiles of every body share one 48 MB budget, six loads at a time for a source
423
423
 
424
424
  ## The portrait builder
425
425
 
426
- <p align="center"><img alt="The Sun and the planets in an arc, painted, with their names, in the portrait builder" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.73.0/docs/images/portrait-family.png" width="640"></p>
426
+ <p align="center"><img alt="The Sun and the planets in an arc, painted, with their names, in the portrait builder" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.74.0/docs/images/portrait-family.png" width="640"></p>
427
427
 
428
428
  [The portrait builder](https://johnmorrisdotca.github.io/wakusei-planets/portrait.html) puts any bodies in one picture: drag them, size them, turn them, order them front to back, arrange them in a row, an arc, a grid or at true orbit distance (true or readable sizes, a planet's moons round it in orbit order), light them from one direction, and take the code, a PNG or an SVG. The scene is kept in the address, and every body is drawn in one WebGL scene, so the page holds one WebGL context. [The portrait builder](docs/guides/portrait-builder.md) is its guide.
429
429
 
@@ -580,7 +580,7 @@ BODIES.pluto.kind; // "dwarf-planet"
580
580
 
581
581
  If this package helps a paper, a talk or a class, please cite it as software. GitHub's "Cite this repository" button reads [CITATION.cff](CITATION.cff) and gives BibTeX and APA; in plain text:
582
582
 
583
- > Morris, J. (2026). *Wakusei Planets* (version 0.73.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
583
+ > Morris, J. (2026). *Wakusei Planets* (version 0.74.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
584
584
 
585
585
  Cite the version you used (`npm ls @johnmorrisdotca/wakusei-planets`), and cite the sources of the numbers you use as well: [NOTICE.md](NOTICE.md) names each one, with the paper or the page it was read from (the IAU working group's report for sizes and poles, VSOP87B, ELP2000-82B, L1.2 and TASS1.7 for positions, and NASA's JPL Horizons for the fits and the spacecraft).
586
586
 
@@ -0,0 +1,27 @@
1
+ export declare const ALL_MOON_HOSTS: readonly ["mercury", "venus", "earth", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto"];
2
+ export type AllMoonHost = (typeof ALL_MOON_HOSTS)[number];
3
+ /** The moons the poster draws, in the order a reader meets them. Each one is in the catalogue. */
4
+ export declare const ALL_MOON_SHOW: Record<AllMoonHost, readonly string[]>;
5
+ export interface AllMoonShown {
6
+ id: string;
7
+ line: {
8
+ en: string;
9
+ ja: string;
10
+ };
11
+ estimated: boolean;
12
+ }
13
+ export interface AllMoonRow {
14
+ id: AllMoonHost;
15
+ name: {
16
+ en: string;
17
+ ja: string;
18
+ };
19
+ total: number;
20
+ most: boolean;
21
+ shown: AllMoonShown[];
22
+ /** Catalogue moons of this world that the row does not draw. */
23
+ more: number;
24
+ }
25
+ export declare const ALL_MOON_READ: string;
26
+ /** One row per world, Mercury through Pluto. A moon the package does not draw is left out of `shown`. */
27
+ export declare function allMoonPoster(): AllMoonRow[];
@@ -0,0 +1,38 @@
1
+ // Mercury through Pluto, each with the catalogue's moon count and a few moons the package can draw. The rest of a world's moons are a count, not a made-up picture. No DOM.
2
+ import { BODIES } from "./facts.js";
3
+ import { MOON_CATALOGUE_FETCHED, catalogueMoonsOf, moonCounts } from "./moon-catalogue.js";
4
+ import { estimatedRock } from "./scene/estimated-rock.js";
5
+ export const ALL_MOON_HOSTS = ["mercury", "venus", "earth", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto"];
6
+ /** The moons the poster draws, in the order a reader meets them. Each one is in the catalogue. */
7
+ export const ALL_MOON_SHOW = {
8
+ mercury: [],
9
+ venus: [],
10
+ earth: ["moon"],
11
+ mars: ["phobos", "deimos"],
12
+ jupiter: ["io", "europa", "ganymede", "callisto"],
13
+ saturn: ["titan", "enceladus", "rhea", "iapetus"],
14
+ uranus: ["titania", "oberon", "umbriel", "ariel"],
15
+ neptune: ["triton", "nereid", "proteus", "larissa"],
16
+ pluto: ["charon", "nix", "hydra", "kerberos", "styx"],
17
+ };
18
+ export const ALL_MOON_READ = MOON_CATALOGUE_FETCHED;
19
+ /** One row per world, Mercury through Pluto. A moon the package does not draw is left out of `shown`. */
20
+ export function allMoonPoster() {
21
+ const counts = moonCounts();
22
+ const rows = ALL_MOON_HOSTS.map((id) => {
23
+ const own = catalogueMoonsOf(id);
24
+ const byId = new Map(own.map((moon) => [moon.id, moon]));
25
+ const shown = ALL_MOON_SHOW[id].flatMap((moonId) => {
26
+ const moon = byId.get(moonId);
27
+ if (moon === undefined)
28
+ return [];
29
+ const rock = estimatedRock(moon.id);
30
+ const line = rock === null ? { en: moon.label, ja: moon.ja ?? moon.label } : { en: rock.line.en, ja: rock.line.ja };
31
+ return [{ id: moon.id, line, estimated: rock !== null }];
32
+ });
33
+ const total = counts[id]?.total ?? 0;
34
+ return { id, name: { en: BODIES[id].name.en, ja: BODIES[id].name.ja }, total, most: false, shown, more: Math.max(0, total - shown.length) };
35
+ });
36
+ const max = Math.max(...rows.map((row) => row.total));
37
+ return rows.map((row) => ({ ...row, most: max > 0 && row.total === max }));
38
+ }
@@ -0,0 +1,20 @@
1
+ /** The nine the count grid draws, in solar-system order. Pluto is last, as on the poster. */
2
+ export declare const MOON_COUNT_IDS: readonly ["mercury", "venus", "earth", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto"];
3
+ export type MoonCountId = (typeof MOON_COUNT_IDS)[number];
4
+ export interface MoonCountRow {
5
+ id: MoonCountId;
6
+ name: {
7
+ en: string;
8
+ ja: string;
9
+ };
10
+ /** Moons in the catalogue. Zero when the host has no entry. */
11
+ total: number;
12
+ /** True for every row that shares the highest count, and only when that count is at least one. */
13
+ most: boolean;
14
+ }
15
+ /** One row per painted planet, solar-system order, counts from `moonCounts()`. */
16
+ export declare function moonCountGrid(): MoonCountRow[];
17
+ /** Where a tile goes. A giant planet opens its moon page. The others have no moon page, so the tile opens that body on the demo. */
18
+ export declare function moonCountHref(id: MoonCountId): string;
19
+ /** The day the moon catalogue was read. The grid says so, because the counts change. */
20
+ export declare const MOON_COUNT_READ: string;
@@ -0,0 +1,24 @@
1
+ // Who has the most moons: the planets the package already paints, Mercury through Pluto, with each one's count taken from the moon catalogue. A host the catalogue does not list has none. No DOM.
2
+ import { BODIES } from "./facts.js";
3
+ import { MOON_CATALOGUE_FETCHED, moonCounts } from "./moon-catalogue.js";
4
+ import { MOON_PAGE_HOSTS } from "./moon-pages/data.js";
5
+ /** The nine the count grid draws, in solar-system order. Pluto is last, as on the poster. */
6
+ export const MOON_COUNT_IDS = ["mercury", "venus", "earth", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto"];
7
+ /** One row per painted planet, solar-system order, counts from `moonCounts()`. */
8
+ export function moonCountGrid() {
9
+ const counts = moonCounts();
10
+ const rows = MOON_COUNT_IDS.map((id) => ({
11
+ id,
12
+ name: { en: BODIES[id].name.en, ja: BODIES[id].name.ja },
13
+ total: counts[id]?.total ?? 0,
14
+ most: false,
15
+ }));
16
+ const max = Math.max(...rows.map((row) => row.total));
17
+ return rows.map((row) => ({ ...row, most: max > 0 && row.total === max }));
18
+ }
19
+ /** Where a tile goes. A giant planet opens its moon page. The others have no moon page, so the tile opens that body on the demo. */
20
+ export function moonCountHref(id) {
21
+ return MOON_PAGE_HOSTS.includes(id) ? `${id}.html` : `index.html?body=${id}`;
22
+ }
23
+ /** The day the moon catalogue was read. The grid says so, because the counts change. */
24
+ export const MOON_COUNT_READ = MOON_CATALOGUE_FETCHED;
@@ -0,0 +1,19 @@
1
+ import { MOON_PAGE_HOSTS, type MoonPageHost } from "./moon-pages/data.ts";
2
+ /** How high an IAU number the column keeps. XVI is the last moon on the Jupiter reference. */
3
+ export declare const MOON_DOT_LIMIT = 16;
4
+ /** The value of a Roman numeral, or null when the text is not one. */
5
+ export declare function romanValue(text: string): number | null;
6
+ export interface MoonDot {
7
+ id: string;
8
+ label: string;
9
+ ja: string | null;
10
+ radiusKm: number | null;
11
+ /** True when the radius is derived from a magnitude, not measured. */
12
+ estimate: boolean;
13
+ distanceKm: number;
14
+ /** The drawn diameter in pixels. A moon with no size gets the smallest dot. */
15
+ px: number;
16
+ }
17
+ /** The moons numbered I to XVI, nearest the planet first. A dot's pixels follow the radius, with a floor so a small moon stays visible. */
18
+ export declare function moonDotColumn(host: MoonPageHost): MoonDot[];
19
+ export { MOON_PAGE_HOSTS };
@@ -0,0 +1,41 @@
1
+ // A planet's edge and a column of dots: the moons numbered I to XVI, nearest first, each dot sized by its diameter. No pictures of the moons, and no DOM.
2
+ import { catalogueMoonsOf } from "./moon-catalogue.js";
3
+ import { MOON_PAGE_HOSTS } from "./moon-pages/data.js";
4
+ /** How high an IAU number the column keeps. XVI is the last moon on the Jupiter reference. */
5
+ export const MOON_DOT_LIMIT = 16;
6
+ const ROMAN = { I: 1, V: 5, X: 10, L: 50, C: 100, D: 500, M: 1000 };
7
+ /** The value of a Roman numeral, or null when the text is not one. */
8
+ export function romanValue(text) {
9
+ if (!/^[IVXLCDM]+$/.test(text))
10
+ return null;
11
+ let total = 0;
12
+ let prev = 0;
13
+ for (const ch of [...text].reverse()) {
14
+ const value = ROMAN[ch] ?? 0;
15
+ total += value < prev ? -value : value;
16
+ prev = Math.max(prev, value);
17
+ }
18
+ return total;
19
+ }
20
+ /** The moons numbered I to XVI, nearest the planet first. A dot's pixels follow the radius, with a floor so a small moon stays visible. */
21
+ export function moonDotColumn(host) {
22
+ const chosen = catalogueMoonsOf(host).flatMap((moon) => {
23
+ if (moon.number === null)
24
+ return [];
25
+ const n = romanValue(moon.number);
26
+ if (n === null || n < 1 || n > MOON_DOT_LIMIT)
27
+ return [];
28
+ return [moon];
29
+ });
30
+ const max = Math.max(1, ...chosen.map((moon) => moon.radiusKm ?? 0));
31
+ return chosen.map((moon) => ({
32
+ id: moon.id,
33
+ label: moon.label,
34
+ ja: moon.ja,
35
+ radiusKm: moon.radiusKm,
36
+ estimate: moon.radiusFrom === "derived",
37
+ distanceKm: moon.orbit?.a ?? 0,
38
+ px: moon.radiusKm === null ? 8 : Math.max(8, Math.round(72 * (moon.radiusKm / max))),
39
+ }));
40
+ }
41
+ export { MOON_PAGE_HOSTS };
@@ -0,0 +1,24 @@
1
+ import { MOON_PAGE_HOSTS, type MoonPageHost } from "./moon-pages/data.ts";
2
+ export { MOON_PAGE_HOSTS };
3
+ export interface GroupMoon {
4
+ id: string;
5
+ /** Where it sits in the list, from 1, in family order. */
6
+ number: number;
7
+ /** The name to print. An estimated rock already carries the star. */
8
+ line: {
9
+ en: string;
10
+ ja: string;
11
+ };
12
+ estimated: boolean;
13
+ }
14
+ export interface MoonGroup {
15
+ id: string;
16
+ name: {
17
+ en: string;
18
+ ja: string;
19
+ };
20
+ count: number;
21
+ moons: GroupMoon[];
22
+ }
23
+ /** The families of one giant planet, in list order, every catalogue moon once. Numbers run through that order. */
24
+ export declare function moonGroupPoster(host: MoonPageHost): MoonGroup[];
@@ -0,0 +1,20 @@
1
+ // A planet, then every one of its moons in the catalogue's families. A moon the package draws in full keeps its own picture. The rest are the estimated rocks. No DOM.
2
+ import { moonFamilies } from "./moon-catalogue.js";
3
+ import { MOON_PAGE_HOSTS } from "./moon-pages/data.js";
4
+ import { estimatedRock } from "./scene/estimated-rock.js";
5
+ export { MOON_PAGE_HOSTS };
6
+ /** The families of one giant planet, in list order, every catalogue moon once. Numbers run through that order. */
7
+ export function moonGroupPoster(host) {
8
+ let number = 0;
9
+ return moonFamilies(host).map((family) => ({
10
+ id: family.id,
11
+ name: { en: family.names.en, ja: family.names.ja },
12
+ count: family.count,
13
+ moons: family.moons.map((moon) => {
14
+ number += 1;
15
+ const rock = estimatedRock(moon.id);
16
+ const line = rock === null ? { en: moon.label, ja: moon.ja ?? moon.label } : { en: rock.line.en, ja: rock.line.ja };
17
+ return { id: moon.id, number, line, estimated: rock !== null };
18
+ }),
19
+ }));
20
+ }
@@ -53,7 +53,7 @@ export interface MoonPagesState {
53
53
  *
54
54
  * It never writes the page's address. A choice made in it is reflected on its attribute and sent as `wakusei-moon-pages-change` (bubbling, composed) with `detail` the whole `MoonPagesState`; a page that keeps its
55
55
  * address writes the detail there and sets the attributes back from it when it loads. Setting an attribute sends no event. The numbers are `moonPage(planet)`'s, worked out in a few milliseconds. The plan, the
56
- * portrait, the cards' bodies and the planet's looks are fetched only when their tab is first opened, so a page that shows only the orbits and the table loads no WebGL. Nothing runs on a timer; the orbits are drawn
56
+ * portrait and the cards' bodies are fetched only when their tab is first opened. The hero above the tabs is always there: the planet cropped at the right and its main moons in an arc, each a painted sphere, and it loads those looks when the element connects. Nothing runs on a timer; the orbits are drawn
57
57
  * again only when a choice, the language or the element's width changes. `data-state` is `ready` once it has drawn.
58
58
  *
59
59
  * @example
@@ -1,10 +1,11 @@
1
1
  // <wakusei-moon-pages>: one giant planet's moons in four tabs, each one screen. Orbits: every orbit of /moon-catalogue in SVG, from above, at an angle or from the side, coloured by direction or by family.
2
2
  // Map and portrait: <wakusei-plan> and <wakusei-portrait>. Main moons: a card with a picture for each moon drawn in full. Every moon: the whole list in a table that sorts. Every number is worked out from the
3
- // package's data (moonPage). The WebGL parts and the bodies' looks are fetched only when their tab is first opened. Nothing runs on a timer; it never writes the page's address: a choice is reflected on its
3
+ // package's data (moonPage). The hero above the tabs draws the planet and its main moons as soon as the element connects. The other WebGL parts are fetched when their tab is first opened. Nothing runs on a timer; it never writes the page's address: a choice is reflected on its
4
4
  // own attributes and sent as `wakusei-moon-pages-change`, for the page to keep where it likes.
5
5
  import { MOONS_OF } from "../facts.js";
6
6
  import { addBody, addMoons, defaultPortrait, encodeScene } from "../portrait/model.js";
7
7
  import { moonPage, MOON_PAGE_HOSTS } from "./data.js";
8
+ import { HERO_POSE, heroMoons, heroScale, heroSmall, heroZoom } from "./hero.js";
8
9
  import { MOON_PAGE_WORDS } from "./words.js";
9
10
  /**
10
11
  * The four tabs of `<wakusei-moon-pages>`, in their order: `orbits`, `views` (the map and the portrait), `cards` (the moons drawn in full) and `table` (every moon).
@@ -97,11 +98,41 @@ tbody th { font-weight: 400; }
97
98
  td:nth-child(7), td:nth-child(8) { white-space: normal; min-width: 9rem; max-width: 16rem; }
98
99
  tr:last-child > * { border-bottom: 0; }
99
100
  .credits { margin-top: 20px; }
101
+ .hero-wrap { display: grid; gap: 8px; margin: 0 0 14px; }
102
+ .hero { position: relative; overflow: hidden; height: min(78vh, 720px); min-height: 520px; background: #000; border-radius: 16px; }
103
+ .hero:fullscreen { width: 100%; height: 100%; min-height: 0; border-radius: 0; }
104
+ .hero-planet { position: absolute; z-index: 1; top: 50%; right: -70%; width: 124%; aspect-ratio: 1; transform: translateY(-50%); pointer-events: none; }
105
+ .hero-planet.clip-disc { width: 52%; right: 4%; border-radius: 50%; overflow: hidden; }
106
+ .hero-planet wakusei-body, .hero-disc wakusei-body { --wakusei-size: 100%; width: 100%; height: 100%; display: block; }
107
+ .hero-moons { position: absolute; inset: 0; z-index: 2; }
108
+ .hero-moon { position: absolute; transform: translate(-50%, -50%); display: block; margin: 0; padding: 0; border: 0; background: none; color: #fff; touch-action: manipulation; }
109
+ .hero-disc { display: block; width: calc(var(--disc) * 1px); aspect-ratio: 1; border-radius: 50%; }
110
+ .hero-disc wakusei-body { pointer-events: none; }
111
+ .hero-name { position: absolute; left: calc(100% + 6px); top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 650; line-height: 1.2; text-shadow: 0 1px 2px #000, 0 0 4px #000; white-space: nowrap; }
112
+ .hero-moon:hover .hero-disc, .hero-moon:focus-visible .hero-disc, .hero-moon[aria-pressed="true"] .hero-disc { outline: 2px solid #fff; outline-offset: 3px; }
113
+ .hero-small { position: absolute; z-index: 2; left: 10px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px; align-items: end; max-width: 52%; }
114
+ .hero-small .hero-moon { position: static; transform: none; display: grid; justify-items: center; gap: 1px; min-width: 36px; min-height: 44px; }
115
+ .hero-small .hero-name, .hero-small .hero-est { position: static; transform: none; left: auto; top: auto; font-size: 9px; line-height: 1.1; }
116
+ .hero-est { color: #d7d2c6; font-weight: 500; }
117
+ .hero-scale { display: flex; flex-wrap: nowrap; gap: 4px 10px; align-items: end; margin: 0; overflow-x: auto; }
118
+ .hero-note { margin: 4px 0 0; }
119
+ .scale-name { display: block; font-size: 11px; font-weight: 650; white-space: nowrap; }
120
+ .scale-moon { display: grid; justify-items: center; align-content: end; gap: 2px; min-width: 44px; min-height: 44px; margin: 0; padding: 2px; border: 0; border-radius: 8px; background: none; color: inherit; font: 600 11px/1.2 system-ui, sans-serif; }
121
+ .scale-moon svg { display: block; }
122
+ .scale-moon:hover, .scale-moon:focus-visible, .scale-moon[aria-pressed="true"] { outline: 2px solid currentColor; outline-offset: 2px; }
123
+ .fs { position: absolute; z-index: 3; top: 10px; left: 10px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.5); background: rgba(0,0,0,.45); color: #fff; font: 600 14px/1 system-ui, sans-serif; }
124
+ .hero-fact { margin: 0; min-height: 1.4em; font-size: .9rem; }
100
125
  @media (max-width: 600px) {
101
126
  .top { gap: 6px; margin-bottom: 8px; }
102
127
  h2 { font-size: 1.2rem; }
103
128
  .lede { display: none; }
104
129
  .short { display: block; }
130
+ .hero { height: min(68vh, 640px); min-height: 420px; border-radius: 12px; }
131
+ .hero-moons { bottom: 6.5rem; }
132
+ .hero-disc { width: calc(var(--disc) * 0.78px); }
133
+ .hero-name { font-size: 12px; }
134
+ .hero-small { max-width: 62%; }
135
+ .hero-small .hero-moon { min-width: 28px; }
105
136
  }
106
137
  </style>
107
138
  <section class="top" part="top">
@@ -110,6 +141,17 @@ tr:last-child > * { border-bottom: 0; }
110
141
  <p class="fine lede" id="lede"></p>
111
142
  <p class="fine short" id="short"></p>
112
143
  </section>
144
+ <section class="hero-wrap" part="hero">
145
+ <div class="hero" id="hero">
146
+ <button type="button" class="fs" id="full-screen"></button>
147
+ <div class="hero-planet" id="hero-planet"></div>
148
+ <div class="hero-moons" id="hero-moons" data-w-label="hero_moons"></div>
149
+ <div class="hero-small" id="hero-small"></div>
150
+ </div>
151
+ <p class="hero-fact" id="hero-fact" role="status"></p>
152
+ <p class="fine hero-note" id="hero-note"></p>
153
+ <div class="hero-scale" id="hero-scale" data-w-label="hero_scale"></div>
154
+ </section>
113
155
  <div class="panels" part="panels">
114
156
  <div class="tabs" role="tablist" id="tabs" data-w-label="tabs">
115
157
  <button type="button" role="tab" id="tab-orbits" aria-controls="panel-orbits" data-tab="orbits" data-w="tab_orbits"></button>
@@ -177,7 +219,7 @@ tr:last-child > * { border-bottom: 0; }
177
219
  *
178
220
  * It never writes the page's address. A choice made in it is reflected on its attribute and sent as `wakusei-moon-pages-change` (bubbling, composed) with `detail` the whole `MoonPagesState`; a page that keeps its
179
221
  * address writes the detail there and sets the attributes back from it when it loads. Setting an attribute sends no event. The numbers are `moonPage(planet)`'s, worked out in a few milliseconds. The plan, the
180
- * portrait, the cards' bodies and the planet's looks are fetched only when their tab is first opened, so a page that shows only the orbits and the table loads no WebGL. Nothing runs on a timer; the orbits are drawn
222
+ * portrait and the cards' bodies are fetched only when their tab is first opened. The hero above the tabs is always there: the planet cropped at the right and its main moons in an arc, each a painted sphere, and it loads those looks when the element connects. Nothing runs on a timer; the orbits are drawn
181
223
  * again only when a choice, the language or the element's width changes. `data-state` is `ready` once it has drawn.
182
224
  *
183
225
  * @example
@@ -205,6 +247,9 @@ export class WakuseiMoonPages extends HTMLElement {
205
247
  #plan;
206
248
  #portrait;
207
249
  #cardsFor;
250
+ #heroHost;
251
+ #heroMoon = null;
252
+ #onFull;
208
253
  #watch;
209
254
  #resize;
210
255
  #reflecting = false;
@@ -239,11 +284,15 @@ export class WakuseiMoonPages extends HTMLElement {
239
284
  });
240
285
  this.#resize.observe(this);
241
286
  }
287
+ this.#onFull = () => this.#paintFullscreen();
288
+ document.addEventListener("fullscreenchange", this.#onFull);
242
289
  this.#render();
243
290
  }
244
291
  disconnectedCallback() {
245
292
  this.#watch?.disconnect();
246
293
  this.#resize?.disconnect();
294
+ if (this.#onFull !== undefined)
295
+ document.removeEventListener("fullscreenchange", this.#onFull);
247
296
  }
248
297
  attributeChangedCallback(name, before, after) {
249
298
  if (this.#reflecting || before === after || this.#root === undefined)
@@ -260,8 +309,11 @@ export class WakuseiMoonPages extends HTMLElement {
260
309
  if (value !== null && ALLOWED[key].includes(value))
261
310
  next[key] = value;
262
311
  }
263
- if (next.planet !== this.#state.planet)
312
+ if (next.planet !== this.#state.planet) {
264
313
  this.#picked = null;
314
+ this.#heroMoon = null;
315
+ this.#heroHost = undefined;
316
+ }
265
317
  this.#state = next;
266
318
  }
267
319
  /** A choice made here: kept, reflected on the attributes, sent. */
@@ -357,6 +409,21 @@ export class WakuseiMoonPages extends HTMLElement {
357
409
  this.#light(this.#nearest(event.clientX, event.clientY));
358
410
  });
359
411
  svg.addEventListener("pointerdown", (event) => this.#light(this.#nearest(event.clientX, event.clientY)));
412
+ this.#$("#full-screen").addEventListener("click", () => {
413
+ const hero = this.#$("#hero");
414
+ if (document.fullscreenElement === hero)
415
+ void document.exitFullscreen();
416
+ else
417
+ void hero.requestFullscreen();
418
+ });
419
+ this.#$(".hero-wrap").addEventListener("click", (event) => {
420
+ const button = event.target?.closest("[data-moon]");
421
+ if (button === null || button === undefined)
422
+ return;
423
+ this.#heroMoon = button.dataset["moon"] ?? null;
424
+ this.#paintHero();
425
+ this.dispatchEvent(new CustomEvent("wakusei-moon-pages-change", { detail: { ...this.state, moon: this.#heroMoon }, bubbles: true, composed: true }));
426
+ });
360
427
  }
361
428
  // --- drawing -------------------------------------------------------------------------------------------------------------------------------------------
362
429
  #render() {
@@ -396,8 +463,132 @@ export class WakuseiMoonPages extends HTMLElement {
396
463
  this.#drawCards();
397
464
  if (this.#state.tab === "table")
398
465
  this.#drawTable();
466
+ this.#mountHero();
467
+ this.#paintFullscreen();
399
468
  this.setAttribute("data-state", "ready");
400
469
  }
470
+ /** The planet's edge and the arc. The spheres are made once a planet; a later draw only renames them. */
471
+ #mountHero() {
472
+ const host = this.#page().host;
473
+ if (this.#heroHost !== host) {
474
+ this.#heroHost = host;
475
+ this.#heroMoon = null;
476
+ void this.#loadHero(host);
477
+ return;
478
+ }
479
+ this.#paintHero();
480
+ }
481
+ async #loadHero(host) {
482
+ await LOOKS[host]();
483
+ await import("../element.js");
484
+ if (!this.isConnected || this.#heroHost !== host)
485
+ return;
486
+ const pose = HERO_POSE[host];
487
+ const planet = document.createElement("wakusei-body");
488
+ planet.setAttribute("body", host);
489
+ planet.setAttribute("data-still-size", "960");
490
+ planet.setAttribute("look", "painted");
491
+ planet.setAttribute("live", "off");
492
+ planet.setAttribute("fit", "tight");
493
+ planet.setAttribute("labels", "off");
494
+ planet.setAttribute("meridian", String(pose.meridian));
495
+ planet.setAttribute("tilt", String(pose.tilt));
496
+ if (pose.pitch !== undefined)
497
+ planet.setAttribute("pitch", String(pose.pitch));
498
+ this.#textures(planet);
499
+ const frame = this.#$("#hero-planet");
500
+ frame.classList.toggle("clip-disc", host === "jupiter");
501
+ frame.replaceChildren(planet);
502
+ const zoom = heroZoom(host);
503
+ if (zoom !== 1)
504
+ planet.setView({ zoom });
505
+ const cards = this.#page().cards;
506
+ const moons = heroMoons(cards, host, this.#lang());
507
+ const discButton = (id, px, look) => {
508
+ const button = document.createElement("button");
509
+ button.type = "button";
510
+ button.className = "hero-moon";
511
+ button.dataset["moon"] = id;
512
+ const disc = document.createElement("span");
513
+ disc.className = "hero-disc";
514
+ disc.style.setProperty("--disc", String(px));
515
+ const body = document.createElement("wakusei-body");
516
+ body.setAttribute("body", id);
517
+ body.setAttribute("look", look);
518
+ body.setAttribute("live", "off");
519
+ body.setAttribute("fit", "tight");
520
+ body.setAttribute("labels", "off");
521
+ this.#textures(body);
522
+ const name = document.createElement("span");
523
+ name.className = "hero-name";
524
+ disc.append(body);
525
+ button.append(disc, name);
526
+ return button;
527
+ };
528
+ this.#$("#hero-moons").replaceChildren(...moons.map((moon) => {
529
+ const button = discButton(moon.id, moon.px, "painted");
530
+ button.style.left = `${moon.left}%`;
531
+ button.style.top = `${moon.top}%`;
532
+ return button;
533
+ }));
534
+ this.#$("#hero-small").replaceChildren(...heroSmall(cards, host, this.#lang()).map((moon) => discButton(moon.id, moon.px, "illustrated")));
535
+ this.#$("#hero-scale").replaceChildren(...heroScale(cards, host).map((circle) => {
536
+ const button = document.createElement("button");
537
+ button.type = "button";
538
+ button.className = "scale-moon";
539
+ button.dataset["moon"] = circle.id;
540
+ const r = Math.max(1.5, (circle.px / 56) * 26);
541
+ button.innerHTML = `<svg width="56" height="56" viewBox="0 0 56 56" aria-hidden="true"><circle cx="28" cy="28" r="${r}" fill="none" stroke="currentColor" stroke-width="1.5"/></svg><span class="scale-name"></span><span class="scale-km"></span>`;
542
+ return button;
543
+ }));
544
+ this.#paintHero();
545
+ }
546
+ #paintHero() {
547
+ const page = this.#page();
548
+ const lang = this.#lang();
549
+ const named = new Map([...heroMoons(page.cards, page.host, lang), ...heroSmall(page.cards, page.host, lang)].map((moon) => [moon.id, moon.name]));
550
+ for (const button of this.#$$("[data-moon]")) {
551
+ const id = button.dataset["moon"] ?? "";
552
+ button.setAttribute("aria-pressed", String(id === this.#heroMoon));
553
+ const name = button.querySelector(".hero-name");
554
+ if (name !== null && named.has(id))
555
+ name.textContent = named.get(id) ?? "";
556
+ if (button.closest("#hero-small") !== null)
557
+ button.title = this.#say("hero_estimated");
558
+ const scaleName = button.querySelector(".scale-name");
559
+ if (scaleName !== null)
560
+ scaleName.textContent = named.get(id) ?? "";
561
+ const km = button.querySelector(".scale-km");
562
+ if (km !== null) {
563
+ const card = page.cards.find((item) => item.id === id);
564
+ if (card !== undefined)
565
+ km.textContent = `${this.#diameter(card.radiusKm)} km`;
566
+ }
567
+ button.querySelector("wakusei-body")?.setAttribute("lang", lang);
568
+ }
569
+ this.#$("#hero-planet").querySelector("wakusei-body")?.setAttribute("lang", lang);
570
+ this.#$("#hero-note").textContent = `${this.#say("hero_scale")} ${this.#say("hero_estimated")}`;
571
+ this.#paintFact();
572
+ this.#paintFullscreen();
573
+ }
574
+ #paintFact() {
575
+ const card = this.#page().cards.find((item) => item.id === this.#heroMoon);
576
+ const fact = this.#$("#hero-fact");
577
+ if (card === undefined) {
578
+ fact.textContent = "";
579
+ return;
580
+ }
581
+ const name = this.#lang() === "ja" ? card.name.ja : card.name.en;
582
+ fact.textContent = this.#say("hero_fact", { name, diameter: this.#diameter(card.radiusKm), distance: card.a === null ? NONE : this.#number(card.a), planet: this.#planetName(), found: card.date ?? NONE });
583
+ }
584
+ #paintFullscreen() {
585
+ if (this.#root === undefined)
586
+ return;
587
+ const on = document.fullscreenElement === this.#$("#hero");
588
+ const button = this.#$("#full-screen");
589
+ button.textContent = this.#say(on ? "leave_full_screen" : "full_screen");
590
+ button.setAttribute("aria-pressed", String(on));
591
+ }
401
592
  #drawOrbits() {
402
593
  const data = this.#page();
403
594
  const svg = this.#$("#orbits");
@@ -0,0 +1,34 @@
1
+ import type { MoonPageHost, PageCard } from "./data.ts";
2
+ /** The moons in the hero's arc, farthest from the planet first. Jupiter's four are the Galileans. Saturn's seven are the large named moons. */
3
+ export declare const HERO_ARC: Record<MoonPageHost, readonly string[]>;
4
+ /** A second, smaller row: the named moons the package draws that are not in the arc. Saturn's list is the small moons of the reference; Methone is not drawn here. None of these has a photo map. */
5
+ export declare const HERO_SMALL: Record<MoonPageHost, readonly string[]>;
6
+ /** Where the painted face is turned, in degrees, so the familiar side of the planet meets the moons. Jupiter's longitude is the package's best-known side, turned so the Great Red Spot sits in the visible half. Saturn's pitch looks over the pole: the near half of the rings, the one drawn in front of the globe, then crosses the lower part of the globe. A negative pitch puts that half on the upper globe and the far half, which the globe hides, on the lower. */
7
+ export declare const HERO_POSE: Record<MoonPageHost, {
8
+ meridian: number;
9
+ tilt: number;
10
+ pitch?: number;
11
+ }>;
12
+ /**
13
+ * How far a hero planet is zoomed. A tight portrait fits the rings, and Jupiter's faint rings would shrink the globe to a third of the frame, so Jupiter is zoomed until the globe fills it. Saturn's rings are the picture, and stay at 1.
14
+ */
15
+ export declare function heroZoom(host: MoonPageHost): number;
16
+ /** One moon of the hero: its name, the disc's width in pixels, and the centre as a percent of the hero. */
17
+ export interface HeroMoon {
18
+ id: string;
19
+ name: string;
20
+ px: number;
21
+ left: number;
22
+ top: number;
23
+ }
24
+ /** The hero's moons for one planet, farthest first, in the arc from the upper left down toward the planet's limb. A moon that is not drawn is left out. */
25
+ export declare function heroMoons(cards: readonly PageCard[], host: MoonPageHost, lang: "en" | "ja"): HeroMoon[];
26
+ /** The second row, in list order. Disc sizes follow diameter, with a floor so a small rock stays a disc. Every one is marked estimated: the package has no photo map for these. */
27
+ export declare function heroSmall(cards: readonly PageCard[], host: MoonPageHost, lang: "en" | "ja"): HeroMoon[];
28
+ export interface HeroCircle {
29
+ id: string;
30
+ px: number;
31
+ diameterKm: number;
32
+ }
33
+ /** The same moons as outline circles at their true diameters, the largest 56 pixels across. */
34
+ export declare function heroScale(cards: readonly PageCard[], host: MoonPageHost): HeroCircle[];
@@ -0,0 +1,81 @@
1
+ // The hero above a moon page's tabs: the planet's edge, and its main moons in an arc, farthest at the top. Disc sizes follow the moons' own diameters, squeezed so a small moon stays visible. No DOM.
2
+ import { BODIES, ringReach } from "../facts.js";
3
+ /** The moons in the hero's arc, farthest from the planet first. Jupiter's four are the Galileans. Saturn's seven are the large named moons. */
4
+ export const HERO_ARC = {
5
+ jupiter: ["callisto", "ganymede", "europa", "io"],
6
+ saturn: ["iapetus", "titan", "rhea", "dione", "tethys", "enceladus", "mimas"],
7
+ uranus: ["oberon", "titania", "umbriel", "ariel", "miranda"],
8
+ neptune: ["nereid", "triton", "proteus", "larissa"],
9
+ };
10
+ /** A second, smaller row: the named moons the package draws that are not in the arc. Saturn's list is the small moons of the reference; Methone is not drawn here. None of these has a photo map. */
11
+ export const HERO_SMALL = {
12
+ jupiter: ["thebe", "amalthea"],
13
+ saturn: ["pan", "atlas", "prometheus", "pandora", "janus", "epimetheus", "hyperion", "telesto", "calypso", "helene"],
14
+ uranus: [],
15
+ neptune: [],
16
+ };
17
+ /** Where the painted face is turned, in degrees, so the familiar side of the planet meets the moons. Jupiter's longitude is the package's best-known side, turned so the Great Red Spot sits in the visible half. Saturn's pitch looks over the pole: the near half of the rings, the one drawn in front of the globe, then crosses the lower part of the globe. A negative pitch puts that half on the upper globe and the far half, which the globe hides, on the lower. */
18
+ export const HERO_POSE = {
19
+ jupiter: { meridian: 70, tilt: 14 },
20
+ saturn: { meridian: 30, tilt: 26.73, pitch: 22 },
21
+ uranus: { meridian: 10, tilt: 16 },
22
+ neptune: { meridian: 20, tilt: 16 },
23
+ };
24
+ /**
25
+ * How far a hero planet is zoomed. A tight portrait fits the rings, and Jupiter's faint rings would shrink the globe to a third of the frame, so Jupiter is zoomed until the globe fills it. Saturn's rings are the picture, and stay at 1.
26
+ */
27
+ export function heroZoom(host) {
28
+ if (host !== "jupiter")
29
+ return 1;
30
+ return Math.max(1.06, ringReach(BODIES[host]) * 1.04);
31
+ }
32
+ /** The hero's moons for one planet, farthest first, in the arc from the upper left down toward the planet's limb. A moon that is not drawn is left out. */
33
+ export function heroMoons(cards, host, lang) {
34
+ const byId = new Map(cards.map((card) => [card.id, card]));
35
+ const chosen = HERO_ARC[host].flatMap((id) => {
36
+ const card = byId.get(id);
37
+ return card === undefined ? [] : [card];
38
+ });
39
+ const max = Math.max(1, ...chosen.map((card) => card.radiusKm));
40
+ const count = chosen.length;
41
+ const largest = count <= 4 ? 132 : count <= 5 ? 120 : 112;
42
+ return chosen.map((card, index) => {
43
+ const even = count <= 1 ? 0 : index / (count - 1);
44
+ // Saturn's first two discs are the large ones. A shared step sets Iapetus on Titan, so the first step is longer.
45
+ const t = host === "saturn" && count > 2 ? (index === 0 ? 0 : 0.34 + 0.66 * ((index - 1) / (count - 2))) : even;
46
+ const share = card.radiusKm / max;
47
+ return {
48
+ id: card.id,
49
+ name: lang === "ja" ? card.name.ja : card.name.en,
50
+ px: Math.max(64, Math.round(largest * share)),
51
+ left: Math.round((16 + even * 12) * 10) / 10,
52
+ top: Math.round((10 + t * 62) * 10) / 10,
53
+ };
54
+ });
55
+ }
56
+ /** The second row, in list order. Disc sizes follow diameter, with a floor so a small rock stays a disc. Every one is marked estimated: the package has no photo map for these. */
57
+ export function heroSmall(cards, host, lang) {
58
+ const byId = new Map(cards.map((card) => [card.id, card]));
59
+ const chosen = HERO_SMALL[host].flatMap((id) => {
60
+ const card = byId.get(id);
61
+ return card === undefined ? [] : [card];
62
+ });
63
+ const max = Math.max(1, ...chosen.map((card) => card.radiusKm));
64
+ return chosen.map((card) => ({
65
+ id: card.id,
66
+ name: `${lang === "ja" ? card.name.ja : card.name.en}*`,
67
+ px: Math.round(28 * Math.max(0.45, card.radiusKm / max)),
68
+ left: 0,
69
+ top: 0,
70
+ }));
71
+ }
72
+ /** The same moons as outline circles at their true diameters, the largest 56 pixels across. */
73
+ export function heroScale(cards, host) {
74
+ const byId = new Map(cards.map((card) => [card.id, card]));
75
+ const chosen = [...HERO_ARC[host], ...HERO_SMALL[host]].flatMap((id) => {
76
+ const card = byId.get(id);
77
+ return card === undefined ? [] : [card];
78
+ });
79
+ const max = Math.max(1, ...chosen.map((card) => card.radiusKm));
80
+ return chosen.map((card) => ({ id: card.id, diameterKm: card.radiusKm * 2, px: Math.max(4, Math.round(56 * (card.radiusKm / max))) }));
81
+ }
@@ -55,6 +55,12 @@ export declare const MOON_PAGE_WORDS: {
55
55
  readonly table_note: "≈ marks a size worked out from the moon's brightness, not measured. — means no source gives it. The place of discovery is known here only for the moons drawn in full, which are in bold.";
56
56
  readonly credits: "Every number on this page is the package's own, worked out when the page was built: the moons, their orbits, sizes and discoveries from NASA/JPL's moon pages and Horizons, read on {fetched}, and the places of discovery from the IAU Gazetteer.";
57
57
  readonly short: "{total} moons · {named} named · {retrograde} go the other way";
58
+ readonly hero_moons: "Main moons";
59
+ readonly full_screen: "Full screen";
60
+ readonly leave_full_screen: "Leave full screen";
61
+ readonly hero_fact: "{name}: {diameter} km across, {distance} km from {planet}. Found {found}.";
62
+ readonly hero_estimated: "* shape or size estimated";
63
+ readonly hero_scale: "The circles are the true sizes. The moons above are drawn large enough to see.";
58
64
  };
59
65
  readonly ja: {
60
66
  readonly tabs: "表示";
@@ -111,5 +117,11 @@ export declare const MOON_PAGE_WORDS: {
111
117
  readonly table_note: "≈ は、測定ではなく衛星の明るさから見積もった大きさです。— は、資料に値がないことを表します。発見した場所は、くわしく描いている衛星(太字)だけにあります。";
112
118
  readonly credits: "このページの数字はすべて、ページを作ったときにパッケージのデータから計算したものです。衛星の軌道・大きさ・発見は NASA/JPL の衛星のページと Horizons({fetched}に読み込み)から、発見した場所は IAU 惑星地名辞典からです。";
113
119
  readonly short: "衛星{total}個・名前つき{named}個・反対向き{retrograde}個";
120
+ readonly hero_moons: "主な衛星";
121
+ readonly full_screen: "全画面";
122
+ readonly leave_full_screen: "全画面をやめる";
123
+ readonly hero_fact: "{name}:直径 {diameter} km、{planet}から {distance} km。発見は{found}。";
124
+ readonly hero_estimated: "* 形や大きさは推定";
125
+ readonly hero_scale: "円が実際の大きさです。上の衛星は見える大きさに描いています。";
114
126
  };
115
127
  };
@@ -56,6 +56,12 @@ export const MOON_PAGE_WORDS = {
56
56
  table_note: "≈ marks a size worked out from the moon's brightness, not measured. — means no source gives it. The place of discovery is known here only for the moons drawn in full, which are in bold.",
57
57
  credits: "Every number on this page is the package's own, worked out when the page was built: the moons, their orbits, sizes and discoveries from NASA/JPL's moon pages and Horizons, read on {fetched}, and the places of discovery from the IAU Gazetteer.",
58
58
  short: "{total} moons · {named} named · {retrograde} go the other way",
59
+ hero_moons: "Main moons",
60
+ full_screen: "Full screen",
61
+ leave_full_screen: "Leave full screen",
62
+ hero_fact: "{name}: {diameter} km across, {distance} km from {planet}. Found {found}.",
63
+ hero_estimated: "* shape or size estimated",
64
+ hero_scale: "The circles are the true sizes. The moons above are drawn large enough to see.",
59
65
  },
60
66
  ja: {
61
67
  tabs: "表示",
@@ -112,5 +118,11 @@ export const MOON_PAGE_WORDS = {
112
118
  table_note: "≈ は、測定ではなく衛星の明るさから見積もった大きさです。— は、資料に値がないことを表します。発見した場所は、くわしく描いている衛星(太字)だけにあります。",
113
119
  credits: "このページの数字はすべて、ページを作ったときにパッケージのデータから計算したものです。衛星の軌道・大きさ・発見は NASA/JPL の衛星のページと Horizons({fetched}に読み込み)から、発見した場所は IAU 惑星地名辞典からです。",
114
120
  short: "衛星{total}個・名前つき{named}個・反対向き{retrograde}個",
121
+ hero_moons: "主な衛星",
122
+ full_screen: "全画面",
123
+ leave_full_screen: "全画面をやめる",
124
+ hero_fact: "{name}:直径 {diameter} km、{planet}から {distance} km。発見は{found}。",
125
+ hero_estimated: "* 形や大きさは推定",
126
+ hero_scale: "円が実際の大きさです。上の衛星は見える大きさに描いています。",
115
127
  },
116
128
  };
@@ -285,7 +285,7 @@ export interface Preset {
285
285
  scene: Portrait;
286
286
  }
287
287
  /**
288
- * Ready-made scenes to start from: a family photo of the Sun and the planets, the gas giants to scale, Jupiter and the Galileans, the Earth and the Moon to scale (size and distance), Mars and its moons at their true distance, and the inner planets round the Sun.
288
+ * Ready-made scenes to start from: a family photo of the Sun and the planets, the gas giants to scale, Jupiter and the Galileans, the Earth and the Moon to scale (size and distance), Mars and its moons at their true distance, the inner planets round the Sun, a giant planet's edge with its main moons in an arc, and every drawn moon beside its planet.
289
289
  *
290
290
  * @example
291
291
  * ```ts
@@ -692,8 +692,85 @@ export function decodeScene(text) {
692
692
  return p;
693
693
  }
694
694
  const fromList = (ids, change = {}) => ids.reduce((p, id) => addBody(p, id), { ...defaultPortrait(), ...change });
695
+ /** The poster arc, farthest from the planet first. These are the moons the package draws. */
696
+ const POSTER_ARC = {
697
+ jupiter: ["callisto", "ganymede", "europa", "io"],
698
+ saturn: ["iapetus", "titan", "rhea", "dione", "tethys", "enceladus", "mimas"],
699
+ uranus: ["oberon", "titania", "umbriel", "ariel", "miranda"],
700
+ neptune: ["nereid", "triton", "proteus"],
701
+ };
702
+ /** The turn that puts the familiar face toward the moons. Saturn looks over the pole so the near half of the rings crosses the lower globe. */
703
+ const POSTER_POSE = {
704
+ jupiter: { spin: 70, tilt: 14 },
705
+ saturn: { spin: 30, tilt: 26.73, pitch: 22 },
706
+ uranus: { spin: 10, tilt: 16 },
707
+ neptune: { spin: 20, tilt: 16 },
708
+ };
709
+ /** A manual scene of one poster: the planet large at the right, its main moons in an arc, farthest at the top. Saturn's first step is longer, so Iapetus sits clear of Titan. */
710
+ function posterEdge(host) {
711
+ const moons = POSTER_ARC[host];
712
+ const aspect = 16 / 9;
713
+ const count = moons.length;
714
+ const sized = sizesFor(moons, "readable");
715
+ const moonScale = (count <= 4 ? 0.2 : 0.13) / Math.max(...sized);
716
+ const pose = POSTER_POSE[host];
717
+ const planetR = host === "jupiter" ? 0.72 : 0.82 / reachOf(host);
718
+ const planet = {
719
+ body: host,
720
+ x: aspect * 0.92 - planetR * 0.15,
721
+ y: 0,
722
+ r: planetR,
723
+ spin: pose.spin,
724
+ tilt: pose.tilt,
725
+ turn: 0,
726
+ ...(pose.pitch !== undefined ? { pitch: pose.pitch } : {}),
727
+ };
728
+ let y = 0.78;
729
+ let previous = 0;
730
+ const items = [
731
+ planet,
732
+ ...moons.map((id, index) => {
733
+ const even = count <= 1 ? 0 : index / (count - 1);
734
+ const r = sized[index] * moonScale;
735
+ if (index > 0)
736
+ y -= previous + r + (host === "saturn" && index === 1 ? 0.16 : 0.04);
737
+ previous = r;
738
+ return { body: id, x: -aspect + (0.16 + even * 0.14) * 2 * aspect, y, r, spin: BODIES[id].showLon ?? 0, turn: 0 };
739
+ }),
740
+ ];
741
+ return { ...defaultPortrait(), items, layout: "manual", arrange: "arc", scale: "readable", moons: "manual", orbits: false, labels: true, aspect, camera: { x: 0, y: 0, h: 1 } };
742
+ }
743
+ /** A manual scene of the groups poster: each giant planet with the moons the package draws, in a row beside it. */
744
+ function posterGroups() {
745
+ const hosts = ["jupiter", "saturn", "uranus", "neptune"];
746
+ const aspect = 16 / 9;
747
+ const rows = hosts.map((host) => {
748
+ const ids = [host, ...[...MOONS_OF[host]].sort(byDistance)];
749
+ const sized = sizesFor(ids, "readable");
750
+ const scale = 0.22 / Math.max(...sized);
751
+ return ids.map((id, index) => {
752
+ const r = Math.max(0.04, sized[index] * scale);
753
+ return { id, r, span: r * (id === "saturn" ? reachOf(id) : 1.15) };
754
+ });
755
+ });
756
+ const gap = 0.1;
757
+ const heights = rows.map((row) => Math.max(...row.map((body) => body.span)) * 2);
758
+ let yCursor = heights.reduce((sum, height) => sum + height, 0) / 2 + (gap * (rows.length - 1)) / 2;
759
+ const items = [];
760
+ rows.forEach((row, index) => {
761
+ const y = yCursor - heights[index] / 2;
762
+ yCursor -= heights[index] + gap;
763
+ let x = 0;
764
+ row.forEach((body, place) => {
765
+ x += body.span;
766
+ items.push({ body: body.id, x, y, r: body.r, spin: BODIES[body.id].showLon ?? 0, turn: 0 });
767
+ x += body.span + (place === 0 ? 0.12 : 0.04);
768
+ });
769
+ });
770
+ return fitAll({ ...defaultPortrait(), items, layout: "manual", arrange: "row", scale: "readable", moons: "manual", orbits: false, labels: false, aspect, camera: { x: 0, y: 0, h: 1 } });
771
+ }
695
772
  /**
696
- * Ready-made scenes to start from: a family photo of the Sun and the planets, the gas giants to scale, Jupiter and the Galileans, the Earth and the Moon to scale (size and distance), Mars and its moons at their true distance, and the inner planets round the Sun.
773
+ * Ready-made scenes to start from: a family photo of the Sun and the planets, the gas giants to scale, Jupiter and the Galileans, the Earth and the Moon to scale (size and distance), Mars and its moons at their true distance, the inner planets round the Sun, a giant planet's edge with its main moons in an arc, and every drawn moon beside its planet.
697
774
  *
698
775
  * @example
699
776
  * ```ts
@@ -709,4 +786,9 @@ export const PRESETS = [
709
786
  { id: "earthmoon", name: { en: "Earth and Moon to scale", ja: "地球と月 (大きさと距離の比)" }, scene: fromList(["earth", "moon"], { arrange: "orbit", scale: "true", moons: "auto", orbits: true }) },
710
787
  { id: "marsmoons", name: { en: "Mars and its moons at true distance", ja: "火星と衛星 (本当の距離)" }, scene: fromList(["mars", "phobos", "deimos"], { arrange: "orbit", scale: "readable", moons: "auto", orbits: true }) },
711
788
  { id: "orrery", name: { en: "The inner planets round the Sun", ja: "太陽と内側の惑星 (本当の距離)" }, scene: fromList(["sun", "mercury", "venus", "earth", "mars"], { arrange: "orbit", scale: "readable", moons: "auto", orbits: true, bg: "black" }) },
789
+ { id: "jupiter-edge", name: { en: "Jupiter's edge", ja: "木星の縁" }, scene: posterEdge("jupiter") },
790
+ { id: "saturn-edge", name: { en: "Saturn's edge", ja: "土星の縁" }, scene: posterEdge("saturn") },
791
+ { id: "uranus-edge", name: { en: "Uranus's edge", ja: "天王星の縁" }, scene: posterEdge("uranus") },
792
+ { id: "neptune-edge", name: { en: "Neptune's edge", ja: "海王星の縁" }, scene: posterEdge("neptune") },
793
+ { id: "moons-by-planet", name: { en: "Moons beside their planet", ja: "惑星のそばの衛星" }, scene: posterGroups() },
712
794
  ];
@@ -146,8 +146,8 @@ export function createBodyItem(options) {
146
146
  ringTexture = assets.acquire(`wk:ringtex:${ringKey}`, () => {
147
147
  if (photoTexture !== undefined) {
148
148
  photoTexture.magFilter = T.LinearFilter;
149
- photoTexture.minFilter = T.LinearFilter;
150
- photoTexture.generateMipmaps = false;
149
+ photoTexture.minFilter = 1008; // LinearMipmapLinearFilter: the ring is drawn smaller than its picture, and a linear sample of the full picture stair-steps the edges
150
+ photoTexture.generateMipmaps = true;
151
151
  photoTexture.wrapS = T.ClampToEdgeWrapping;
152
152
  photoTexture.colorSpace = T.NoColorSpace;
153
153
  return photoTexture;
@@ -29,9 +29,10 @@ export function takeRenderer(onContext) {
29
29
  listeners.add(onContext);
30
30
  shared ??= createSharedRenderer({
31
31
  load: () => loader(),
32
- // A still is this many pixels on its long side, and the page keeps 32 MB of them. A square still is that side squared, times four bytes.
33
- // 160 holds every moon of Saturn (293) with the planet, which a 480-pixel still cannot: those are about 0.9 MB each, and past the budget the picture is dropped and the view shows a broken image.
32
+ // 160 holds every moon of Saturn (293) with the planet. A hero planet sets data-still-size="960" on its own element, so a grid tile stays at 160. One 960 still is about 3.7 MB, so the budget is the 32 MB of small stills plus that one picture.
34
33
  stillSize: 160,
34
+ antialias: true,
35
+ stillBytes: 36 * 1024 * 1024,
35
36
  onContext: (state) => {
36
37
  for (const listener of listeners)
37
38
  listener(state);
@@ -11,7 +11,7 @@ import { type BodyMapSource } from "../door/map.ts";
11
11
  * console.log(TEXTURE_BASE);
12
12
  * ```
13
13
  */
14
- export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.73.0/dist/textures/";
14
+ export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.74.0/dist/textures/";
15
15
  /**
16
16
  * Where the sharpest surface pictures are: the files of this exact version in the repository, on jsDelivr's GitHub address. The npm package holds only the two smaller widths, so a page that
17
17
  * never zooms in never fetches them. Set `texture-far-base` on an element to serve them yourself.
@@ -23,7 +23,7 @@ export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdot
23
23
  * console.log(TEXTURE_FAR_BASE);
24
24
  * ```
25
25
  */
26
- export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.73.0/textures/";
26
+ export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.74.0/textures/";
27
27
  /**
28
28
  * Where the finer map tiles are by default: the demo site's `tiles/` folder (GitHub Pages sends `access-control-allow-origin: *`). The tiles are made by `scripts/make-body-tiles.py` and are in no package and no repository:
29
29
  * a page that serves its own gives the folder in the `tiles` attribute, and `tiles="off"` turns them off. A page that sets `texture-base` (it serves its own pictures) has none unless it says where they are.
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.73.0";
1
+ export declare const VERSION = "0.74.0";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // The published package version. Snippets and texture addresses name it. test/version.test.ts keeps it equal to package.json.
2
- export const VERSION = "0.73.0";
2
+ export const VERSION = "0.74.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnmorrisdotca/wakusei-planets",
3
- "version": "0.73.0",
3
+ "version": "0.74.0",
4
4
  "description": "Wakusei Planets 惑星 — The Sun, planets and moons for the web: each as a clean line drawing, a shaded realistic drawing or a painted surface map, with real sizes, axial tilt and rotation as data, and positions of the moons for any date and time. SVG for the lines, three.js (optional) for the rest.",
5
5
  "keywords": [
6
6
  "planets",
@@ -1034,6 +1034,9 @@
1034
1034
  "pnpm": {
1035
1035
  "onlyBuiltDependencies": [
1036
1036
  "esbuild"
1037
- ]
1037
+ ],
1038
+ "patchedDependencies": {
1039
+ "@johnmorrisdotca/kazoku-ui@0.41.0": "patches/@johnmorrisdotca__kazoku-ui@0.41.0.patch"
1040
+ }
1038
1041
  }
1039
1042
  }