react-fast-marquee
Advanced tools
Comparing version 1.0.9 to 1.0.10
@@ -57,3 +57,5 @@ | ||
var _t = React.useState(0), marqueeWidth = _t[0], setMarqueeWidth = _t[1]; | ||
var _u = React.useState(0), duration = _u[0], setDuration = _u[1]; | ||
var _u = React.useState(0), containerOffsetWidth = _u[0], setContainerOffsetWidth = _u[1]; | ||
var _v = React.useState(0), marqueeOffsetWidth = _v[0], setMarqueeOffsetWidth = _v[1]; | ||
var _w = React.useState(0), duration = _w[0], setDuration = _w[1]; | ||
var containerRef = React.useRef(null); | ||
@@ -66,5 +68,16 @@ var marqueeRef = React.useRef(null); | ||
setMarqueeWidth(marqueeRef.current.getBoundingClientRect().width); | ||
setContainerOffsetWidth(containerRef.current.offsetWidth); | ||
setMarqueeOffsetWidth(marqueeRef.current.offsetWidth); | ||
} | ||
/* Set duration of animation based off speed */ | ||
setDuration(marqueeWidth / speed); | ||
console.log("Container Width:" + containerWidth); | ||
console.log("Marquee Width:" + marqueeWidth); | ||
console.log("Container Offset Width:" + containerOffsetWidth); | ||
console.log("Marquee Offset Width:" + marqueeOffsetWidth); | ||
// marqueeWidth < containerWidth ? containerWidth - marqueeWidth : 0 | ||
if (marqueeWidth < containerWidth) { | ||
setDuration(containerWidth / speed); | ||
} | ||
else { | ||
setDuration(marqueeWidth / speed); | ||
} | ||
}); | ||
@@ -71,0 +84,0 @@ // Gradient color in an unfinished rgba format |
{ | ||
"name": "react-fast-marquee", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25195
181