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

react-fast-marquee

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-fast-marquee - npm Package Compare versions

Comparing version 1.3.2 to 1.3.3

31

dist/index.js

@@ -56,20 +56,15 @@

var _u = React.useState(0), marqueeWidth = _u[0], setMarqueeWidth = _u[1];
var _v = React.useState(0), duration = _v[0], setDuration = _v[1];
var _w = React.useState(false), isMounted = _w[0], setIsMounted = _w[1];
var _v = React.useState(false), isMounted = _v[0], setIsMounted = _v[1];
var containerRef = React.useRef(null);
var marqueeRef = React.useRef(null);
var calculateWidth = function () {
// Find width of container and width of marquee
if (marqueeRef.current && containerRef.current) {
setContainerWidth(containerRef.current.getBoundingClientRect().width);
setMarqueeWidth(marqueeRef.current.getBoundingClientRect().width);
}
if (marqueeWidth < containerWidth) {
setDuration(containerWidth / speed);
}
else {
setDuration(marqueeWidth / speed);
}
};
React.useEffect(function () {
if (!isMounted)
return;
var calculateWidth = function () {
// Find width of container and width of marquee
if (marqueeRef.current && containerRef.current) {
setContainerWidth(containerRef.current.getBoundingClientRect().width);
setMarqueeWidth(marqueeRef.current.getBoundingClientRect().width);
}
};
calculateWidth();

@@ -81,3 +76,3 @@ // Rerender on window resize

};
});
}, [isMounted]);
React.useEffect(function () {

@@ -88,2 +83,6 @@ setIsMounted(true);

var rgbaGradientColor = "rgba(" + gradientColor[0] + ", " + gradientColor[1] + ", " + gradientColor[2];
// Animation duration
var duration = marqueeWidth < containerWidth
? containerWidth / speed
: marqueeWidth / speed;
return (React__default['default'].createElement(React.Fragment, null, !isMounted ? null : (React__default['default'].createElement("div", { ref: containerRef, style: __assign(__assign({}, style), (_b = {}, _b["--pause-on-hover"] = pauseOnHover ? "paused" : "running", _b["--pause-on-click"] = pauseOnClick ? "paused" : "running", _b)), className: className + " marquee-container" },

@@ -90,0 +89,0 @@ gradient && (React__default['default'].createElement("div", { style: (_c = {},

{
"name": "react-fast-marquee",
"version": "1.3.2",
"version": "1.3.3",
"description": "A lightweight React component that utilizes the power of CSS animations to create silky smooth marquees.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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