feat: cursor-steered headlights light the hero name, plates and world
This commit is contained in:
@@ -16,6 +16,7 @@ import { useAdaptiveQuality } from '@/composables/useAdaptiveQuality';
|
||||
import { useAudioEngine } from '@/composables/useAudioEngine';
|
||||
import { useAudioIntent } from '@/composables/useAudioIntent';
|
||||
import { useCardEntrances } from '@/composables/useCardEntrances';
|
||||
import { useHeadlightBeam } from '@/composables/useHeadlightBeam';
|
||||
import { useJourneySections } from '@/composables/useJourneySections';
|
||||
import { useKeyboardNavigation } from '@/composables/useKeyboardNavigation';
|
||||
import { useMaintenanceWindow } from '@/composables/useMaintenanceWindow';
|
||||
@@ -140,6 +141,12 @@ const pinnedPerformanceTier = requestedPerformanceTier === 'high' || requestedPe
|
||||
? requestedPerformanceTier
|
||||
: null;
|
||||
const actualQuality = computed(() => pinnedPerformanceTier ?? adaptive.snapshot.value.actual);
|
||||
/* HIGH BEAM: the cursor is the car's headlights, in the scene and on the page. */
|
||||
const headlight = useHeadlightBeam({
|
||||
motionAllowed: computed(() => motion.policy.value.allowSceneRequest && pageLifecycle.value === 'active'),
|
||||
quality: actualQuality,
|
||||
activeSectionId: () => journey.value.activeSectionId,
|
||||
});
|
||||
const activeSectionLabel = computed(() => sectionLabel(journey.value.activeSectionId));
|
||||
const serverDefaultPolicy: MotionPolicy = {
|
||||
allowSceneRequest: false,
|
||||
@@ -152,6 +159,7 @@ const displayedSceneState = computed(() => controlsReady.value ? sceneState.valu
|
||||
let removePageListeners = (): void => {};
|
||||
|
||||
const sampleSceneFrame = (start: number, end: number): void => {
|
||||
headlight.sceneFrame();
|
||||
if (pinnedPerformanceTier === null) adaptive.sampleFrame(start, end);
|
||||
if (TEST_BUILD) window.__PORTFOLIO_PERFORMANCE__?.recordSceneFrame(start, end);
|
||||
};
|
||||
@@ -253,6 +261,7 @@ onUnmounted(() => removePageListeners());
|
||||
:scene-description="content.sceneDescription"
|
||||
:credit="`${content.identity.name} · ${content.identity.role} · ${content.identity.location.city}, ${content.identity.location.country}`"
|
||||
:sample-frame="sampleSceneFrame"
|
||||
:sample-beam="headlight.sampleBeam"
|
||||
@state-change="updateSceneState"
|
||||
/>
|
||||
<JourneyHud
|
||||
|
||||
Reference in New Issue
Block a user