Add lenis.css style and lenisSmoothScroll.js script

This commit is contained in:
Emil Gulamov 2024-06-21 19:09:05 +04:00
parent 49300273be
commit b03d4658b9
3 changed files with 33 additions and 7 deletions

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,13 @@
import "@styles/lenis.css";
import Lenis from "lenis";
// Script to handle Lenis library settings for smooth scrolling
const lenis = new Lenis();
function raf(time) {
lenis.raf(time);
requestAnimationFrame(raf);
}
requestAnimationFrame(raf);

View file

@ -0,0 +1,20 @@
html.lenis,
html.lenis body {
height: auto;
}
.lenis.lenis-smooth {
scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
overscroll-behavior: contain;
}
.lenis.lenis-stopped {
overflow: hidden;
}
.lenis.lenis-scrolling iframe {
pointer-events: none;
}