{"version":3,"file":"ImageTicker.D5rm7pWr.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/l64yZelOWAFQuoaZeHuZ/CUSrxsDg9LLNkaYhFzCU/ImageTicker.js"],"sourcesContent":["// 15 degree tilted ticker with 12 images in a 4x3 grid\n// 1st and 3rd columns move down, middle column moves up\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,startTransition,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useAnimationFrame}from\"framer-motion\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ImageTicker(props){const{column1Images,column2Images,column3Images,speed=1,gap=16,tiltAngle=15,borderRadius=12}=props;const column1Ref=useRef(null);const column2Ref=useRef(null);const column3Ref=useRef(null);const containerRef=useRef(null);// Use refs instead of state for animation values to avoid re-renders\nconst offset1=useRef(0);const offset2=useRef(0);const offset3=useRef(0);const[isMobile,setIsMobile]=useState(false);const[estimatedWidth,setEstimatedWidth]=useState(500);useEffect(()=>{if(typeof window===\"undefined\")return;const checkMobile=()=>{startTransition(()=>{setIsMobile(window.innerWidth<768);setEstimatedWidth(window.innerWidth<768?window.innerWidth*.66:window.innerWidth*.5);});};checkMobile();window.addEventListener(\"resize\",checkMobile);return()=>window.removeEventListener(\"resize\",checkMobile);},[]);// Use direct DOM manipulation instead of state updates for better performance\nuseAnimationFrame((time,delta)=>{const movement=delta/1e3*speed*50;offset1.current+=movement;offset2.current-=movement;offset3.current+=movement;// Update DOM directly without triggering React re-renders\nif(column1Ref.current){const child=column1Ref.current.querySelector(\"[data-column-content]\");if(child){const aspectRatio=472/333.77;const imageHeight=estimatedWidth/aspectRatio;const totalSetHeight=(imageHeight+gap)*column1Images.length;const normalizedOffset=(offset1.current%totalSetHeight+totalSetHeight)%totalSetHeight;child.style.transform=`translateY(${-normalizedOffset}px)`;}}if(column2Ref.current){const child=column2Ref.current.querySelector(\"[data-column-content]\");if(child){const aspectRatio=472/333.77;const imageHeight=estimatedWidth/aspectRatio;const totalSetHeight=(imageHeight+gap)*column2Images.length;const normalizedOffset=(offset2.current%totalSetHeight+totalSetHeight)%totalSetHeight;child.style.transform=`translateY(${-normalizedOffset}px)`;}}if(column3Ref.current){const child=column3Ref.current.querySelector(\"[data-column-content]\");if(child){const aspectRatio=472/333.77;const imageHeight=estimatedWidth/aspectRatio;const totalSetHeight=(imageHeight+gap)*column3Images.length;const normalizedOffset=(offset3.current%totalSetHeight+totalSetHeight)%totalSetHeight;child.style.transform=`translateY(${-normalizedOffset}px)`;}}});const renderColumn=columnImages=>{// Calculate based on aspect ratio\nconst aspectRatio=472/333.77;// Only render 3 copies instead of 20 for seamless looping\nconst repeatedImages=Array(3).fill(columnImages).flat();return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",height:\"100%\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"div\",{\"data-column-content\":true,style:{position:\"absolute\",top:0,left:0,width:\"100%\",willChange:\"transform\"},children:repeatedImages.map((image,index)=>/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",aspectRatio:`${aspectRatio}`,marginBottom:gap,borderRadius:borderRadius},children:/*#__PURE__*/_jsx(\"img\",{src:image.src,alt:image.alt,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",borderRadius:borderRadius}})},index))})});};return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\",position:\"relative\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",gap:gap,transform:`rotate(${tiltAngle}deg)`,height:isMobile?\"150vh\":\"200vh\",width:isMobile?\"200vw\":\"200vw\",willChange:\"transform\"},children:[/*#__PURE__*/_jsx(\"div\",{ref:column1Ref,style:{flex:1,minWidth:isMobile?\"52.8vw\":\"39.6vw\"},children:renderColumn(column1Images)}),/*#__PURE__*/_jsx(\"div\",{ref:column2Ref,style:{flex:1,minWidth:isMobile?\"52.8vw\":\"39.6vw\"},children:renderColumn(column2Images)}),/*#__PURE__*/_jsx(\"div\",{ref:column3Ref,style:{flex:1,minWidth:isMobile?\"52.8vw\":\"39.6vw\"},children:renderColumn(column3Images)})]})});}addPropertyControls(ImageTicker,{column1Images:{type:ControlType.Array,control:{type:ControlType.ResponsiveImage},title:\"Column 1 Images\",defaultValue:[{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1\"},{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Gradient 2\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Gradient 3\"}]},column2Images:{type:ControlType.Array,control:{type:ControlType.ResponsiveImage},title:\"Column 2 Images\",defaultValue:[{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Gradient 4\"},{src:\"https://framerusercontent.com/images/f9RiWoNpmlCMqVRIHz8l8wYfeI.jpg\",alt:\"Gradient 5\"},{src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1\"}]},column3Images:{type:ControlType.Array,control:{type:ControlType.ResponsiveImage},title:\"Column 3 Images\",defaultValue:[{src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Gradient 2\"},{src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Gradient 3\"},{src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Gradient 4\"}]},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:1,min:.1,max:5,step:.1},gap:{type:ControlType.Number,title:\"Gap\",defaultValue:16,min:0,max:50,step:1,unit:\"px\"},tiltAngle:{type:ControlType.Number,title:\"Tilt Angle\",defaultValue:15,min:-45,max:45,step:1,unit:\"deg\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:12,min:0,max:50,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageTicker\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageTicker.map"],"mappings":"gQAKG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,gBAAc,gBAAc,gBAAc,QAAM,EAAE,MAAI,GAAG,YAAU,GAAG,eAAa,IAAI,EAAY,EAAWA,EAAO,IAAI,EAAQ,EAAWA,EAAO,IAAI,EAAQ,EAAWA,EAAO,IAAI,EAAQ,EAAaA,EAAO,IAAI,EACnQ,EAAQA,EAAO,CAAC,EAAQ,EAAQA,EAAO,CAAC,EAAQ,EAAQA,EAAO,CAAC,EAAO,CAAC,EAAS,GAAaC,EAAS,EAAK,EAAO,CAAC,EAAe,GAAmBA,EAAS,GAAG,EAAE,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,MAAgB,CAAC,MAAoB,CAAC,EAAY,EAAO,WAAW,GAAG,EAAE,EAAkB,EAAO,WAAW,IAAI,EAAO,WAAW,IAAI,EAAO,WAAW,EAAE,CAAE,CAAC,CAAE,EAA8D,OAA5D,EAAY,EAAE,EAAO,iBAAiB,SAAS,CAAW,MAAY,EAAO,oBAAoB,SAAS,CAAW,CAAE,EAAE,CAAC,CAAC,EAClgB,GAAmB,EAAK,IAAQ,CAAC,IAAM,EAAS,EAAM,IAAI,EAAM,GAChE,GADmE,EAAQ,SAAS,EAAS,EAAQ,SAAS,EAAS,EAAQ,SAAS,EACrI,EAAW,QAAQ,CAAC,IAAM,EAAM,EAAW,QAAQ,cAAc,uBAAuB,EAAE,GAAG,EAAM,CAA2E,IAAM,GAAjC,GAA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