Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import via CDN #4

Closed
thagxt opened this issue Jul 16, 2022 · 5 comments
Closed

Import via CDN #4

thagxt opened this issue Jul 16, 2022 · 5 comments

Comments

@thagxt
Copy link

thagxt commented Jul 16, 2022

Can you provide a CDN URL so we can import without having to use npm etc.

Thank you for your work.

@MAGGIx1404
Copy link

Can you provide a CDN URL so we can import without having to use npm etc.

Thank you for your work.

https://cdn.jsdelivr.net/npm/@studio-freight/lenis@0.1.12/dist/lenis.esm.js

https://cdn.jsdelivr.net/npm/@studio-freight/lenis@0.1.12/dist/lenis.modern.js

https://cdn.jsdelivr.net/npm/@studio-freight/lenis@0.1.12/dist/lenis.umd.js

@arzafran
Copy link
Contributor

Can you provide a CDN URL so we can import without having to use npm etc.

Thank you for your work.

closing this.

thanks @MAGGIx1404!

@haroldao
Copy link
Contributor

Nice🍾🍾🤩

@haroldao
Copy link
Contributor

image
I have this error 😭😶...

@haroldao
Copy link
Contributor

On my side, these links are not working ...
but I found an alternative solution that is working for me...

<script type="module">
      import Lenis from "https://cdn.skypack.dev/@studio-freight/lenis@0.1.12";

      const lenis = new Lenis({
        lerp: 0.1,
        smooth: true,
        direction: 'vertical',
      })

      //get scroll value
      lenis.on('scroll', ({ scroll, limit }) => {
        console.log({ scroll, limit })
      })

      function raf() {
        lenis.raf()
        requestAnimationFrame(raf)
      }

      requestAnimationFrame(raf)
    </script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants