{"version":3,"file":"HoverImageSwitch.CKbu2b3e.mjs","names":["useState","__esmMin","init_npm_react_18_3_1","init_ssg_sandbox_shims","navigator","window","_e","p","c","init_jsx_runtime","ce","init_framer_Bf4_tcb2","addPropertyControls","ControlType","HoverImageSwitch","props","isHovered","setIsHovered","isTouchDevice","setIsTouchDevice","link","style","defaultImage","transitionDuration","hoverImage","overlayTextColor","overlayFont","overlayText","titleTextColor","titlePadding","titleFont","titleText","init_HoverImageSwitch"],"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":"A,6MAIG,SAAwBc,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,SAAOC,EAAW,CAACC,EAAUC,GAAcjB,EAAS,EAAK,EAAO,CAACkB,EAAcC,GAAkBnB,EAAS,EAAK,EAAsP,OAApPU,MAAc,CAAWL,IAAS,QAAac,EAAiB,iBAAiBd,GAAQD,EAAU,eAAe,GAAGA,EAAU,iBAAiB,CAAC,CAAG,EAAE,CAAC,CAAC,EAAgH,gBAAM,MAAM,CAAC,YAArG,CAAIgB,GAAaf,IAAS,SAAa,EAAO,SAAS,KAAKe,EAAM,EAAuD,MAAM,CAAC,GAAGC,EAAM,QAAQ,OAAO,cAAc,SAAS,IAAI,OAAO,MAAM,OAAO,eAAe,OAAO,OAAOD,EAAK,UAAU,SAAS,EAAE,SAAS,CAAc,gBAAM,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,MAAM,OAAO,YAAY,QAAQ,SAAS,QAAQ,EAAE,iBAAiB,CAACF,GAAeD,EAAa,EAAI,EAAE,iBAAiB,CAACC,GAAeD,EAAa,EAAK,EAAE,SAAS,CAA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