feat: layer the nightdrive sky and atmosphere

This commit is contained in:
2026-09-02 14:52:03 +03:00
parent 3c932cb840
commit 5c52de9134
15 changed files with 801 additions and 168 deletions

View File

@@ -100,7 +100,7 @@ describe('scroll drive controller', () => {
expect(snapshot.driveSpeed).toBeCloseTo(0.9490152503018645, 14);
});
it('resets transient velocity and establishes a baseline after a gap over 250 ms', () => {
it('resets transient velocity and establishes a baseline after a stationary gap over 250 ms', () => {
const controller = createScrollDriveController();
controller.sample({ scrollY: 0, now: 0, maxScrollY: 1000 });
controller.sample({ scrollY: 500, now: 100, maxScrollY: 1000 });
@@ -115,6 +115,19 @@ describe('scroll drive controller', () => {
expect(controller.sample({ scrollY: 600, now: 451, maxScrollY: 1000 }).direction).toBe(1);
});
it('preserves signed movement while dropping acceleration on the first delayed sample', () => {
const controller = createScrollDriveController();
controller.sample({ scrollY: 0, now: 0, maxScrollY: 1000 });
expect(controller.sample({ scrollY: 500, now: 351, maxScrollY: 1000 })).toEqual({
scrollY: 500,
routeProgress: 0.5,
direction: 1,
acceleration: 0,
driveSpeed: 0.18,
});
});
it.each([
['downward', 0, 1000, 1],
['upward', 1000, 0, -1],