feat: integrate authored nightdrive soundtrack

This commit is contained in:
2026-09-04 14:39:28 +03:00
parent eb7f276b91
commit 745fa8169e
39 changed files with 1013 additions and 714 deletions

View File

@@ -0,0 +1,26 @@
import type { AudioJourneyState } from '@/audio/types';
const JOURNEY_MUSIC = Object.freeze({
start: { bias: 'open', entryPhrase: 0 },
profile: { bias: 'open', entryPhrase: 1 },
experience: { bias: 'shadow', entryPhrase: 2 },
infrastructure: { bias: 'shadow', entryPhrase: 3 },
'selected-builds': { bias: 'lift', entryPhrase: 4 },
'additional-work': { bias: 'lift', entryPhrase: 5 },
toolkit: { bias: 'resolve', entryPhrase: 6 },
contact: { bias: 'resolve', entryPhrase: 7 },
} as const);
export function resolveJourneyMusicState(sectionId: string, intensity = 0): AudioJourneyState {
const chapter = Object.hasOwn(JOURNEY_MUSIC, sectionId)
? JOURNEY_MUSIC[sectionId as keyof typeof JOURNEY_MUSIC]
: JOURNEY_MUSIC.start;
const finiteIntensity = Number.isFinite(intensity) ? intensity : 0;
return Object.freeze({
...chapter,
atStart: sectionId === 'start',
intensity: Math.min(1, Math.max(0, finiteIntensity)),
});
}
export const DEFAULT_AUDIO_JOURNEY_STATE = resolveJourneyMusicState('start');