{"version":3,"file":"RotatingImage.DP9KHOGF.mjs","names":["React.useRef","React.useMemo"],"sources":["https:/framerusercontent.com/modules/G0SritYGkLYqcG3dS2eS/1IwrTBZ3o1DA3WOwIgo8/RotatingImage.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useInView}from\"framer-motion\";// Instructions:\n// Create a new reusable component for Framer.\n// The component contains an image slot where I can insert any image.\n// The image rotates continuously in place, without stopping.\n// The rotation starts automatically when the page loads.\n// The rotation is smooth and constant, with no acceleration or deceleration.\n// Use a linear animation loop for the rotation.\n// Expose a rotation speed control that adjusts how fast the image spins.\n// The speed control should represent the duration of one full 360-degree rotation.\n// Allow a wide range of speeds, from very slow to very fast.\n// The image should rotate around its center point.\n// Do not require hover or user interaction.\n// Do not add scaling, opacity changes, or other effects.\n// Keep the component minimal and reusable.\n/**\n * @framerIntrinsicWidth 240\n * @framerIntrinsicHeight 240\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function RotatingImage(props){const{image={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Image\"},duration,style}=props;const isStatic=useIsStaticRenderer();const ref=React.useRef(null);const inView=useInView(ref,{amount:.15});const safeDuration=React.useMemo(()=>{const d=Number(duration);if(!Number.isFinite(d))return 8;return Math.max(.05,d);},[duration]);const shouldAnimate=!isStatic&&inView;return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",...style},children:/*#__PURE__*/_jsx(motion.img,{...image,alt:image?.alt??\"\",style:{width:\"100%\",height:\"100%\",objectFit:\"contain\",transformOrigin:\"50% 50%\",display:\"block\",pointerEvents:\"none\",userSelect:\"none\"},animate:shouldAnimate?{rotate:360}:{rotate:0},transition:shouldAnimate?{duration:safeDuration,ease:\"linear\",repeat:Infinity,repeatType:\"loop\"}:undefined})});}addPropertyControls(RotatingImage,{image:{type:ControlType.ResponsiveImage,title:\"Image\"},duration:{type:ControlType.Number,title:\"360\\xb0 Duration\",defaultValue:8,min:.05,max:300,step:.05,unit:\"s\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RotatingImage\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"240\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"240\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RotatingImage.map"],"mappings":"iPAoBG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,IAAI,sEAAsE,IAAI,QAAQ,CAAC,WAAS,SAAO,EAAY,EAAS,GAAqB,CAAO,EAAIA,EAAa,KAAK,CAAO,EAAO,EAAU,EAAI,CAAC,OAAO,IAAI,CAAC,CAAO,EAAaC,MAAkB,CAAC,IAAM,EAAE,OAAO,EAAS,CAAiC,OAA5B,OAAO,SAAS,EAAE,CAAiB,KAAK,IAAI,IAAI,EAAE,CAAxB,GAA2B,CAAC,EAAS,CAAC,CAAO,EAAc,CAAC,GAAU,EAAO,OAAoB,EAAK,MAAM,CAAK,MAAI,MAAM,CAAC,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,SAAS,SAAS,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,GAAG,EAAM,CAAC,SAAsB,EAAK,EAAO,IAAI,CAAC,GAAG,EAAM,IAAI,GAAO,KAAK,GAAG,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,UAAU,UAAU,gBAAgB,UAAU,QAAQ,QAAQ,cAAc,OAAO,WAAW,OAAO,CAAC,QAAQ,EAAc,CAAC,OAAO,IAAI,CAAC,CAAC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