{"version":3,"file":"HoverImageSwitch.CBd3eIbf.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/Wst50oRTK808wIuSrBEM/28PnpYi6kqoDFxflMAbQ/HoverImageSwitch.js"],"sourcesContent":["// Image element that switches to another image on hover with a text title below\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight auto\n */export default function HoverImageSwitch(props){const{defaultImage={src:\"https://framerusercontent.com/images/vHfKUZTM7ilQZJhjYmVJvunIevs.png\",alt:\"Default Image\"},hoverImage={src:\"https://framerusercontent.com/images/rBoq2K47gMLocDbSI1ZEWBvgU.png\",alt:\"Hover Image\"},overlayText,overlayTextColor,overlayFont,titleText,titleTextColor,titleFont,titlePadding,transitionDuration,link,style}=props;const[isHovered,setIsHovered]=useState(false);const[isTouchDevice,setIsTouchDevice]=useState(false);useEffect(()=>{if(typeof window!==\"undefined\"){setIsTouchDevice(\"ontouchstart\"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);}},[]);const handleClick=()=>{if(link&&typeof window!==\"undefined\"){window.location.href=link;}};return /*#__PURE__*/_jsxs(\"div\",{onClick:handleClick,style:{...style,display:\"flex\",flexDirection:\"column\",gap:\"16px\",width:\"100%\",textDecoration:\"none\",cursor:link?\"pointer\":\"default\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",aspectRatio:\"3 / 4\",overflow:\"hidden\"},onMouseEnter:()=>!isTouchDevice&&setIsHovered(true),onMouseLeave:()=>!isTouchDevice&&setIsHovered(false),children:[/*#__PURE__*/_jsx(\"img\",{src:defaultImage.src,alt:defaultImage.alt,style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",opacity:isHovered?0:1,transition:`opacity ${transitionDuration}ms ease`}}),/*#__PURE__*/_jsx(\"img\",{src:hoverImage.src,alt:hoverImage.alt,style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",objectFit:\"cover\",opacity:isHovered?1:0,transition:`opacity ${transitionDuration}ms ease`}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",bottom:\"20px\",left:\"50%\",transform:\"translateX(-50%)\",opacity:isHovered?1:0,transition:`opacity ${transitionDuration}ms ease`,pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(\"span\",{style:{color:overlayTextColor,textAlign:\"center\",...overlayFont},children:overlayText})})]}),/*#__PURE__*/_jsx(\"span\",{style:{color:titleTextColor,textAlign:\"center\",textTransform:\"uppercase\",padding:titlePadding,...titleFont},children:titleText})]});}addPropertyControls(HoverImageSwitch,{defaultImage:{type:ControlType.ResponsiveImage,title:\"Default Image\"},hoverImage:{type:ControlType.ResponsiveImage,title:\"Hover Image\"},overlayText:{type:ControlType.String,title:\"Overlay Text\",defaultValue:\"View Details\"},overlayTextColor:{type:ControlType.Color,title:\"Overlay Color\",defaultValue:\"#FFFFFF\"},overlayFont:{type:ControlType.Font,title:\"Overlay Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Semibold\",letterSpacing:\"0.05em\",lineHeight:\"1em\"}},titleText:{type:ControlType.String,title:\"Title Text\",defaultValue:\"SERENO\"},titleTextColor:{type:ControlType.Color,title:\"Title Color\",defaultValue:\"#000000\"},titleFont:{type:ControlType.Font,title:\"Title Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Medium\",letterSpacing:\"0.1em\",lineHeight:\"1em\"}},titlePadding:{type:ControlType.Padding,title:\"Title Padding\",defaultValue:\"0px\"},transitionDuration:{type:ControlType.Number,title:\"Transition Speed\",defaultValue:300,min:100,max:1e3,step:50,unit:\"ms\"},link:{type:ControlType.Link,title:\"Link\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HoverImageSwitch\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HoverImageSwitch.map"],"mappings":"6MAIG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,eAAa,CAAC,IAAI,uEAAuE,IAAI,eAAe,EAAE,aAAW,CAAC,IAAI,qEAAqE,IAAI,aAAa,EAAE,cAAY,mBAAiB,cAAY,YAAU,iBAAe,YAAU,eAAa,qBAAmB,OAAK,SAAO,EAAW,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAO,CAAC,EAAc,GAAkBA,EAAS,EAAK,EAAsP,OAApP,MAAc,CAAW,IAAS,QAAa,EAAiB,iBAAiB,GAAQ,EAAU,eAAe,GAAG,EAAU,iBAAiB,CAAC,CAAG,EAAE,CAAC,CAAC,EAAgH,EAAM,MAAM,CAAC,YAArG,CAAI,GAAa,IAAS,SAAa,EAAO,SAAS,KAAK,EAAM,EAAuD,MAAM,CAAC,GAAG,EAAM,QAAQ,OAAO,cAAc,SAAS,IAAI,OAAO,MAAM,OAAO,eAAe,OAAO,OAAO,EAAK,UAAU,SAAS,EAAE,SAAS,CAAc,EAAM,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,MAAM,OAAO,YAAY,QAAQ,SAAS,QAAQ,EAAE,iBAAiB,CAAC,GAAe,EAAa,EAAI,EAAE,iBAAiB,CAAC,GAAe,EAAa,EAAK,EAAE,SAAS,CAAc,EAAK,MAAM,CAAC,IAAI,EAAa,IAAI,IAAI,EAAa,IAAI,MAAM,CAAC,SAAS,WAAW,IAAI,EAAE,KAAK,EAAE,MAAM,OAAO,OAAO,OAAO,UAAU,QAAQ,QAAQ,IAAc,WAAW,WAAW,EAAmB,QAAQ,CAAC,CAAC,EAAe,EAAK,MAAM,CAAC,IAAI,EAAW,IAAI,IAAI,EAAW,IAAI,MAAM,CAAC,SAAS,WA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