{"version":3,"file":"CursorImageTrail.Cyaz0DsQ.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/H45CJNT8eSLvZ9X1uNV9/IiZbkXrLPbarvJ4VglUo/UrHVMMv4P.js","https:/framerusercontent.com/modules/I2lhaW7h9br8Rj9vvVFP/3euN4dJjuYWnM8niPZlv/CursorImageTrail.js"],"sourcesContent":["// Generated by Framer (a1faaee)\nimport{fontStore}from\"framer\";fontStore.loadFonts([\"FS;Switzer-semibold\",\"FS;Switzer-black\",\"FS;Switzer-black italic\",\"FS;Switzer-semibold italic\"]);export const fonts=[{explicitInter:true,fonts:[{cssFamilyName:\"Switzer\",source:\"fontshare\",style:\"normal\",uiFamilyName:\"Switzer\",url:\"https://framerusercontent.com/third-party-assets/fontshare/wf/5SZVFDB7V52TI6ULVC6J3WQZQCIZVDV5/ODYPSTCUDMKSTYIPTV4CLQ7URIK7XYBJ/YS3VPNVO4B3TOJMEXDGFZQ4TLZGGSRZC.woff2\",weight:\"600\"},{cssFamilyName:\"Switzer\",source:\"fontshare\",style:\"normal\",uiFamilyName:\"Switzer\",url:\"https://framerusercontent.com/third-party-assets/fontshare/wf/A54N3N7J5AY6YOPYJKLHF5VH7G7HSSUN/ERWIWIB434FMFHQFSSBD233EP3C62HOI/TOHQHMLIEIPKVF2JPM6SVKXFYGO5G2TJ.woff2\",weight:\"900\"},{cssFamilyName:\"Switzer\",source:\"fontshare\",style:\"italic\",uiFamilyName:\"Switzer\",url:\"https://framerusercontent.com/third-party-assets/fontshare/wf/FQHNKZEV35SAMFWVFCFSORJXUNHNILL4/X4YCR4COAQTK5XB6JCDDBS7Q33AQWUAE/J7XVDQ2IJENINPUAVBDJNH3VEXVDSPQQ.woff2\",weight:\"900\"},{cssFamilyName:\"Switzer\",source:\"fontshare\",style:\"italic\",uiFamilyName:\"Switzer\",url:\"https://framerusercontent.com/third-party-assets/fontshare/wf/2UC2M25RQ2XRSGCBJRQ2G5SNXCROECQB/QJT3T33NN372363FJY5EO5D63GKDKLDK/IOAFMDAPNX3S6OL2GYQQJ2FFJIRSVB3N.woff2\",weight:\"600\"}]}];export const css=['.framer-kgwUX .framer-styles-preset-b228ce:not(.rich-text-wrapper), .framer-kgwUX .framer-styles-preset-b228ce.rich-text-wrapper p { --framer-font-family: \"Switzer\", \"Switzer Placeholder\", sans-serif; --framer-font-family-bold: \"Switzer\", sans-serif; --framer-font-family-bold-italic: \"Switzer\", sans-serif; --framer-font-family-italic: \"Switzer\", \"Switzer Placeholder\", sans-serif; --framer-font-open-type-features: normal; --framer-font-size: 16px; --framer-font-style: normal; --framer-font-style-bold: normal; --framer-font-style-bold-italic: italic; --framer-font-style-italic: italic; --framer-font-variation-axes: normal; --framer-font-weight: 600; --framer-font-weight-bold: 900; --framer-font-weight-bold-italic: 900; --framer-font-weight-italic: 600; --framer-letter-spacing: -0.02em; --framer-line-height: 1.4em; --framer-paragraph-spacing: 20px; --framer-text-alignment: left; --framer-text-color: var(--token-2721c89b-11ab-4e8c-96b3-613e9caa56c6, #ffffff); --framer-text-decoration: none; --framer-text-stroke-color: initial; --framer-text-stroke-width: initial; --framer-text-transform: none; }'];export const className=\"framer-kgwUX\";\nexport const __FramerMetadata__ = {\"exports\":{\"className\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"css\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fonts\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Cursor Image Trail component with CMS-connectable image array\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";/**\n * Cursor Image Trail\n * \n * A component that creates a trail of images following the cursor.\n * Images can be connected to CMS through the images array property.\n *\n * @framerIntrinsicWidth 1200\n * @framerIntrinsicHeight 800\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function CursorImageTrail(props){const{image1={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Image 1\"},image2={src:\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",alt:\"Image 2\"},image3={src:\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\",alt:\"Image 3\"},image4={src:\"https://framerusercontent.com/images/2uTNEj5aTl2K3NJaEFWMbnrA.jpg\",alt:\"Image 4\"},frequency=10,visibleFor=.5,imageWidth=200,imageHeight=250,rotationRange=15,scaleRange=.2,style={width:200,height:250,radius:0},transition}=props;const[trails,setTrails]=useState([]);const lastSpawnTime=useRef(0);const imageIndex=useRef(0);const containerRef=useRef(null);const isStatic=RenderTarget.current()===RenderTarget.thumbnail;const[mounted,setMounted]=useState(false);const images=[image1,image2,image3,image4];useEffect(()=>{setMounted(true);return()=>setMounted(false);},[]);useEffect(()=>{if(isStatic||typeof window===\"undefined\")return;if(!images||images.length===0)return;const handleMouseMove=e=>{if(!containerRef.current)return;const rect=containerRef.current.getBoundingClientRect();const x=e.clientX-rect.left;const y=e.clientY-rect.top;// Check if mouse is within container bounds\nif(x<0||x>rect.width||y<0||y>rect.height)return;const now=Date.now();const timeSinceLastSpawn=now-lastSpawnTime.current;// Spawn new image based on frequency\nif(timeSinceLastSpawn>1e3/frequency){const currentImage=images[imageIndex.current%images.length];const rotation=(Math.random()-.5)*2*rotationRange;const scale=1+(Math.random()-.5)*scaleRange;startTransition(()=>{setTrails(prev=>[...prev,{id:now,x,y,image:currentImage,rotation,scale}]);});imageIndex.current++;lastSpawnTime.current=now;// Remove image after visibleFor duration\nsetTimeout(()=>{startTransition(()=>{setTrails(prev=>prev.filter(trail=>trail.id!==now));});},visibleFor*1e3);}};window.addEventListener(\"mousemove\",handleMouseMove);return()=>{window.removeEventListener(\"mousemove\",handleMouseMove);};},[images,frequency,visibleFor,rotationRange,scaleRange,isStatic]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"visible\"},children:/*#__PURE__*/_jsx(AnimatePresence,{children:trails.map(trail=>/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:trail.scale,rotate:trail.rotation},exit:{opacity:0,scale:.8},transition:transition,style:{position:\"absolute\",left:trail.x,top:trail.y,width:style.width,height:style.height,transform:\"translate(-50%, -50%)\",pointerEvents:\"none\",zIndex:10},children:/*#__PURE__*/_jsx(\"img\",{src:trail.image.src,alt:trail.image.alt||\"Trail image\",style:{width:\"auto\",height:\"auto\",maxWidth:style.width,maxHeight:style.height,borderRadius:style.radius,boxShadow:\"0 4px 20px rgba(0, 0, 0, 0.15)\"}})},trail.id))})});}addPropertyControls(CursorImageTrail,{image1:{type:ControlType.ResponsiveImage,title:\"Image 1\"},image2:{type:ControlType.ResponsiveImage,title:\"Image 2\"},image3:{type:ControlType.ResponsiveImage,title:\"Image 3\"},image4:{type:ControlType.ResponsiveImage,title:\"Image 4\"},style:{type:ControlType.Object,title:\"Style\",controls:{width:{type:ControlType.Number,title:\"Width\",defaultValue:200,min:50,max:500,step:10,unit:\"px\"},height:{type:ControlType.Number,title:\"Height\",defaultValue:250,min:50,max:500,step:10,unit:\"px\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:0,min:0,max:100,step:1,unit:\"px\"}},defaultValue:{width:200,height:250,radius:0}},transition:{type:ControlType.Transition,title:\"Transition\"},frequency:{type:ControlType.Number,title:\"Frequency\",defaultValue:10,min:1,max:60,step:1,unit:\"Hz\",description:\"How frequently images appear\"},visibleFor:{type:ControlType.Number,title:\"Visible For\",defaultValue:.5,min:.1,max:5,step:.1,unit:\"s\",description:\"How long images stay visible\"},imageWidth:{type:ControlType.Number,title:\"Image Width\",defaultValue:200,min:50,max:500,step:10,unit:\"px\",hidden:()=>true},imageHeight:{type:ControlType.Number,title:\"Image Height\",defaultValue:250,min:50,max:500,step:10,unit:\"px\",hidden:()=>true},rotationRange:{type:ControlType.Number,title:\"Rotation Range\",defaultValue:15,min:0,max:45,step:1,unit:\"\\xb0\",description:\"Random rotation variation\"},scaleRange:{type:ControlType.Number,title:\"Scale Range\",defaultValue:.2,min:0,max:1,step:.05,description:\"Random scale variation\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CursorImageTrail\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"800\",\"framerIntrinsicWidth\":\"1200\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CursorImageTrail.map"],"mappings":"0SAC8B,GAAU,UAAU,CAAC,sBAAsB,mBAAmB,0BAA0B,6BAA6B,CAAC,CAAc,EAAM,CAAC,CAAC,cAAc,GAAK,MAAM,CAAC,CAAC,cAAc,UAAU,OAAO,YAAY,MAAM,SAAS,aAAa,UAAU,IAAI,yKAAyK,OAAO,MAAM,CAAC,CAAC,cAAc,UAAU,OAAO,YAAY,MAAM,SAAS,aAAa,UAAU,IAAI,yKAAyK,OAAO,MAAM,CAAC,CAAC,cAAc,UAAU,OAAO,YAAY,MAAM,SAAS,aAAa,UAAU,IAAI,yKAAyK,OAAO,MAAM,CAAC,CAAC,cAAc,UAAU,OAAO,YAAY,MAAM,SAAS,aAAa,UAAU,IAAI,yKAAyK,OAAO,MAAM,CAAC,CAAC,CAAC,CAAc,EAAI,CAAC,ulCAAulC,CAAc,EAAU,kBCWz3E,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,SAAO,CAAC,IAAI,sEAAsE,IAAI,UAAU,CAAC,SAAO,CAAC,IAAI,oEAAoE,IAAI,UAAU,CAAC,SAAO,CAAC,IAAI,uEAAuE,IAAI,UAAU,CAAC,SAAO,CAAC,IAAI,oEAAoE,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