{"version":3,"file":"Cursor_Follow_Image_Button_2_1.C_53_08P.mjs","names":["React.forwardRef","React.useState","React.useRef","React.useCallback","__esmMin","init_npm_react_18_3_1","ne","init_ssg_sandbox_shims","window","_e","J","init_jsx_runtime","ce","de","motion","cx","init_framer_BL70qLPA","addPropertyControls","withCSS","ControlType","mask","SVG","getProps","Icon","init_m7_5MN8ce","rest","props","animated","stroke","restProps","className","YmfIrZ3Ez","style","CursorFollowImageButton","hovered","setHovered","previewRef","targetRef","currentRef","animationFrameRef","isDesktopHover","animate","target","current","preview","distanceX","distanceY","image","imageWidth","imageHeight","handlePointerEnter","event","x","y","handlePointerMove","handlePointerLeave","textStyle","link","text","init_Cursor_Follow_Image_Button_2_1"],"sources":["https:/framerusercontent.com/modules/uP6qsw7TVL6d4eei73JQ/e1KV2NrS2uz6owvD8XlE/m7_5MN8ce.js","https:/framerusercontent.com/modules/IBAWP882iSqwv0TeIWwv/9szAIEzhGIaH3Itwvrjj/Cursor_Follow_Image_Button_2_1.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask='url(\\'data:image/svg+xml,<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 18 5.25 L 9 0 L 0 5.25 M 18 5.25 L 9 10.5 M 18 5.25 L 18 14.25 L 9 19.5 M 0 5.25 L 9 10.5 M 0 5.25 L 0 14.25 L 9 19.5 M 9 10.5 L 9 19.5\" fill=\"transparent\" height=\"19.5px\" id=\"tOykfwMPz\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" stroke=\"var(--szd5nr, black)\" transform=\"translate(3 2.25)\" width=\"18px\"/></svg>\\') alpha no-repeat center / auto var(--framer-icon-mask-mode, add), var(--framer-icon-mask, none)';const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(motion.div,{...rest,layoutId:layoutId,ref:ref}):/*#__PURE__*/_jsx(\"div\",{...rest,ref:ref});});const getProps=({height,id,stroke,width,...props})=>{return{...props,YmfIrZ3Ez:stroke??props.YmfIrZ3Ez??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,YmfIrZ3Ez,...restProps}=getProps(props);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-LA0aP\",className),layoutId:layoutId,ref:ref,style:{\"--szd5nr\":YmfIrZ3Ez,...style}});});const css=[`.framer-LA0aP { -webkit-mask: ${mask}; aspect-ratio: 1; background-color: var(--szd5nr); mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"YmfIrZ3Ez\":\"stroke\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Cube\",\"color\":{\"type\":\"variable\",\"value\":\"szd5nr\"},\"set\":{\"localId\":\"vectorSet/kNBkgkDkJ\",\"id\":\"kNBkgkDkJ\",\"moduleId\":\"DyJDRQD0f0RPOu0ZYoEG\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-LA0aP\");Icon.displayName=\"Cube\";export default Icon;addPropertyControls(Icon,{YmfIrZ3Ez:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Stroke\",type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"24\",\"framerImmutableVariables\":\"true\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"24\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"true\",\"framerVariables\":\"{\\\"YmfIrZ3Ez\\\":\\\"stroke\\\"}\",\"framerVector\":\"{\\\"name\\\":\\\"Cube\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"szd5nr\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/kNBkgkDkJ\\\",\\\"id\\\":\\\"kNBkgkDkJ\\\",\\\"moduleId\\\":\\\"DyJDRQD0f0RPOu0ZYoEG\\\"}}\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function CursorFollowImageButton(props){const{text,image,link,imageWidth,imageHeight}=props;const[hovered,setHovered]=React.useState(false);const previewRef=React.useRef(null);const targetRef=React.useRef({x:0,y:0});const currentRef=React.useRef({x:0,y:0});const animationFrameRef=React.useRef(null);// Only allow the hover image on devices with a real mouse/trackpad.\nconst isDesktopHover=()=>{return window.matchMedia(\"(hover: hover) and (pointer: fine)\").matches;};const animate=React.useCallback(()=>{const target=targetRef.current;const current=currentRef.current;const preview=previewRef.current;current.x+=(target.x-current.x)*.18;current.y+=(target.y-current.y)*.18;if(preview){preview.style.transform=`translate3d(${current.x+20}px, ${current.y+20}px, 0)`;}const distanceX=Math.abs(target.x-current.x);const distanceY=Math.abs(target.y-current.y);if(distanceX>.1||distanceY>.1){animationFrameRef.current=requestAnimationFrame(animate);}else{animationFrameRef.current=null;}},[]);React.useEffect(()=>{if(!image)return;const preview=document.createElement(\"img\");preview.src=image;preview.alt=\"\";preview.draggable=false;Object.assign(preview.style,{position:\"fixed\",left:\"0px\",top:\"0px\",width:imageWidth+\"px\",height:imageHeight+\"px\",objectFit:\"cover\",borderRadius:\"8px\",boxShadow:\"0 8px 30px rgba(0, 0, 0, 0.08)\",pointerEvents:\"none\",zIndex:\"2147483647\",opacity:\"0\",transition:\"opacity 350ms ease\",willChange:\"transform, opacity\",userSelect:\"none\"});document.body.appendChild(preview);previewRef.current=preview;return()=>{if(animationFrameRef.current!==null){cancelAnimationFrame(animationFrameRef.current);animationFrameRef.current=null;}preview.remove();if(previewRef.current===preview){previewRef.current=null;}};},[image,imageWidth,imageHeight]);React.useEffect(()=>{return()=>{if(animationFrameRef.current!==null){cancelAnimationFrame(animationFrameRef.current);}if(previewRef.current){previewRef.current.remove();}};},[]);function handlePointerEnter(event){// Completely ignore touch and non-hover devices.\nif(!isDesktopHover())return;if(event.pointerType!==\"mouse\")return;const x=event.clientX;const y=event.clientY;targetRef.current={x,y};currentRef.current={x,y};setHovered(true);const preview=previewRef.current;if(preview){preview.style.transform=`translate3d(${x+20}px, ${y+20}px, 0)`;preview.style.opacity=\"1\";}if(animationFrameRef.current===null){animationFrameRef.current=requestAnimationFrame(animate);}}function handlePointerMove(event){// Completely ignore touch and non-hover devices.\nif(!isDesktopHover())return;if(event.pointerType!==\"mouse\")return;targetRef.current={x:event.clientX,y:event.clientY};if(animationFrameRef.current===null){animationFrameRef.current=requestAnimationFrame(animate);}}function handlePointerLeave(){setHovered(false);const preview=previewRef.current;if(preview){preview.style.opacity=\"0\";}if(animationFrameRef.current!==null){cancelAnimationFrame(animationFrameRef.current);animationFrameRef.current=null;}}const textStyle={fontFamily:\"Inter Display, sans-serif\",fontSize:\"19px\",fontWeight:500,lineHeight:\"160%\",color:hovered?\"#131314\":\"#008C6A\",textDecorationLine:\"underline\",textDecorationStyle:\"solid\",textDecorationColor:\"#008C6A\",textDecorationThickness:\"2px\",textUnderlineOffset:\"2px\",cursor:\"pointer\",whiteSpace:\"nowrap\",transition:\"color 180ms ease\"};return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"flex-start\",overflow:\"visible\"},onPointerEnter:handlePointerEnter,onPointerMove:handlePointerMove,onPointerLeave:handlePointerLeave,children:link?/*#__PURE__*/_jsx(\"a\",{href:link,style:textStyle,children:text}):/*#__PURE__*/_jsx(\"span\",{style:textStyle,children:text})});}CursorFollowImageButton.defaultProps={text:\"Hover me\",image:\"\",link:\"\",imageWidth:540,imageHeight:360};addPropertyControls(CursorFollowImageButton,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Hover me\"},image:{type:ControlType.Image,title:\"Image\"},link:{type:ControlType.Link,title:\"Link\"},imageWidth:{type:ControlType.Number,title:\"Image Width\",defaultValue:540,min:100,max:1200,step:10},imageHeight:{type:ControlType.Number,title:\"Image Height\",defaultValue:360,min:100,max:900,step:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CursorFollowImageButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Cursor_Follow_Image_Button_2_1.map"],"mappings":"A,8TACiL,EAAK,wkBAAglB,EAAiB,iBAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAGyB,GAAMC,EAAM,OAAOC,EAAsB,gBAAKb,EAAO,IAAI,CAAC,GAAGW,EAAc,WAAa,KAAG,CAAC,EAAe,gBAAK,MAAM,CAAC,GAAGA,EAAS,KAAG,CAAC,CAAE,CAAC,EAAQ,GAAU,CAAC,SAAO,KAAG,SAAO,QAAM,GAAGC,MAAgB,CAAC,GAAGA,EAAM,UAAUE,GAAQF,EAAM,WAAW,cAAc,GAU7kC,EAAKR,EAVymClB,kBAAiB,SAAS,EAAM,EAAI,CAAC,GAAK,CAAC,QAAM,YAAU,WAAS,UAAQ,YAAU,GAAG6B,GAAWP,EAASI,CAAK,EAAE,MAAoB,gBAAKL,EAAI,CAAC,GAAGQ,EAAU,UAAUd,EAAG,eAAee,CAAS,EAAW,WAAa,MAAI,MAAM,CAAC,WAAWC,EAAU,GAAGC,CAAK,CAAC,CAAC,CAAE,CAUj2C,EAAE,CAV62C,iCAAiCZ,E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