feat: daybreak finale turns the contact arrival into a sunrise with a dawn chord

This commit is contained in:
2026-10-11 05:32:08 +03:00
parent c9e6ac0f29
commit b6e22a1299
37 changed files with 756 additions and 44 deletions

21
src/journey/dawn.ts Normal file
View File

@@ -0,0 +1,21 @@
/**
* END OF SHIFT: arriving at the destination ends the night. One scalar, dawn
* (0..1), eases in over the outro; the scene derives the sky, the sun and the
* grade from it, and the DOM gets a stepped html[data-dawn] so CSS can key the
* credit and the letterbox tint off it. Shared by the DOM and the lazy scene
* chunk, so it stays tiny and pure.
*/
export type DawnStep = 'night' | 'first-light' | 'sunrise' | 'day';
/** Lower bounds of each step after night. */
export const DAWN_STEPS = { 'first-light': 0.3, sunrise: 0.6, day: 0.95 } as const;
/** The gantry plate's sub-line while parked at the destination. */
export const END_OF_SHIFT_SUBLINE = 'END OF SHIFT · 05:48';
export function dawnStep(dawn: number): DawnStep {
if (!(dawn >= DAWN_STEPS['first-light'])) return 'night';
if (dawn < DAWN_STEPS.sunrise) return 'first-light';
if (dawn < DAWN_STEPS.day) return 'sunrise';
return 'day';
}