Skip to content

feat(site): constellations on hover, every star labelled, softer fades - #3

Merged
craig-o-curtis merged 6 commits into
mainfrom
feat/sky-fades-constellations
Oct 23, 2026
Merged

craig-o-curtis merged 6 commits into
mainfrom
feat/sky-fades-constellations

Conversation

@craig-o-curtis

@craig-o-curtis craig-o-curtis commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Hovering a star now traces its constellation across the sky, every star the sky draws has a label, and tooltips, cards and buttons fade in instead of popping.

Changes

  • Constellation lines: hover or tap a star and its constellation draws itself outward from that star, line by line, then fades a moment after you leave. Moving between stars of the same constellation keeps the drawing.
    • Lines stop short of each star and break where they would pass below the horizon or behind the skyline.
    • They sit under the cards, so the glass blurs them like the stars.
    • The worker projects them; the page only draws SVG lines. Nothing runs until a hover.
    • Figures are d3-celestial's (Olaf Frohn, BSD-3-Clause), matched to our star catalogue: 739 lines, 2.3 KB gzipped. Credited in the popover.
  • Labels for every star: previously only the 324 IAU-named stars had one.
    • Named stars are unchanged: "Sarin · Hercules".
    • 1,801 more show their Greek-letter or Flamsteed designation: "ζ Herculis", "95 Herculis".
    • The remaining 762, mostly faint southern stars, show their catalogue number: "HR 104".
    • The names file grows from 3 KB to 19 KB gzipped and still loads after the stars.
  • Tooltip fade: labels rise into place out of a soft blur on the theme's enter timing and fade out. Reduced motion keeps only the fade.
  • Cards and buttons: on hover a card's border brightens and a soft glow fades in, and fades back out quicker. The Docs and GitHub buttons do the same; their glow is a separate layer, so it never fights the focus ring.

Verification

  • Checks: pnpm lint, pnpm check and pnpm build pass on every commit. stars.bin is unchanged byte for byte.
  • Star positions vs astronomy-engine: 10 bright stars at both sites agree within 0.3′.
    • Andromeda sits left of centre at Ísafjörður and right of centre at Helsinki, which is correct. Ísafjörður faces NNE with Andromeda in the NNW; Helsinki faces NNW, three hours later in local time, with Andromeda in the N–NNE.
  • Labels: in headless Chromium, 26 of 27 stars found on screen over Helsinki got a label. The miss was likely a city light on the horizon.
  • Constellation tracing: checked visually for Perseus and Auriga.
  • Fade timing: not judged in headless runs, because the software renderer is too slow for that. Worth a look on a real screen.

star-names.json now has an entry for all 2887 stars in stars.bin:

- The 324 IAU-named stars as before: [index, "Sarin", "Hercules"].
- 1801 more with a Bayer letter or Flamsteed number from the catalogue's
  name field: [index, "ζ Herculis", "Hercules", 0], where 0 says the
  label already names the constellation.
- The other 762, mostly faint southern stars: [index, "HR 104"].

The constellation names move to scripts/constellation-names.mjs, with
their genitives, so the next build script can share them. stars.bin is
unchanged byte for byte. 19 KB gzipped, up from 3 KB; it still loads
after the stars.
scripts/build-constellations.mjs writes apps/site/public/constellations.json:
the 88 stick figures from d3-celestial (Olaf Frohn, BSD-3-Clause, pinned
to commit d2e20e1), each vertex matched to the nearest star in stars.bin
within 0.2°. Keyed by constellation name as the star labels give it, as
flat star index pairs. Serpens' head and tail share one figure. 739 lines;
4 that end on stars fainter than the catalogue's limit are left out.
2.3 KB gzipped. The formatter ignores it, like star-names.json.
- Hover (or tap) any star and its constellation draws itself outward
  from that star, line by line, then fades a moment after the pointer
  leaves. Moving to another star of the same constellation keeps it.
- The worker projects the figure on each pick: lines follow the great
  circle in half-degree steps, stop 6 px short of each star, and break
  wherever they pass below the horizon or behind the skyline. The page
  draws them as SVG polylines under the cards; nothing runs until a
  hover.
- Every star the sky draws now has a label: its IAU name with the
  constellation ("Sarin · Hercules"), else its designation ("ζ Herculis").
- Tooltips rise into place out of a soft blur on the theme's enter
  timing and fade out, instead of popping. Reduced motion keeps only the
  fade.
- The popover credits d3-celestial for the figures.
On hover or focus a card's border brightens and a soft glow fades in on
the theme's enter timing; it fades back quicker so moving between cards
leaves no trail. The Docs and GitHub buttons do the same, with the glow
on its own layer so it never fights the focus ring's box-shadow.
The header set its own border to the bottom edge, but the glass panel's
hairline (::before) still outlined all four sides and its top highlight
(::after) drew a line along the top. Both are off for the header.

@baldurpan baldurpan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. I checked the build scripts against the Bright Star Catalogue and the pinned d3-celestial file:

  • The Greek-letter map and the superscript digits cover every Bayer name in the catalogue.
  • Every figure vertex lands within 0.6′ of its star.
  • Every constellation in star-names.json has a figure.

The header fix in 5e5f023 looks right too.

I found two things, both inline: 20 figure stars that draw nothing when you hover them, and lines that stay where they were drawn when the view changes. I'll approve once both are settled, whether you fix them or answer them.

Comment thread apps/site/src/scripts/aurora.worker.ts Outdated
Comment thread apps/site/src/components/Aurora.astro
…the sky

From review:

- 20 stars in the stick figures have no Bayer letter or Flamsteed number,
  so their label ("HR 3579") names no constellation and hovering them drew
  nothing. The worker now maps each figure star to its figure when the
  figures load and falls back to it. Each of the 20 is in one figure only.
- Lines were placed once, in screen pixels, so they stayed behind after a
  resize or rotation and drifted off their stars as the sky turned. The
  worker now follows the picked object: after a resize and on each
  once-a-second sky refresh it picks it again where it is drawn now, or
  answers null once it is not drawn. The page moves the existing lines
  in place without drawing them again, and tells the worker to stop
  following once nothing is shown. The tooltip follows the same way.

@baldurpan baldurpan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving at 11550c6. Both findings are fixed: figure stars that have no constellation now draw their figure, and the lines and the label follow the sky after a resize and as it turns. I read the whole diff of 11550c6 and found nothing new. CI passes.

@craig-o-curtis
craig-o-curtis merged commit 2f0418a into main Oct 23, 2026
1 check passed
@craig-o-curtis
craig-o-curtis deleted the feat/sky-fades-constellations branch October 23, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants