Repository navigation
Conversation
Heyian
marked this pull request as ready for review
November 5, 2026 20:43
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — Canvas-sky rewrite of the Starry Night theme, replacing the per-star DOM field with two canvases plus WAAPI shooting stars.
- Static and twinkle canvases — non-twinkling stars drawn once per layout; twinkling stars redrawn in timer-driven batches (~20/s) with one glow sprite per star size.
- Pure-math core — star field, twinkle envelope, flight geometry, DPR scaling, and motion state isolated in
logic.tswith injected randomness. - Lifecycle controller —
sky.tsowns frames, timers, and canvases, with coalesced resize settle, DPR query re-arming, visibility and reduced-motion handling, and sentinel-driven recoloring. - Bounded mount —
mount.tsgives up after 20 tries instead of hanging the loader, wires resize/visibility/DPR/palette listeners, and removes everything on dispose. - WAAPI shooting stars — exit-aware flight distance with tail clearance, delay on first flight only, pause/resume on visibility, hidden under reduced motion.
- Tests — 51 cases covering counts, envelope shape, geometry, DPR snapping, batch rate, lifecycle, and disposal; all pass and
fmt:checkis clean.
muse-spark-1.3-contributor (free via Pullfrog for OSS) | 𝕏
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Starry Night created one
<div>per 4000 px² of window, and about 1 in 5 of them ran abox-shadowanimation. At 3840×1200 that is 1152 elements and ~100 style recalcs/s, and renderer memory kept growing. This PR replaces them with two canvases and moves the shooting stars to the Web Animations API.Behavior:
MAX_STARS = 1500, so very large windows get a slightly sparser sky.prefers-reduced-motiongives a still sky with no shooting stars.Evidence
Measured on Spotify 1.3.4 / Chrome 151 at 3840×1200, DPR 1, music playing: 60 s warm-up, then 15 s samples over 10 minutes. CPU: 100% = one core.
Visual comparison: the seven skies at 1280×1000, before (left) and after (right).
Tests:
scripts/starry-night-theme.test.mts, 51 cases under node --test + happy-dom, covering:and more.
Merge Danger
Blast Radius: theme-only
--spice-star/--spice-star-glowto something that isn't a valid CSS color (e.g. hex without#) loses the glow. A palette without these variables falls back to white.