{"version":3,"file":"ImageReveal.D1UII7nf.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/i0KwV0iIq0DCRVBxhPuC/1yjKwumsXGZaquOkrLfr/ImageReveal.js"],"sourcesContent":["/**\n * Developed By Robiul Hasan\n */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerDisableUnlink\n */export default function ImageReveal({image,direction=\"right\",overlayColor=\"#000000\",duration=1,delay=0,width,height,imagePositionX=\"center\",imagePositionY=\"center\"}){const[isVisible,setIsVisible]=useState(false);const[hasAnimated,setHasAnimated]=useState(false);const containerRef=useRef(null);console.log(\"Image Component Is Working!!!\");useEffect(()=>{const observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{if(entry.isIntersecting&&!hasAnimated){setIsVisible(true);setHasAnimated(true);}});},{threshold:.1});if(containerRef.current){observer.observe(containerRef.current);}return()=>{if(containerRef.current){observer.unobserve(containerRef.current);}};},[hasAnimated]);const getTransform=()=>{if(!isVisible)return\"translate(0, 0)\";switch(direction){case\"left\":return\"translateX(-100%)\";case\"right\":return\"translateX(100%)\";case\"top\":return\"translateY(-100%)\";case\"bottom\":return\"translateY(100%)\";default:return\"translateX(100%)\";}};return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"img\",{src:image,alt:\"Reveal\",style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",objectPosition:`${imagePositionX} ${imagePositionY}`,display:\"block\"}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",backgroundColor:overlayColor,transform:getTransform(),transition:`transform ${duration}s cubic-bezier(0.4, 0, 0.2, 1) ${delay}s`,willChange:\"transform\"}})]});}// Property controls for Framer\naddPropertyControls(ImageReveal,{image:{type:ControlType.Image,title:\"Image\"},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"left\",\"right\",\"top\",\"bottom\"],optionTitles:[\"Left\",\"Right\",\"Top\",\"Bottom\"],defaultValue:\"right\"},overlayColor:{type:ControlType.Color,title:\"Overlay Color\",defaultValue:\"#000000\"},duration:{type:ControlType.Number,title:\"Duration (s)\",min:.1,max:5,step:.1,defaultValue:1,displayStepper:true},delay:{type:ControlType.Number,title:\"Delay (s)\",min:0,max:5,step:.1,defaultValue:0,displayStepper:true},imagePositionX:{type:ControlType.Enum,title:\"Position X\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\"},imagePositionY:{type:ControlType.Enum,title:\"Position Y\",options:[\"top\",\"center\",\"bottom\"],optionTitles:[\"Top\",\"Center\",\"Bottom\"],defaultValue:\"center\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageReveal\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageReveal.map"],"mappings":"0LAIG,SAAwB,EAAY,CAAC,QAAM,YAAU,QAAQ,eAAa,UAAU,WAAS,EAAE,QAAM,EAAE,QAAM,SAAO,iBAAe,SAAS,iBAAe,UAAU,CAAC,GAAK,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAM,CAAC,EAAY,GAAgBA,EAAS,GAAM,CAAO,EAAaC,EAAO,KAAK,CAAspB,OAArpB,QAAQ,IAAI,gCAAgC,CAAC,MAAc,CAAC,IAAM,EAAS,IAAI,qBAAqB,GAAS,CAAC,EAAQ,QAAQ,GAAO,CAAI,EAAM,gBAAgB,CAAC,IAAa,EAAa,GAAK,CAAC,EAAe,GAAK,GAAI,EAAG,CAAC,UAAU,GAAG,CAAC,CAAkE,OAA9D,EAAa,SAAS,EAAS,QAAQ,EAAa,QAAQ,KAAY,CAAI,EAAa,SAA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