feat: daybreak finale turns the contact arrival into a sunrise with a dawn chord
This commit is contained in:
21
src/journey/dawn.ts
Normal file
21
src/journey/dawn.ts
Normal 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';
|
||||
}
|
||||
Reference in New Issue
Block a user