{"version":3,"file":"CursorFillButton.8aGDROe1.mjs","names":["React.useRef"],"sources":["https:/framerusercontent.com/modules/SJ0nUvr5DsLJCjpl1bvw/29cw8WDhcJ4NHniuDYJw/CursorFillButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,Link}from\"framer\";import gsap from\"gsap\";const defaults={text:\"Discuss a project\",backgroundColor:\"#FFFFFF\",fillColor:\"#111111\",textColor:\"#111111\",hoverTextColor:\"#FFFFFF\",borderColor:\"#222222\",borderWidth:2,borderRadius:100,fontSize:24,fontWeight:400,paddingHorizontal:40,paddingVertical:24,duration:.65,ease:\"power3.out\"};/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function CursorFillButton(props){const{text=defaults.text,link=\"#\",backgroundColor=defaults.backgroundColor,fillColor=defaults.fillColor,textColor=defaults.textColor,hoverTextColor=defaults.hoverTextColor,borderColor=defaults.borderColor,borderWidth=defaults.borderWidth,borderRadius=defaults.borderRadius,fontSize=defaults.fontSize,fontWeight=defaults.fontWeight,paddingHorizontal=defaults.paddingHorizontal,paddingVertical=defaults.paddingVertical,duration=defaults.duration,ease=defaults.ease,style}=props;const buttonRef=React.useRef(null);const fillRef=React.useRef(null);const textRef=React.useRef(null);React.useEffect(()=>{const fill=fillRef.current;const label=textRef.current;if(!fill||!label)return;gsap.set(fill,{scale:0,transformOrigin:\"50% 50%\"});return()=>{gsap.killTweensOf(fill);gsap.killTweensOf(label);};},[]);const getDuration=()=>{const reduceMotion=typeof window!==\"undefined\"&&window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;return reduceMotion?0:duration;};const handleMouseEnter=event=>{const button=buttonRef.current;const fill=fillRef.current;const label=textRef.current;if(!button||!fill||!label)return;const rect=button.getBoundingClientRect();if(!rect.width||!rect.height)return;// Account for Framer canvas zoom.\nconst scaleX=button.offsetWidth/rect.width;const scaleY=button.offsetHeight/rect.height;const width=button.clientWidth;const height=button.clientHeight;const x=Math.max(0,Math.min(width,(event.clientX-rect.left)*scaleX-button.clientLeft));const y=Math.max(0,Math.min(height,(event.clientY-rect.top)*scaleY-button.clientTop));// Expand far enough to cover every corner.\nconst radius=Math.max(Math.hypot(x,y),Math.hypot(width-x,y),Math.hypot(x,height-y),Math.hypot(width-x,height-y))+2;gsap.killTweensOf(fill);gsap.set(fill,{width:radius*2,height:radius*2,left:x,top:y,xPercent:-50,yPercent:-50,scale:0});const animationDuration=getDuration();gsap.to(fill,{scale:1,duration:animationDuration,ease,overwrite:true});gsap.to(label,{color:hoverTextColor,duration:animationDuration*.6,ease:\"power2.out\",overwrite:true});};const handleMouseLeave=()=>{const fill=fillRef.current;const label=textRef.current;if(!fill||!label)return;const animationDuration=getDuration();gsap.to(fill,{scale:0,duration:animationDuration*.8,ease,overwrite:true});gsap.to(label,{color:textColor,duration:animationDuration*.5,ease:\"power2.out\",overwrite:true});};return /*#__PURE__*/_jsx(Link,{href:link,children:/*#__PURE__*/_jsxs(\"a\",{ref:buttonRef,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,style:{position:\"relative\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",width:\"max-content\",height:\"auto\",padding:`${paddingVertical}px ${paddingHorizontal}px`,boxSizing:\"border-box\",overflow:\"hidden\",isolation:\"isolate\",border:`${borderWidth}px solid ${borderColor}`,borderRadius,backgroundColor,color:textColor,textDecoration:\"none\",cursor:\"pointer\",verticalAlign:\"middle\",// Allow Framer to supply fixed/fill dimensions.\n...style},children:[/*#__PURE__*/_jsx(\"span\",{ref:fillRef,\"aria-hidden\":\"true\",style:{position:\"absolute\",display:\"block\",width:0,height:0,borderRadius:\"50%\",backgroundColor:fillColor,pointerEvents:\"none\",zIndex:0}}),/*#__PURE__*/_jsx(\"span\",{ref:textRef,style:{position:\"relative\",zIndex:1,display:\"block\",flexShrink:0,color:textColor,fontSize,fontWeight,fontFamily:\"inherit\",lineHeight:1.2,whiteSpace:\"nowrap\",pointerEvents:\"none\"},children:text})]})});}addPropertyControls(CursorFillButton,{text:{type:ControlType.String,title:\"Text\",defaultValue:defaults.text},link:{type:ControlType.Link,title:\"Link\"},paddingHorizontal:{type:ControlType.Number,title:\"Padding X\",defaultValue:defaults.paddingHorizontal,min:0,max:200,step:1,unit:\"px\"},paddingVertical:{type:ControlType.Number,title:\"Padding Y\",defaultValue:defaults.paddingVertical,min:0,max:100,step:1,unit:\"px\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:defaults.backgroundColor},fillColor:{type:ControlType.Color,title:\"Hover Fill\",defaultValue:defaults.fillColor},textColor:{type:ControlType.Color,title:\"Text Colour\",defaultValue:defaults.textColor},hoverTextColor:{type:ControlType.Color,title:\"Hover Text\",defaultValue:defaults.hoverTextColor},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:defaults.borderColor},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:defaults.borderWidth,min:0,max:10,step:1,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:defaults.borderRadius,min:0,max:200,step:1,unit:\"px\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:defaults.fontSize,min:10,max:80,step:1,unit:\"px\"},fontWeight:{type:ControlType.Number,title:\"Weight\",defaultValue:defaults.fontWeight,min:100,max:900,step:100},duration:{type:ControlType.Number,title:\"Speed\",defaultValue:defaults.duration,min:.2,max:2,step:.05,unit:\"s\"},ease:{type:ControlType.Enum,title:\"Easing\",defaultValue:defaults.ease,options:[\"power2.out\",\"power3.out\",\"power4.out\",\"expo.out\",\"circ.out\"]}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CursorFillButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CursorFillBut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