{"version":3,"file":"ScrollFillText.C_fDvnoC.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/R3WyBFpJaej1PamE1rmx/3AXkFwaO9dBPbrfHRQkP/ScrollFillText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion,useScroll,useTransform}from\"framer-motion\";import{useRef}from\"react\";function Word({children,range,progress,dimOpacity,dimColor,activeColor}){const opacity=useTransform(progress,range,[dimOpacity,1]);const color=useTransform(progress,range,[dimColor,activeColor]);return /*#__PURE__*/_jsxs(motion.span,{style:{opacity,color,display:\"inline-block\"},children:[children,\"\\xa0\"]});}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 800\n * @framerIntrinsicHeight 200\n */export default function ScrollFillText(props){const{text,dimOpacity,dimColor,activeColor,font,fontSize,lineHeight,letterSpacing,fontWeight,textAlign,startOffset,endOffset}=props;const ref=useRef(null);const{scrollYProgress}=useScroll({target:ref,offset:[`start ${startOffset}`,`start ${endOffset}`]});const words=text.split(\" \");return /*#__PURE__*/_jsx(\"p\",{ref:ref,style:{fontFamily:font,fontSize:`${fontSize}px`,lineHeight:`${lineHeight}px`,letterSpacing:`${letterSpacing}em`,fontWeight,textAlign,margin:0,color:dimColor},children:words.map((word,i)=>{const start=i/words.length;const end=start+1/words.length;return /*#__PURE__*/_jsx(Word,{range:[start,end],progress:scrollYProgress,dimOpacity:dimOpacity,dimColor:dimColor,activeColor:activeColor,children:word},`${word}-${i}`);})});}ScrollFillText.defaultProps={text:\"We are building more than electric bikes. Our teams tune them for African roads and real daily use, while building the infrastructure that powers mobility at scale.\",dimOpacity:.2,dimColor:\"#A1A1AA\",activeColor:\"#18181B\",font:\"Clash Grotesk\",fontSize:44,lineHeight:61,letterSpacing:-.02,fontWeight:400,textAlign:\"center\",startOffset:.85,endOffset:.25};addPropertyControls(ScrollFillText,{text:{type:ControlType.String,title:\"Content\",defaultValue:\"We are building more than electric bikes. Our teams tune them for African roads and real daily use, while building the infrastructure that powers mobility at scale.\",displayTextArea:true},font:{type:ControlType.String,title:\"Font\",defaultValue:\"Clash Grotesk\"},fontWeight:{type:ControlType.Enum,title:\"Weight\",defaultValue:500,options:[300,400,500,600,700,800],optionTitles:[\"Light\",\"Regular\",\"Medium\",\"Semibold\",\"Bold\",\"Extrabold\"]},activeColor:{type:ControlType.Color,title:\"Color\",defaultValue:\"#18181B\"},dimColor:{type:ControlType.Color,title:\"Dim Color\",defaultValue:\"#A1A1AA\"},dimOpacity:{type:ControlType.Number,title:\"Dim Opacity\",defaultValue:.2,min:0,max:1,step:.05},fontSize:{type:ControlType.Number,title:\"Size\",defaultValue:44,min:12,max:120,unit:\"px\"},letterSpacing:{type:ControlType.Number,title:\"Letter\",defaultValue:-.02,min:-.2,max:.2,step:.01,unit:\"em\"},lineHeight:{type:ControlType.Number,title:\"Line\",defaultValue:61,min:10,max:200,unit:\"px\"},textAlign:{type:ControlType.Enum,title:\"Align\",defaultValue:\"center\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"]},startOffset:{type:ControlType.Number,title:\"Start at\",defaultValue:.85,min:0,max:1,step:.05},endOffset:{type:ControlType.Number,title:\"End at\",defaultValue:.25,min:0,max:1,step:.05}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollFillText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"800\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollFillText.map"],"mappings":"kPAAgM,SAAS,EAAK,CAAC,WAAS,QAAM,WAAS,aAAW,WAAS,eAAa,CAAC,IAAM,EAAQ,EAAa,EAAS,EAAM,CAAC,EAAW,CAAC,CAA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