Coder Social home page Coder Social logo

brunos3d / nextjs-with-locomotive-scroll-example Goto Github PK

View Code? Open in Web Editor NEW
52.0 3.0 13.0 73 KB

▲ NEXT.JS - Example project using Next.js with Locomotive Scroll. (experimental)

Home Page: https://nextjs-with-locomotive-scroll-example.vercel.app/

License: MIT License

JavaScript 1.09% TypeScript 73.31% CSS 25.60%
nextjs locomotive-scroll parallax example template

nextjs-with-locomotive-scroll-example's Introduction

nextjs-with-locomotive-scroll-example

🔺 NEXT.JS - Example project using Next.js with Locomotive Scroll. (experimental)

🚀 Demo

🚀 Getting started

The best way to start with this template is using create-next-app.

npx create-next-app ts-next -e https://github.com/brunos3d/nextjs-with-locomotive-scroll-example

or

yarn create next-app -e https://github.com/brunos3d/nextjs-with-locomotive-scroll-example

📝 License

This project is licensed under the MIT License - see the LICENSE.md file for more information.

nextjs-with-locomotive-scroll-example's People

Contributors

brunos3d avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nextjs-with-locomotive-scroll-example's Issues

Use without data-scroll-container

I'm also using GSAP’s scrolltrigger which does not allow for the use of any data-scroll attributes. If I remove data-scroll-container from _app.tsx, however, it breaks the Locomotive Scroll and returns "Cannot read properties of null (reading 'offsetHeight'). I have instead already applied the "el" option:

<LocomotiveScrollProvider
        options={{
          el: containerRef.current,
          smooth: true,
        smartphone: {
          smooth: true,
        },
        tablet: {
          smooth: true,
        },
        }}
        watch={[]}
        location={asPath}
      onLocationChange={(scroll: any) =>
        scroll.scrollTo(0, { duration: 0, disableLerp: true })
      }
      
      containerRef={containerRef}
      >
              <div ref={containerRef}>

but that doesn't seem to work either. Is there another way?

Unable to use any other Animation Library

I am encountering an issue where I am unable to use any other animation library that observes the scroll with Locomotive. Specifically, I wanted to use Scrollreveal.js but it doesn't work after implementing the RLSProvider. Is there any solution or workaround available for this problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.