Landing page with Parallax & Smooth Scroll using Lenis and Framer Motion

Поделиться
HTML-код
  • Опубликовано: 14 окт 2024

Комментарии • 22

  • @tekemutau6583
    @tekemutau6583 3 месяца назад

    Hi @Built With Code,
    Thank you for your amazing videos! Have you done a video on how to implement Lenis scroll with the Next.js app router?

    • @tekemutau6583
      @tekemutau6583 3 месяца назад

      is this how its done by creating a component:
      "use client";
      import { ReactLenis } from "@studio-freight/react-lenis";
      function SmoothScrolling({ children }) {
      return (

      {children}

      );
      }
      export default SmoothScrolling;

    • @builtwithcode
      @builtwithcode  3 месяца назад

      Haven't used the ReactLenis component, but seems like it could work. You can also use the technique from the video (setting up in useEffect) and just convert the surround page to a client component.

  • @EricMalek
    @EricMalek 6 месяцев назад

    Your stuff is really good. Keep it coming and thanks for the contribution!

  • @RedVelocityTV
    @RedVelocityTV 7 месяцев назад

    This was an amazing vid. Glad it randomly popped up on my TL

  • @ayushsharma413
    @ayushsharma413 8 месяцев назад

    Really informative! You earned a sub, sir!

  • @95mino
    @95mino 8 месяцев назад

    great tutorial, explained really well !

  • @manuelbarreiro9596
    @manuelbarreiro9596 4 месяца назад

    Amazing! Great video bro

  • @nahuelscheytt7623
    @nahuelscheytt7623 8 месяцев назад

    nice lib for smooth-scroll, works with nextjs 14 (app router). I developed an alternative with framer-motion but it is more complex. great work

    • @builtwithcode
      @builtwithcode  8 месяцев назад

      Lenis is a great plug-and-play library. Much easier than implementing in Framer Motion :)

    • @tekemutau6583
      @tekemutau6583 3 месяца назад

      Hi @nahuelscheytt,
      I've encountered challenges implementing Lenis smooth scrolling with the Next.js 14 app router. Could you please provide some guidance on how to set it up with the app router?
      Thanks in advance!

    • @nahuelscheytt7623
      @nahuelscheytt7623 3 месяца назад

      ​@@tekemutau6583 Lenis has integrated his library into one, the new library supports javascript, react and gsap. So, this works fine in next.js app router:
      "use client"
      import Lenis from "lenis"
      import { useEffect } from "react"
      export default function HomePage() {
      useEffect(() => {
      const lenis = new Lenis()
      function raf(time: number) {
      lenis.raf(time)
      requestAnimationFrame(raf)
      }
      requestAnimationFrame(raf)
      })
      return
      }

  • @andrewii23
    @andrewii23 8 месяцев назад +1

    Hidden gem 😢😢

  • @marioviegas8066
    @marioviegas8066 8 месяцев назад

    Hey, great video but I have a question if I use lenis the page scrolls smoothly but when I try to use the Links with the hrefs to the specific ids of other pages and use the scroll-behavior: smooth the lenis stops working. Any idea on how to keep that smooth scrolling between ids without breaking lenis?

    • @builtwithcode
      @builtwithcode  8 месяцев назад +1

      Oh that's an interesting edge case. Probably related to how Lenis overrides the scroll on the parent tag, so setting scroll-behavior messes with that. I found this SO post that offers up a couple potential solutions: stackoverflow.com/questions/77387611/smooth-scroll-doesnt-work-with-lenis-when-link-with-id-clicked

    • @marioviegas8066
      @marioviegas8066 7 месяцев назад +1

      @@builtwithcode Really appreciate the response. I ended up not going with those solutions, so I will leave here what worked for me in case anyone has the same problem.
      Since we are using react I decided to use react-scroll lib:
      import { Link, animateScroll as scroll } from 'react-scroll';
      And then simply replace the tags with .
      This way the smooth scrolling to the id's will work with lenis-scroll without any problem.

  • @ahmedsaed26
    @ahmedsaed26 8 месяцев назад

    Amazing video ❤

  • @agustinmolina1027
    @agustinmolina1027 8 месяцев назад

    top 💯

  • @mma.moment
    @mma.moment 8 месяцев назад

    Only thing missing is responsive Navigation bar

    • @builtwithcode
      @builtwithcode  8 месяцев назад +2

      Stay tuned for some videos on navigation bars / menus