Advertisement
oscarviedma

Código para integrar lenis.js con divi

Feb 4th, 2023
1,122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <script src="https://cdn.jsdelivr.net/gh/studio-freight/lenis@latest/bundled/lenis.js"></script>
  2.  
  3. <script>
  4. const lenis = new Lenis({
  5. duration: 2.2,
  6. easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), // h
  7. direction: 'vertical', // vertical, horizontal
  8. gestureDirection: 'vertical', // vertical, horizontal, both
  9. smooth: true,
  10. mouseMultiplier: 1,
  11. smoothTouch: false,
  12. touchMultiplier: 2,
  13. infinite: false,
  14. });
  15.  
  16. function raf(time) {
  17. lenis.raf(time);
  18. requestAnimationFrame(raf);
  19. }
  20.  
  21. requestAnimationFrame(raf);
  22. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement