New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lenis

Package Overview
Dependencies
Maintainers
2
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lenis - npm Package Compare versions

Comparing version 1.1.14-dev.0 to 1.1.14-dev.3

4

package.json
{
"name": "lenis",
"version": "1.1.14-dev.0",
"version": "1.1.14-dev.3",
"type": "module",

@@ -40,3 +40,3 @@ "sideEffects": false,

"postversion": "pnpm build && pnpm readme",
"publish": "npm publish",
"publish:main": "npm publish",
"publish:dev": "npm publish --tag dev"

@@ -43,0 +43,0 @@ },

@@ -59,14 +59,18 @@ [![LENIS](https://assets.darkroom.engineering/lenis/header.png)](https://github.com/darkroomengineering/lenis)

```js
const lenis = new Lenis()
// Initialize Lenis
const lenis = new Lenis();
// Listen for the scroll event and log the event data
lenis.on('scroll', (e) => {
console.log(e)
})
console.log(e);
});
// Use requestAnimationFrame to continuously update the scroll
function raf(time) {
lenis.raf(time)
requestAnimationFrame(raf)
lenis.raf(time);
requestAnimationFrame(raf);
}
requestAnimationFrame(raf)
requestAnimationFrame(raf);
```

@@ -112,15 +116,22 @@

```js
const lenis = new Lenis()
// Initialize a new Lenis instance for smooth scrolling
const lenis = new Lenis();
// Listen for the 'scroll' event and log the event data to the console
lenis.on('scroll', (e) => {
console.log(e)
})
console.log(e);
});
lenis.on('scroll', ScrollTrigger.update)
// Synchronize Lenis scrolling with GSAP's ScrollTrigger plugin
lenis.on('scroll', ScrollTrigger.update);
gsap.ticker.add((time)=>{
lenis.raf(time * 1000)
})
// Add Lenis's requestAnimationFrame (raf) method to GSAP's ticker
// This ensures Lenis's smooth scroll animation updates on each GSAP tick
gsap.ticker.add((time) => {
lenis.raf(time * 1000); // Convert time from seconds to milliseconds
});
gsap.ticker.lagSmoothing(0)
// Disable lag smoothing in GSAP to prevent any delay in scroll animations
gsap.ticker.lagSmoothing(0);
```

@@ -152,3 +163,3 @@

| `syncTouchLerp` | `number` | `0.075` | Lerp applied during `syncTouch` inertia |
| `touchInertiaMultiplier` | `number` | `35` | Manage the the strength of `syncTouch` inertia |
| `touchInertiaMultiplier` | `number` | `35` | Manage the strength of syncTouch inertia |
| `wheelMultiplier` | `number` | `1` | The multiplier to use for mouse wheel events |

@@ -155,0 +166,0 @@ | `touchMultiplier` | `number` | `1` | The multiplier to use for touch events |

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc