Milestone toasts at distance thresholds (closes #11)#20
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Closes #11. When the rocket crosses one of the curated AU thresholds, a celebratory toast slides into view above the rocket for ~3 seconds: 100 AU → Past Pluto 1,000 AU → Through the heliosphere 10,000 AU → Into the Oort cloud 100,000 AU → One light-year out - src/milestones.js: thresholds + edge detection. fired Set guarantees one toast per threshold per session — reload to see them again. - index.html: new #milestone-toast element with two spans (distance + label). aria-live="polite" so a screen reader announces it without interrupting. - styles/main.css: prominent treatment — primary-color border + 32px glow, larger type than the regular HUD chrome, but still pointer-events: none and centered above the rocket so it never blocks gameplay. 480px media query trims sizes for phones. - main.js: flashMilestone() helper following the same pattern as flashNearMiss (force-reflow + class toggle for transition, hide-then- remove timers). Wired into the frame loop after distanceAU is updated. Each milestone fires a `milestone-reached` Umami event with {au} so we can see how far players actually get. - README: milestones.js added to the module table; milestone-reached added to the analytics table. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ff78322 to
83c5e7c
Compare
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
When the rocket crosses one of four curated AU thresholds, a primary-coloured toast appears above the ship for ~3s. Each milestone fires once per session.
Thresholds
Visual
Analytics
Each milestone reached fires a
milestone-reachedUmami event with{ au }.Test plan