{"version":3,"file":"Text_adjust.DPwB6CqK.mjs","names":["useRef","useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/it9xjFFQ4mHspwHLQWyG/jFUjZase1EtTzsplEySF/Text_adjust.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * VariableFontCursor\n *\n * Cursor X  → font-width   (wdth axis)\n * Cursor Y  → font-weight  (wght axis)\n *\n * Each font defines its own axis ranges and Google Fonts import URL.\n * Fonts without a wdth axis skip that variation setting gracefully.\n */const FONTS={\"Roboto Flex\":{family:\"'Roboto Flex', sans-serif\",importUrl:\"https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wdth,wght@8..144,25..151,100..900&display=swap\",wghtMin:100,wghtMax:900,wdthMin:25,wdthMax:151},Anybody:{family:\"'Anybody', sans-serif\",importUrl:\"https://fonts.googleapis.com/css2?family=Anybody:wdth,wght@50..150,100..900&display=swap\",wghtMin:100,wghtMax:900,wdthMin:50,wdthMax:150},Cabin:{family:\"'Cabin', sans-serif\",importUrl:\"https://fonts.googleapis.com/css2?family=Cabin:wdth,wght@75..100,400..700&display=swap\",wghtMin:400,wghtMax:700,wdthMin:75,wdthMax:100},Fraunces:{family:\"'Fraunces', serif\",importUrl:\"https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,100..900&display=swap\",wghtMin:100,wghtMax:900,wdthMin:null,wdthMax:null},Recursive:{family:\"'Recursive', sans-serif\",importUrl:\"https://fonts.googleapis.com/css2?family=Recursive:wght@300..1000&display=swap\",wghtMin:300,wghtMax:1e3,wdthMin:null,wdthMax:null}};const FONT_NAMES=Object.keys(FONTS);export default function VariableFontCursor({text=\"VARIABLE\",fontSize=96,color=\"#ffffff\",showBackground=true,backgroundColor=\"#0a0a0a\",fontChoice=\"Roboto Flex\"}){const containerRef=useRef(null);const[weight,setWeight]=useState(500);const[fontWidth,setFontWidth]=useState(100);const[mousePos,setMousePos]=useState({x:.5,y:.5});const animRef=useRef();const targetRef=useRef({weight:500,width:100});const currentRef=useRef({weight:500,width:100});const font=FONTS[fontChoice]??FONTS[\"Roboto Flex\"];useEffect(()=>{const handleMouseMove=e=>{const nx=e.clientX/window.innerWidth;const ny=e.clientY/window.innerHeight;setMousePos({x:nx,y:ny});targetRef.current.weight=font.wghtMax-ny*(font.wghtMax-font.wghtMin);if(font.wdthMin!==null&&font.wdthMax!==null){targetRef.current.width=font.wdthMin+nx*(font.wdthMax-font.wdthMin);}};window.addEventListener(\"mousemove\",handleMouseMove);return()=>window.removeEventListener(\"mousemove\",handleMouseMove);},[font]);useEffect(()=>{const lerp=(a,b,t)=>a+(b-a)*t;const tick=()=>{const t=.07;currentRef.current.weight=lerp(currentRef.current.weight,targetRef.current.weight,t);currentRef.current.width=lerp(currentRef.current.width,targetRef.current.width,t);setWeight(Math.round(currentRef.current.weight));setFontWidth(Math.round(currentRef.current.width*10)/10);animRef.current=requestAnimationFrame(tick);};animRef.current=requestAnimationFrame(tick);return()=>cancelAnimationFrame(animRef.current);},[]);const variationSettings=font.wdthMin!==null?`'wght' ${weight}, 'wdth' ${fontWidth}`:`'wght' ${weight}`;return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                @import url('${font.importUrl}');\n\n                .vf-root {\n                    width: 100%;\n                    height: 100%;\n                    display: flex;\n                    align-items: center;\n                    justify-content: center;\n                    cursor: none;\n                    overflow: hidden;\n                    position: relative;\n                }\n\n                .vf-text {\n                    text-transform: uppercase;\n                    line-height: 1;\n                    user-select: none;\n                    will-change: font-variation-settings;\n                    position: relative;\n                    z-index: 2;\n                }\n\n                .vf-cursor {\n                    width: 6px;\n                    height: 6px;\n                    border-radius: 50%;\n                    position: fixed;\n                    pointer-events: none;\n                    transform: translate(-50%, -50%);\n                    z-index: 9999;\n                }\n            `}),/*#__PURE__*/_jsxs(\"div\",{ref:containerRef,className:\"vf-root\",style:{background:showBackground?backgroundColor:\"transparent\",color},children:[/*#__PURE__*/_jsx(\"span\",{className:\"vf-text\",style:{fontFamily:font.family,fontSize:`${fontSize}px`,color,fontVariationSettings:variationSettings},children:text}),/*#__PURE__*/_jsx(\"div\",{className:\"vf-cursor\",style:{left:`${mousePos.x*100}vw`,top:`${mousePos.y*100}vh`,background:color}})]})]});}addPropertyControls(VariableFontCursor,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"VARIABLE\"},fontChoice:{type:ControlType.Enum,title:\"Font\",defaultValue:\"Roboto Flex\",options:FONT_NAMES,optionTitles:FONT_NAMES},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:96,min:12,max:400,step:1,displayStepper:true},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#ffffff\"},showBackground:{type:ControlType.Boolean,title:\"Background\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},backgroundColor:{type:ControlType.Color,title:\"BG Color\",defaultValue:\"#0a0a0a\",hidden:props=>!props.showBackground}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VariableFontCursor\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Text_adjust.map"],"mappings":"oNAQu/B,SAAwB,EAAmB,CAAC,OAAK,WAAW,WAAS,GAAG,QAAM,UAAU,iBAAe,GAAK,kBAAgB,UAAU,aAAW,eAAe,CAAC,IAAM,EAAaA,EAAO,KAAK,CAAM,CAAC,EAAO,GAAWC,EAAS,IAAI,CAAM,CAAC,EAAU,GAAcA,EAAS,IAAI,CAAM,CAAC,EAAS,GAAaA,EAAS,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAO,EAAQD,GAAQ,CAAO,EAAUA,EAAO,CAAC,OAAO,IAAI,MAAM,IAAI,CAAC,CAAO,EAAWA,EAAO,CAAC,OAAO,IAAI,MAAM,IAAI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