fix(perf): eliminate double-damping lag, layout thrashing, and optimize horizontal scroll speed

This commit is contained in:
2026-11-03 17:17:02 +05:30
parent 6cba2256b4
commit 3bdd5b6d8a
3 changed files with 224 additions and 139 deletions
+3 -3
View File
@@ -9,13 +9,13 @@ export function SmoothScroll() {
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return;
const lenis = new Lenis({
duration: 1.15,
duration: 0.95,
easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)),
orientation: 'vertical',
gestureOrientation: 'vertical',
gestureOrientation: 'both', // Allows trackpad horizontal and vertical gestures
smoothWheel: true,
syncTouch: false, // Preserves hardware 120Hz momentum touch scrolling on phones & tablets
wheelMultiplier: 0.95,
wheelMultiplier: 1.0,
touchMultiplier: 1.0,
});