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

react-light-marquee

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-light-marquee - npm Package Compare versions

Comparing version 0.1.10 to 0.1.11

39

dist/index.js

@@ -51,31 +51,18 @@ // src/Marquee/index.tsx

};
var getDistanceBetweenEdges = (direction, startRect, endRect) => {
let distance = startRect.bottom - endRect.top;
if (direction === "left") distance = endRect.right - startRect.left;
else if (direction === "right") distance = startRect.right - endRect.left;
else if (direction === "up") distance = endRect.bottom - startRect.top;
return distance;
};
var getContentSize = (children, direction) => {
const firstChildRect = children[0].getBoundingClientRect();
const lastChildRect = children[children.length - 1].getBoundingClientRect();
if (!firstChildRect || !lastChildRect) return 0;
if (direction === "left") {
return lastChildRect.right - firstChildRect.left;
}
if (direction === "right") {
return firstChildRect.right - lastChildRect.left;
}
if (direction === "up") {
return lastChildRect.bottom - firstChildRect.top;
}
return firstChildRect.bottom - lastChildRect.top;
return getDistanceBetweenEdges(direction, firstChildRect, lastChildRect);
};
var getSlideEndingEdge = (node, direction) => {
const parentRect = node.parentNode?.getBoundingClientRect();
if (!parentRect) return 0;
const slideRect = node.getBoundingClientRect();
if (direction === "left") {
return slideRect.right - parentRect.left;
}
if (direction === "right") {
return parentRect.right - slideRect.left;
}
if (direction === "up") {
return slideRect.bottom - parentRect.top;
}
return parentRect.bottom - slideRect.top;
var getSlideEndingEdge = (parentElement, slideElement, direction) => {
const parentRect = parentElement.getBoundingClientRect();
const slideRect = slideElement.getBoundingClientRect();
return getDistanceBetweenEdges(direction, parentRect, slideRect);
};

@@ -95,3 +82,3 @@ var getNodeSize = (node, direction) => {

childElements.forEach((slide) => {
slideEdges.push(getSlideEndingEdge(slide, direction));
slideEdges.push(getSlideEndingEdge(wrapper, slide, direction));
needsReplication || (needsReplication = contentSize - getNodeSize(slide, direction) < wrapperSize);

@@ -98,0 +85,0 @@ });

{
"name": "react-light-marquee",
"version": "0.1.10",
"version": "0.1.11",
"private": false,

@@ -5,0 +5,0 @@ "type": "module",

Sorry, the diff of this file is not supported yet

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