{"version":3,"file":"LogoLoop.GoGGdeDk.mjs","names":["useRef","useState","useCallback","useMemo","_Fragment"],"sources":["https:/framerusercontent.com/modules/kiKKaJJdLX0YrMmNmubL/0pfNoIh19pmgl9EEXITb/LogoLoop.js"],"sourcesContent":["// Editable partner logo carousel component with support for up to 20 logos\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef,useState,useCallback,useMemo}from\"react\";const ANIMATION_CONFIG={SMOOTH_TAU:.3,MIN_COPIES:2,COPY_HEADROOM:2};const useResizeObserver=(callback,elements)=>{useEffect(()=>{if(typeof window===\"undefined\")return;if(!window.ResizeObserver){const handleResize=()=>callback();window.addEventListener(\"resize\",handleResize);callback();return()=>window.removeEventListener(\"resize\",handleResize);}const observers=elements.map(ref=>{if(!ref.current)return null;const observer=new ResizeObserver(callback);observer.observe(ref.current);return observer;});callback();return()=>{observers.forEach(observer=>observer?.disconnect());};},[callback,elements]);};const useAnimationLoop=(trackRef,targetVelocity,seqWidth,isHovered,pauseOnHover)=>{const rafRef=useRef(null);const lastTimestampRef=useRef(null);const offsetRef=useRef(0);const velocityRef=useRef(0);useEffect(()=>{if(typeof window===\"undefined\")return;const track=trackRef.current;if(!track)return;lastTimestampRef.current=null;const animate=timestamp=>{if(lastTimestampRef.current===null){lastTimestampRef.current=timestamp;velocityRef.current=targetVelocity;}const deltaTime=Math.min(.1,Math.max(0,timestamp-lastTimestampRef.current)/1e3);lastTimestampRef.current=timestamp;const target=isHovered&&pauseOnHover?0:targetVelocity;const easingFactor=1-Math.exp(-deltaTime/ANIMATION_CONFIG.SMOOTH_TAU);velocityRef.current+=(target-velocityRef.current)*easingFactor;offsetRef.current+=velocityRef.current*deltaTime;if(seqWidth>0){offsetRef.current=(offsetRef.current%seqWidth+seqWidth)%seqWidth;}const transform=`translate3d(${-offsetRef.current}px, 0, 0)`;track.style.transform=transform;track.style.webkitTransform=transform;rafRef.current=requestAnimationFrame(animate);};rafRef.current=requestAnimationFrame(animate);return()=>{if(rafRef.current!==null){cancelAnimationFrame(rafRef.current);}};},[targetVelocity,seqWidth,isHovered,pauseOnHover,trackRef]);};/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function LogoLoop(props){const{logos=[{image:{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Partner 1\"}}],speed=120,direction=\"left\",logoHeight=28,gap=32,pauseOnHover=true,fadeOutColor}=props;const containerRef=useRef(null);const trackRef=useRef(null);const seqRef=useRef(null);const[seqWidth,setSeqWidth]=useState(0);const[copyCount,setCopyCount]=useState(ANIMATION_CONFIG.MIN_COPIES);const[isHovered,setIsHovered]=useState(false);const targetVelocity=direction===\"left\"?speed:-speed;const updateDimensions=useCallback(()=>{if(typeof window===\"undefined\")return;const containerWidth=containerRef.current?.clientWidth??0;const sequenceWidth=seqRef.current?.getBoundingClientRect?.().width??0;if(sequenceWidth>0){setSeqWidth(Math.ceil(sequenceWidth));const copiesNeeded=Math.ceil(containerWidth/sequenceWidth)+ANIMATION_CONFIG.COPY_HEADROOM;setCopyCount(Math.max(ANIMATION_CONFIG.MIN_COPIES,copiesNeeded));}},[]);const resizeElements=useMemo(()=>[containerRef,seqRef],[containerRef,seqRef]);useResizeObserver(updateDimensions,resizeElements);useEffect(()=>{if(typeof window===\"undefined\")return;const images=seqRef.current?.querySelectorAll(\"img\")??[];if(images.length===0){updateDimensions();return;}let remainingImages=images.length;const handleImageLoad=()=>{remainingImages-=1;if(remainingImages===0)updateDimensions();};images.forEach(img=>{const htmlImg=img;if(htmlImg.complete){handleImageLoad();}else{htmlImg.addEventListener(\"load\",handleImageLoad,{once:true});htmlImg.addEventListener(\"error\",handleImageLoad,{once:true});}});},[logos,updateDimensions]);const handleInteractionStart=()=>{if(pauseOnHover){setIsHovered(true);}};const handleInteractionEnd=()=>{if(pauseOnHover){setIsHovered(false);}};useEffect(()=>{if(typeof window===\"undefined\"||!trackRef.current)return;const track=trackRef.current;const handleTouchStart=e=>{if(pauseOnHover){setIsHovered(true);}};const handleTouchEnd=e=>{if(pauseOnHover){setIsHovered(false);}};track.addEventListener(\"touchstart\",handleTouchStart,{passive:true});track.addEventListener(\"touchend\",handleTouchEnd,{passive:true});track.addEventListener(\"touchcancel\",handleTouchEnd,{passive:true});return()=>{track.removeEventListener(\"touchstart\",handleTouchStart);track.removeEventListener(\"touchend\",handleTouchEnd);track.removeEventListener(\"touchcancel\",handleTouchEnd);};},[pauseOnHover]);useAnimationLoop(trackRef,targetVelocity,seqWidth,isHovered,pauseOnHover);const logoLists=Array.from({length:copyCount},(_,copyIndex)=>/*#__PURE__*/_jsx(\"ul\",{className:\"logoloop__list\",role:\"list\",\"aria-hidden\":copyIndex>0,ref:copyIndex===0?seqRef:undefined,children:logos.map((item,itemIndex)=>/*#__PURE__*/_jsx(\"li\",{className:\"logoloop__item\",role:\"listitem\",children:/*#__PURE__*/_jsx(\"img\",{src:item.image.src,srcSet:item.image.srcSet,alt:item.image.alt??\"\",loading:\"lazy\",decoding:\"async\",draggable:false})},itemIndex))},copyIndex));return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n.logoloop {\n  position: relative;\n  width: 100%;\n  overflow: hidden;\n}\n\n.logoloop__track {\n  display: flex;\n  width: max-content;\n  will-change: transform;\n  user-select: none;\n  -webkit-user-select: none;\n  touch-action: pan-y;\n}\n\n.logoloop__list {\n  display: flex;\n  align-items: center;\n  list-style: none;\n  margin: 0;\n  padding: 0;\n}\n\n.logoloop__item {\n  flex: 0 0 auto;\n  margin-right: ${gap}px;\n  list-style: none;\n}\n\n.logoloop__item img {\n  height: ${logoHeight}px;\n  width: auto;\n  display: block;\n  object-fit: contain;\n  -webkit-user-drag: none;\n  user-select: none;\n  -webkit-user-select: none;\n  pointer-events: none;\n  backface-visibility: hidden;\n  -webkit-backface-visibility: hidden;\n  transform: translateZ(0);\n}\n\n.logoloop::before,\n.logoloop::after {\n  content: '';\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  width: clamp(24px, 8%, 120px);\n  pointer-events: none;\n  z-index: 10;\n}\n\n.logoloop::before {\n  left: 0;\n  background: linear-gradient(\n    to right,\n    ${fadeOutColor||\"#ffffff\"} 0%,\n    rgba(0, 0, 0, 0) 100%\n  );\n}\n\n.logoloop::after {\n  right: 0;\n  background: linear-gradient(\n    to left,\n    ${fadeOutColor||\"#ffffff\"} 0%,\n    rgba(0, 0, 0, 0) 100%\n  );\n}\n\n@media (prefers-color-scheme: dark) {\n  .logoloop::before {\n    background: linear-gradient(\n      to right,\n      ${fadeOutColor||\"#0b0b0b\"} 0%,\n      rgba(0, 0, 0, 0) 100%\n    );\n  }\n\n  .logoloop::after {\n    background: linear-gradient(\n      to left,\n      ${fadeOutColor||\"#0b0b0b\"} 0%,\n      rgba(0, 0, 0, 0) 100%\n    );\n  }\n}\n\t\t\t`}),/*#__PURE__*/_jsx(\"div\",{ref:containerRef,className:\"logoloop\",style:props.style,role:\"region\",\"aria-label\":\"Partner logos\",children:/*#__PURE__*/_jsx(\"div\",{className:\"logoloop__track\",ref:trackRef,onMouseEnter:handleInteractionStart,onMouseLeave:handleInteractionEnd,children:logoLists})})]});}addPropertyControls(LogoLoop,{logos:{type:ControlType.Array,title:\"Logos\",control:{type:ControlType.Object,controls:{image:{type:ControlType.ResponsiveImage,title:\"Logo Image\"}}},defaultValue:[{image:{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Partner 1\"}},{image:{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Partner 2\"}},{image:{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Partner 3\"}},{image:{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Partner 4\"}},{image:{src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",alt:\"Partner 5\"}}],maxCount:20},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:120,min:0,max:500,step:10,unit:\"px/s\"},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"left\",\"right\"],optionTitles:[\"Left\",\"Right\"],defaultValue:\"left\",displaySegmentedControl:true},logoHeight:{type:ControlType.Number,title:\"Logo Height\",defaultValue:28,min:16,max:200,step:1,unit:\"px\"},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:32,min:0,max:200,step:4,unit:\"px\"},pauseOnHover:{type:ControlType.Boolean,title:\"Pause on Hover\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"},fadeOutColor:{type:ControlType.Color,title:\"Fade Color\",defaultValue:\"#FFFFFF\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LogoLoop\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LogoLoop.map"],"mappings":"kOAIG,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,CAAC,MAAM,CAAC,IAAI,sEAAsE,IAAI,YAAY,CAAC,CAAC,CAAC,QAAM,IAAI,YAAU,OAAO,aAAW,GAAG,MAAI,GAAG,eAAa,GAAK,gBAAc,EAAY,EAAaA,EAAO,KAAK,CAAO,EAASA,EAAO,KAAK,CAAO,EAAOA,EAAO,KAAK,CAAM,CAAC,EAAS,GAAaC,EAAS,EAAE,CAAM,CAAC,EAAU,GAAcA,EAAS,EAAiB,WAAW,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAO,EAAe,IAAY,OAAO,EAAM,CAAC,EAAY,EAAiBC,MAAgB,CAAC,GA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