{"version":3,"file":"GridImage.6roRMJ-o.mjs","names":["useState","useMemo"],"sources":["https:/framerusercontent.com/modules/cXjVJ9QnTvgLfJCFitKp/78LTTvrU6o1eaNtd1L53/GridImage.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useMemo,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";/**\n * Grid Image with Hover Text Reveal\n * \n * An image component that fits in grid layouts with object-fit cover.\n * On hover, shows a blurry overlay with animated text appearing letter by letter.\n * Clickable to navigate to a specified link.\n * \n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function GridImage(props){const{image={src:\"https://framerusercontent.com/images/GfGkADagM4KEibNcIiRUWlfrR0.jpg\",alt:\"Gradient 1 - Blue\"},link,title=\"Brand Name\",textColor=\"#FFFFFF\",font,blurAmount=8,overlayColor=\"rgba(0, 0, 0, 0.3)\",animationDuration=.6,titleFontSize,showMode=\"hover\",alwaysVisibleBlur=2,enableLink=true,...otherProps}=props;const[isHovered,setIsHovered]=useState(false);const letters=useMemo(()=>title.split(\"\"),[title]);// Determine if text should be visible\nconst isTextVisible=showMode===\"always-centered\"||showMode===\"always-bottom-right\"||showMode===\"hover\"&&isHovered;const shouldShowBlur=showMode!==\"image-only\"&&isTextVisible;// Use different blur amount for \"always visible\" modes\nconst currentBlurAmount=showMode===\"always-centered\"||showMode===\"always-bottom-right\"?alwaysVisibleBlur:blurAmount;const handleMouseEnter=()=>{startTransition(()=>setIsHovered(true));};const handleMouseLeave=()=>{startTransition(()=>setIsHovered(false));};// Animation variants\nconst containerVariants={hidden:{},visible:{transition:{staggerChildren:.04,delayChildren:.05}}};const letterVariants={hidden:{opacity:0,x:-15,scale:.9},visible:{opacity:1,x:0,scale:1,transition:{type:\"spring\",stiffness:200,damping:15}}};// Determine the href - handle both string and object link formats\nconst href=useMemo(()=>{if(!link)return null;if(typeof link===\"string\")return link;if(typeof link===\"object\"){// Handle Framer Link object structure\nif(link.href)return link.href;if(link.url)return link.url;// Check for webUrl property that Framer might use\nconst anyLink=link;if(anyLink.webUrl)return anyLink.webUrl;if(anyLink.path)return anyLink.path;}return null;},[link]);const handleClick=e=>{if(!href){e.preventDefault();return;}// Check if it's an external link\nconst isExternal=href.startsWith(\"http://\")||href.startsWith(\"https://\")||href.startsWith(\"//\");if(isExternal){e.preventDefault();window.open(href,\"_blank\",\"noopener,noreferrer\");}// For internal links, let the anchor handle navigation naturally\n};const Wrapper=href&&enableLink?\"a\":\"div\";const wrapperProps=href&&enableLink?{href,onClick:handleClick}:{};return /*#__PURE__*/_jsxs(Wrapper,{style:{position:\"relative\",width:\"100%\",height:\"100%\",cursor:href&&enableLink?\"pointer\":\"default\",display:\"block\",textDecoration:\"none\"},onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,...wrapperProps,...otherProps,children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"img\",{src:image.src,alt:image.alt||title,style:{width:\"100%\",height:\"100%\",objectFit:\"cover\",display:\"block\",transition:`filter ${animationDuration}s ease, transform ${animationDuration}s ease`,filter:shouldShowBlur?`blur(${currentBlurAmount}px)`:\"blur(0px)\",transform:shouldShowBlur?\"scale(1.1)\":\"scale(1)\",border:\"none\",outline:\"none\"}})}),showMode!==\"image-only\"&&/*#__PURE__*/_jsx(motion.div,{initial:{opacity:showMode===\"always-centered\"||showMode===\"always-bottom-right\"?1:0},animate:{opacity:isTextVisible?1:0},transition:{duration:animationDuration*.5},style:{position:\"absolute\",top:0,left:0,right:0,bottom:0,backgroundColor:overlayColor,display:\"flex\",alignItems:showMode===\"always-bottom-right\"?\"flex-end\":\"center\",justifyContent:showMode===\"always-bottom-right\"?\"flex-end\":\"center\",padding:showMode===\"always-bottom-right\"?\"16px\":\"0\",pointerEvents:\"none\"},children:/*#__PURE__*/_jsx(motion.span,{variants:containerVariants,initial:showMode===\"always-centered\"||showMode===\"always-bottom-right\"?\"visible\":\"hidden\",animate:isTextVisible?\"visible\":\"hidden\",style:{color:textColor,fontSize:titleFontSize?`${titleFontSize}px`:font?.fontSize||\"24px\",fontFamily:font?.fontFamily||\"Inter, sans-serif\",fontWeight:font?.fontWeight||600,fontStyle:font?.fontStyle||\"normal\",letterSpacing:font?.letterSpacing||\"0em\",lineHeight:font?.lineHeight||\"1.2em\",textAlign:(font?.textAlign)||\"center\",whiteSpace:\"nowrap\"},children:letters.map((letter,index)=>/*#__PURE__*/_jsx(motion.span,{variants:letterVariants,style:{display:\"inline-block\"},children:letter===\" \"?\"\\xa0\":letter},index))})})]});}addPropertyControls(GridImage,{showMode:{type:ControlType.Enum,title:\"Show Text\",options:[\"hover\",\"always-centered\",\"always-bottom-right\",\"image-only\"],optionTitles:[\"On Hover\",\"Always Centered\",\"Always Bottom Right\",\"Image Only\"],defaultValue:\"hover\"},image:{type:ControlType.ResponsiveImage,title:\"Image\"},enableLink:{type:ControlType.Boolean,title:\"Enable Link\",defaultValue:true,enabledTitle:\"Link\",disabledTitle:\"No Link\"},link:{type:ControlType.Link,title:\"Link URL\",defaultValue:\"https://framer.com\",hidden:({enableLink})=>!enableLink},title:{type:ControlType.String,title:\"Title Text\",defaultValue:\"Brand Name\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#FFFFFF\"},font:{type:ControlType.Font,title:\"Text Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"24px\",variant:\"Semibold\",letterSpacing:\"0em\",lineHeight:\"1.2em\",textAlign:\"center\"}},blurAmount:{type:ControlType.Number,title:\"Blur Amount\",defaultValue:8,min:0,max:20,step:1,unit:\"px\",hidden:({showMode})=>showMode===\"always-centered\"||showMode===\"always-bottom-right\"},alwaysVisibleBlur:{type:ControlType.Number,title:\"Always Visible Blur\",defaultValue:2,min:0,max:20,step:.5,unit:\"px\",hidden:({showMode})=>showMode!==\"always-centered\"&&showMode!==\"always-bottom-right\"},overlayColor:{type:ControlType.Color,title:\"Overlay Color\",defaultValue:\"rgba(0, 0, 0, 0.3)\"},animationDuration:{type:ControlType.Number,title:\"Animation Duration\",defaultValue:.6,min:.1,max:2,step:.1,unit:\"s\"},titleFontSize:{type:ControlType.Number,title:\"Title Font Size\",defaultValue:24,min:12,max:72,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GridImage\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GridImage.map"],"mappings":"8PASG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,QAAM,CAAC,IAAI,sEAAsE,IAAI,mBAAmB,EAAE,OAAK,QAAM,aAAa,YAAU,UAAU,OAAK,aAAW,EAAE,eAAa,qBAAqB,oBAAkB,GAAG,gBAAc,WAAS,QAAQ,oBAAkB,EAAE,aAAW,GAAK,GAAG,GAAY,EAAW,CAAC,EAAU,GAAcA,EAAS,EAAK,EAAQ,EAAQC,MAAY,EAAM,MAAM,EAAE,EAAE,CAAC,CAAK,CAAC,EAClc,EAAc,IAAW,mBAAmB,IAAW,uBAAuB,IAAW,SAAS,EAAgB,EAAe,IAAW,cAAc,EAC1J,EAAkB,IAAW,mBAAmB,IAAW,sBAAsB,EAAkB,EAAiB,MAAqB,CAAC,MAAoB,EAAa,EAAI,CAAC,CAAE,EAAQ,MAAqB,CAAC,MAAoB,EAAa,EAAK,CAAC,CAAE,EACzP,EAAkB,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,gBAAgB,IAAI,cAAc,GAAG,CAAC,CAAC,EAAQ,EAAe,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,MAAM,E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