Created
July 2, 2024 09:11
-
-
Save baslie/acd1f0a1cdb6c49ce65eca347ecca0fe to your computer and use it in GitHub Desktop.
Плавный скролл по странице
This file contains 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
<!-- Плавный скролл по странице --> | |
<script src="https://unpkg.com/@studio-freight/lenis@1.0.42/dist/lenis.min.js"></script> | |
<script> | |
const lenis = new Lenis({ | |
lerp: 0.1, | |
easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), | |
orientation: 'vertical', | |
gestureOrientation: 'vertical', | |
smoothWheel: true, | |
wheelMultiplier: 0.95, | |
syncTouch: false, | |
touchMultiplier: 1.1, | |
infinite: false, | |
}) | |
function raf(time) { | |
lenis.raf(time) | |
requestAnimationFrame(raf) | |
} | |
requestAnimationFrame(raf) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment