{"version":3,"file":"RandomGraphicsBackground.CyZjMsgm.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/SOjBqazYyHgkblHcgBkK/8HM637PFJnOkf2wB6Fln/RandomGraphicsBackground.js"],"sourcesContent":["// Background module that displays random PNG or SVG graphics at random positions every few seconds with fade effect\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,motion,AnimatePresence}from\"framer\";/**\n * Random Graphics Background\n * \n * Displays random graphics at random positions across the entire background with fade effects\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function RandomGraphicsBackground(props){const{graphics=[\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\"],interval=3,fadeDuration=1,graphicSize=100}=props;const[activeGraphic,setActiveGraphic]=useState(null);useEffect(()=>{if(typeof window===\"undefined\"||graphics.length===0)return;let currentId=0;const showGraphic=()=>{const randomSrc=graphics[Math.floor(Math.random()*graphics.length)];const randomX=Math.random()*100;const randomY=Math.random()*100;const newGraphic={id:currentId++,src:randomSrc,x:randomX,y:randomY};startTransition(()=>{setActiveGraphic(newGraphic);});// Hide graphic after: fade-in + display time + fade-out\nconst hideDelay=(fadeDuration+interval)*1e3;const fadeOutTimer=setTimeout(()=>{startTransition(()=>{setActiveGraphic(null);});},hideDelay);return()=>clearTimeout(fadeOutTimer);};// Show first graphic immediately\nshowGraphic();// Then cycle: fade-in + display + fade-out + next graphic\nconst totalCycleDuration=(fadeDuration*2+interval)*1e3;const cycleTimer=setInterval(showGraphic,totalCycleDuration);return()=>{clearInterval(cycleTimer);};},[graphics,interval,fadeDuration]);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(AnimatePresence,{children:activeGraphic&&/*#__PURE__*/_jsx(motion.img,{src:activeGraphic.src,alt:\"\",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:fadeDuration,ease:\"easeInOut\"},style:{position:\"absolute\",left:`${activeGraphic.x}%`,top:`${activeGraphic.y}%`,width:graphicSize,height:graphicSize,objectFit:\"contain\",transform:`translate(-50%, -50%)`}},activeGraphic.id)})});}addPropertyControls(RandomGraphicsBackground,{graphics:{type:ControlType.Array,title:\"Graphics\",control:{type:ControlType.File,allowedFileTypes:[\"png\",\"svg\",\"jpg\",\"jpeg\",\"gif\",\"webp\"]},defaultValue:[\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",\"https://framerusercontent.com/images/aNsAT3jCvt4zglbWCUoFe33Q.jpg\",\"https://framerusercontent.com/images/BYnxEV1zjYb9bhWh1IwBZ1ZoS60.jpg\"],maxCount:10},interval:{type:ControlType.Number,title:\"Interval\",defaultValue:3,min:.5,max:10,step:.5,unit:\"s\"},fadeDuration:{type:ControlType.Number,title:\"Fade Duration\",defaultValue:1,min:.5,max:5,step:.5,unit:\"s\"},graphicSize:{type:ControlType.Number,title:\"Graphic Size\",defaultValue:100,min:50,max:500,step:10,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RandomGraphicsBackground\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RandomGraphicsBackground.map"],"mappings":"uPAQG,SAAwB,EAAyB,EAAM,CAAC,GAAK,CAAC,WAAS,CAAC,sEAAsE,oEAAoE,uEAAuE,CAAC,WAAS,EAAE,eAAa,EAAE,cAAY,KAAK,EAAW,CAAC,EAAc,GAAkBA,EAAS,KAAK,CAGnM,OA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