fix: close phase 2 journey blockers

This commit is contained in:
2026-09-02 06:04:20 +03:00
parent a86767cdc6
commit 77895c01ff
19 changed files with 378 additions and 26 deletions

View File

@@ -10,6 +10,7 @@ const DECAY_TIME_CONSTANT_MS = 420;
const CRUISE_SPEED = 0.18;
const ACCELERATION_SPEED_RANGE = 0.82;
const BACKGROUND_GAP_MS = 250;
const DECAY_SETTLE_EPSILON = 0.001;
const clamp = (value: number, minimum: number, maximum: number): number =>
Math.min(maximum, Math.max(minimum, value));
@@ -87,6 +88,9 @@ export function createScrollDriveController(): ScrollDriveController {
: DECAY_TIME_CONSTANT_MS;
const alpha = 1 - Math.exp(-elapsedMs / timeConstantMs);
smoothedAcceleration += (impulse - smoothedAcceleration) * alpha;
if (impulse === 0 && smoothedAcceleration < DECAY_SETTLE_EPSILON) {
smoothedAcceleration = 0;
}
previousSample = { ...input };
const direction: -1 | 0 | 1 = deltaY > 0 ? 1 : deltaY < 0 ? -1 : 0;