Add lenis.css style and lenisSmoothScroll.js script
This commit is contained in:
parent
49300273be
commit
b03d4658b9
3 changed files with 33 additions and 7 deletions
7
public/scripts/vendor/clipboard.min.js
vendored
7
public/scripts/vendor/clipboard.min.js
vendored
File diff suppressed because one or more lines are too long
13
src/assets/scripts/lenisSmoothScroll.js
Normal file
13
src/assets/scripts/lenisSmoothScroll.js
Normal 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);
|
20
src/assets/styles/lenis.css
Normal file
20
src/assets/styles/lenis.css
Normal 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;
|
||||
}
|
Loading…
Add table
Reference in a new issue