{"version":3,"file":"LogoTicker.DUN6Xctd.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/kDZevmvLswF1iVCba4Gy/5oTIILJFbWrdi2HtK4Uq/LogoTicker.js"],"sourcesContent":["// Bar pass logos like a ticker\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion,useAnimationFrame}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function LogoTicker(props){const{components=[],speed=50,gap=40,itemHeight=60,backgroundColor=\"#FFFFFF\",pauseOnHover=true}=props;const[offset,setOffset]=useState(0);const[isPaused,setIsPaused]=useState(false);const containerRef=useRef(null);const contentRef=useRef(null);const[contentWidth,setContentWidth]=useState(0);const isStatic=RenderTarget.current()===RenderTarget.thumbnail;useEffect(()=>{if(typeof window===\"undefined\"||!contentRef.current)return;const updateWidth=()=>{if(contentRef.current){// Calculate total width of one set of components including gaps\nconst children=Array.from(contentRef.current.children).slice(0,components.length);let totalWidth=0;children.forEach(child=>{totalWidth+=child.offsetWidth;});totalWidth+=gap*(components.length-1);startTransition(()=>{setContentWidth(totalWidth);});}};// Use setTimeout to ensure components are rendered\nconst timer=setTimeout(updateWidth,100);window.addEventListener(\"resize\",updateWidth);return()=>{clearTimeout(timer);window.removeEventListener(\"resize\",updateWidth);};},[components,gap]);useAnimationFrame((time,delta)=>{if(isStatic||isPaused||!contentWidth)return;startTransition(()=>{setOffset(prev=>{const newOffset=prev+speed*delta/1e3;// Seamless loop: reset when we've scrolled one full set\nreturn newOffset%contentWidth;});});});const handleMouseEnter=()=>{if(pauseOnHover&&!isStatic){startTransition(()=>setIsPaused(true));}};const handleMouseLeave=()=>{if(pauseOnHover&&!isStatic){startTransition(()=>setIsPaused(false));}};// Duplicate components multiple times for seamless loop\nconst duplicatedComponents=[...components,...components,...components];return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",backgroundColor,overflow:\"hidden\",position:\"relative\",display:\"flex\",alignItems:\"center\"},onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,children:/*#__PURE__*/_jsx(motion.div,{ref:contentRef,style:{display:\"flex\",gap:`${gap}px`,position:\"absolute\",left:0,transform:`translateX(-${offset}px)`,willChange:\"transform\"},children:duplicatedComponents.map((component,index)=>/*#__PURE__*/_jsx(\"div\",{style:{height:`${itemHeight}px`,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",flexShrink:0},children:component},index))})});}addPropertyControls(LogoTicker,{components:{type:ControlType.Array,title:\"Components\",control:{type:ControlType.ComponentInstance},maxCount:20},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:50,min:10,max:200,step:10,unit:\"px/s\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:40,min:10,max:100,step:5,unit:\"px\"},itemHeight:{type:ControlType.Number,title:\"Item Height\",defaultValue:60,min:20,max:200,step:5,unit:\"px\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},pauseOnHover:{type:ControlType.Boolean,title:\"Pause on Hover\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LogoTicker\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LogoTicker.map"],"mappings":"4QAIG,SAAwB,EAAW,EAAM,CAAC,GAAK,CAAC,aAAW,CAAC,EAAE,QAAM,GAAG,MAAI,GAAG,aAAW,GAAG,kBAAgB,UAAU,eAAa,IAAM,EAAW,CAAC,EAAO,GAAWA,EAAS,CAAC,EAAO,CAAC,EAAS,GAAaA,EAAS,EAAK,EAAQ,EAAaC,EAAO,IAAI,EAA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