The prompt
Extend the existing application with a game-like navigation experience.
Concept:
Create an animated world consisting of multiple islands, each representing a section of the CV. Users should be able to fly between islands and open the corresponding content.
Technical requirements:
- Use the Canvas API with vanilla TypeScript.
- Avoid additional runtime dependencies.
- Preserve the existing Astro page as the accessible baseline.
- Treat the interactive world as a progressive enhancement layer.
- Provide equivalent keyboard and screen reader navigation.
- Respect prefers-reduced-motion.
- Ensure content remains accessible without JavaScript.
- Maintain existing performance and accessibility targets.
What worked
Introduced a lightweight canvas-based navigation layer without replacing the underlying document architecture.
The implementation uses native TypeScript and browser rendering APIs, avoiding additional frameworks or rendering dependencies.
Each island maps to an existing content section, which opens in an associated panel. A parallel island-navigation list provides equivalent access for keyboard and assistive technology users.
The application falls back to the standard page when JavaScript is unavailable or reduced motion is preferred. Lighthouse continued to report a score of 100.
What I changed
Addressed a CSP limitation involving the inline bootstrap script responsible for selecting the initial rendering mode.
Astro automatically hashes scripts managed by its build pipeline, but manually inlined scripts require explicit handling. The bootstrap script's hash is now generated from the same source used to inline it, ensuring consistency between the executable content and CSP declaration.
The bootstrap script is positioned after the CSP meta element to ensure the policy applies during execution.
Also corrected the initial navigation state: the proximity detection previously triggered a "Land on Home" action immediately after departure. The navigation controller now excludes the island the player has just left until the departure state has completed.