fix: close phase 2 journey blockers
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user