Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stianlarsen/react-light-beam

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stianlarsen/react-light-beam - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

24

dist/index.js

@@ -49,3 +49,3 @@ "use strict";

(0, react_1.useEffect)(() => {
if (bodyElement) {
if (bodyElement && typeof window !== "undefined") {
const handleScroll = () => {

@@ -69,9 +69,10 @@ if (elementRef.current) {

// Attach scroll and resize event listeners
bodyElement.addEventListener("scroll", handleScroll);
window.addEventListener("resize", handleScroll);
const handleScrollThrottled = throttle(handleScroll); // Approx 60fps
bodyElement.addEventListener("scroll", handleScrollThrottled);
window.addEventListener("resize", handleScrollThrottled);
// Initial call to handleScroll to set initial state
handleScroll();
return () => {
bodyElement.removeEventListener("scroll", handleScroll);
window.removeEventListener("resize", handleScroll);
bodyElement.removeEventListener("scroll", handleScrollThrottled);
window.removeEventListener("resize", handleScrollThrottled);
};

@@ -96,4 +97,17 @@ }

WebkitMaskImage: maskImage,
willChange: "background, opacity",
}, ref: elementRef, id: id, className: `lightBeam ${className} ${lightBeam_module_css_1.default.react__light__beam}` }));
};
exports.LightBeam = LightBeam;
const throttle = (func) => {
let ticking = false;
return function (...args) {
if (!ticking) {
requestAnimationFrame(() => {
func.apply(this, args);
ticking = false;
});
ticking = true;
}
};
};
{
"name": "@stianlarsen/react-light-beam",
"version": "1.0.8",
"version": "1.0.9",
"description": "A customizable React component that creates a light beam effect using conic gradients. Supports dark mode and various customization options.",

@@ -43,3 +43,4 @@ "main": "dist/index.js",

"react": "^18",
"react-dom": "^18"
"react-dom": "^18",
"@emotion/is-prop-valid": "^1.3.1"
},

@@ -53,5 +54,4 @@ "devDependencies": {

"dependencies": {
"@emotion/is-prop-valid": "^1.3.1",
"framer-motion": "^11.11.1"
}
}

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