Last active
April 23, 2024 12:54
-
-
Save johnmccole/f568c2f23a8a9bff30b481e10ef7be7f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// include Lenis script where appropriate (e.g. enqueued in setup.php). | |
// https://unpkg.com/[email protected]/dist/lenis.min.js | |
// Lenis settings | |
const lenis = new Lenis({ | |
duration: 1.2, | |
easing: (t) => (t === 1 ? 1 : 1 - Math.pow(2, -10 * t)), | |
direction: "vertical", | |
gestureDirection: "vertical", | |
smooth: true, | |
smoothTouch: true, | |
touchMultiplier: 2, | |
}); | |
function raf(time) { | |
lenis.raf(time); | |
requestAnimationFrame(raf); | |
} | |
requestAnimationFrame(raf); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment