{"version":3,"file":"InfiniteCarousel.CJCdE-SN.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/k2TZG7Redu759J5nq3K7/Sc37V4whfLTBi3EML1cF/InfiniteCarousel.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useRef,useState,useEffect}from\"react\";export default function InfiniteCarousel({speed=20,direction=\"left\",gap=16,children}){const containerRef=useRef(null);const[offset,setOffset]=useState(null);const id=useRef(`scroll_${Math.random().toString(36).slice(2,7)}`).current;const animName=`${id}_${direction}`;useEffect(()=>{if(!containerRef.current)return;const totalWidth=containerRef.current.scrollWidth;const halfWidth=totalWidth/2;setOffset(halfWidth);},[gap,children]);const keyframes=offset!==null?direction===\"left\"?`@keyframes ${animName} {\n                0% { transform: translateX(0px); }\n                100% { transform: translateX(-${offset}px); }\n            }`:`@keyframes ${animName} {\n                0% { transform: translateX(-${offset}px); }\n                100% { transform: translateX(0px); }\n            }`:\"\";const style={display:\"flex\",flexDirection:\"row\",gap:`${gap}px`,animation:offset!==null?`${animName} ${speed}s linear infinite`:\"none\",width:\"max-content\",willChange:\"transform\"};return /*#__PURE__*/_jsxs(\"div\",{style:{overflow:\"hidden\",width:\"100%\"},children:[keyframes&&/*#__PURE__*/_jsx(\"style\",{children:keyframes}),/*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:style,children:children})]});}addPropertyControls(InfiniteCarousel,{speed:{type:ControlType.Number,title:\"Speed (sec)\",defaultValue:20,min:1,max:100},direction:{type:ControlType.Enum,title:\"Orientation\",options:[\"left\",\"right\"],optionTitles:[\"Left\",\"Right\"],defaultValue:\"left\"},gap:{type:ControlType.Number,title:\"Space (px)\",defaultValue:16,min:0,max:100}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"InfiniteCarousel\",\"slots\":[\"children\"],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":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