Lenis smooth scroll is our take on smooth scroll, lightweight, hard working, smooth as butter scroll Recently, the fine people at Studio Freight published the Smooth Scroll library, allowing you to finally
Step 1 – Install the lib
In a Code Block (or you can use a Snippet Manager if you prefer), add the following line in the PHP panel:
<script src="https://cdn.jsdelivr.net/gh/studio-freight/lenis@latest/bundled/lenis.js"></script>
Step 2 – Install any Worpress Plugin I am Using Advanced Scripts,
Add This JS
jQuery(document).ready(function () {
const lenis = new Lenis({
duration: 2,
easing: (t) => (t === 1 ? 1 : 1 - Math.pow(2, -10 * t)),
direction: "vertical",
gestureDirection: "vertical",
smooth: true,
smoothTouch: false,
touchMultiplier: 2,
});
function raf(time) {
lenis.raf(time);
requestAnimationFrame(raf);
}
requestAnimationFrame(raf);
});


Leave a Reply