{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/WGUr2WTZQrHvzZm1OAr4/TFTcvQ51WMnBFjj8Fclk/magtext_pro.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{motion,useMotionTemplate,useSpring,useTransform,useMotionValue}from\"framer-motion\";import{useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerDisableUnlink\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */ export default function MagTextPro({font,...props}){const mx=useMotionValue(0);console.log(font);return /*#__PURE__*/ _jsx(\"div\",{style:{position:\"relative\",cursor:\"default\",whiteSpace:\"pre\",...font},onMouseLeave:()=>{mx.set(Infinity);},onMouseMove:e=>{mx.set(e.clientX);},children:props.text.split(\"\").map((c,idx)=>/*#__PURE__*/ _jsx(Character,{c:c,mouseX:mx,...props},idx))});};function Character({c,mouseX,color:initialColor,hoverColor,hasHoverColor,springOptions,hoverOptions}){const ref=useRef(null);const scaleRange=[1,hoverOptions.scaleX];const distance=useTransform(mouseX,mx=>{if(!ref.current)return Infinity;const{left,width}=ref.current.getBoundingClientRect();const characterCenter=left+width/2;return Math.abs(characterCenter-mx);});const _scaleX=useTransform(distance,[hoverOptions.range,0],scaleRange);const scaleX=useSpring(_scaleX,springOptions);const w=useTransform(scaleX,scaleRange,[0,hoverOptions.strokeWidth]);const padding=useTransform(scaleX,scaleRange,[0,hoverOptions.padding]);const scaleY=useTransform(scaleX,scaleRange,[1,hoverOptions.scaleY]);const color=useTransform(scaleX,scaleRange,[initialColor,hasHoverColor?hoverColor:initialColor,]);return /*#__PURE__*/ _jsx(motion.span,{ref:ref,style:{display:\"inline-block\",scaleX,scaleY,color,WebkitTextStrokeColor:\"currentColor\",WebkitTextStrokeWidth:useMotionTemplate`${w}em`,paddingInline:useMotionTemplate`${padding}em`},children:c});}MagTextPro.displayName=\"MagTextPro\";MagTextPro.defaultProps={text:\"Colorless green ideas sleep furiously\",color:\"black\"};addPropertyControls(MagTextPro,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Magnetic Text Pro\",displayTextArea:true},color:{type:ControlType.Color},font:{title:\"Font\",type:\"font\",controls:\"extended\"},springOptions:{title:\"Spring\",type:ControlType.Object,controls:{stiffness:{type:ControlType.Number,defaultValue:350,min:1,max:1e3},damping:{type:ControlType.Number,defaultValue:40,min:0,max:100},mass:{type:ControlType.Number,defaultValue:1,min:1,max:10}}},hoverOptions:{title:\"Hover\",type:ControlType.Object,controls:{scaleX:{type:ControlType.Number,min:0,max:10,displayStepper:true,step:.1,defaultValue:1.2},scaleY:{type:ControlType.Number,min:0,max:10,displayStepper:true,step:.1,defaultValue:1.2*.8},range:{title:\"Range\",description:\"Elements within this range will be affected by the magnetic field\",type:ControlType.Number,min:0,max:1e3,displayStepper:true,step:1,defaultValue:70},padding:{title:\"Padding\",description:\"Inline padding(em) on hover\",type:ControlType.Number,min:0,max:10,displayStepper:true,step:.01,defaultValue:.05},strokeWidth:{title:\"Stroke\",description:\"How much bolder(em) the text is\",type:ControlType.Number,min:0,max:10,displayStepper:true,step:.01,defaultValue:.1}}},hasHoverColor:{title:\"Hover color\",type:ControlType.Boolean,defaultValue:false},hoverColor:{type:ControlType.Color,hidden:controls=>!controls.hasHoverColor}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MagTextPro\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerDisableUnlink\":\"* @framerSupportedLayoutWidth auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./magtext_pro.map"],
  "mappings": "mIAOmB,SAARA,EAA4B,CAAC,KAAAC,EAAK,GAAGC,CAAK,EAAE,CAAC,IAAMC,EAAGC,EAAe,CAAC,EAAE,eAAQ,IAAIH,CAAI,EAAuB,EAAK,M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C,KAAKA,EAAY,OAAO,IAAI,EAAE,IAAI,GAAG,eAAe,GAAK,KAAK,IAAI,aAAa,EAAE,CAAC,CAAC,EAAE,cAAc,CAAC,MAAM,cAAc,KAAKA,EAAY,QAAQ,aAAa,EAAK,EAAE,WAAW,CAAC,KAAKA,EAAY,MAAM,OAAOC,GAAU,CAACA,EAAS,aAAa,CAAC,CAAC",
  "names": ["MagTextPro", "font", "props", "mx", "useMotionValue", "e", "c", "idx", "Character", "mouseX", "initialColor", "hoverColor", "hasHoverColor", "springOptions", "hoverOptions", "ref", "pe", "scaleRange", "distance", "useTransform", "left", "width", "characterCenter", "_scaleX", "scaleX", "useSpring", "w", "padding", "scaleY", "color", "motion", "useMotionTemplate", "addPropertyControls", "ControlType", "controls"]
}
