{"version":3,"file":"Text_Animation_About_section_.DiDymncD.mjs","names":["useRef","_Fragment"],"sources":["https:/framerusercontent.com/modules/1s6Gd2SdbXLHfzysZ8rQ/fW5QBo0Xzc8gbwIrKNOf/Text_Animation_About_section_.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{motion,useAnimation}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export default function TextColorAnimation({text,fontSize,fontFamily,fontWeight,textAlign,color01,color02,Duration,delay,replays}){const controls=useAnimation();const textRef=useRef();useEffect(()=>{const observer=new IntersectionObserver(async([entry])=>{if(entry.isIntersecting){await new Promise(resolve=>setTimeout(resolve,delay*1e3))// delay before animation starts\n;controls.start(\"visible\");}else if(!entry.isIntersecting&&replays){controls.start(\"hidden\");}});observer.observe(textRef.current);return()=>observer.disconnect();},[Duration,controls,color01,delay,replays]);return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"style\",{children:\"@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders:opsz,wght@10..72,100..900&display=swap');\"}),/*#__PURE__*/_jsx(\"div\",{style:{fontSize:`${fontSize}px`,fontFamily:fontFamily,fontWeight:fontWeight,width:\"100%\",whiteSpace:\"nowrap\",color:color01,textAlign:textAlign},ref:textRef,children:/*#__PURE__*/_jsxs(\"span\",{style:{position:\"relative\",display:\"inline-block\"},children:[text,/*#__PURE__*/_jsx(motion.span,{style:{position:\"absolute\",overflow:\"hidden\",whiteSpace:\"nowrap\",color:color02,top:0,left:0,width:\"0%\"},animate:controls,initial:{width:\"0%\"},variants:{visible:{width:\"100%\"},hidden:{width:\"0%\"}},transition:{duration:Duration},children:text})]})})]});}addPropertyControls(TextColorAnimation,{text:{type:ControlType.String,defaultValue:\"Hello, World! yoo\"},fontSize:{type:ControlType.Number,defaultValue:16,min:1,max:200,unit:\"px\"},fontFamily:{type:ControlType.String,defaultValue:\"Arial\"},fontWeight:{type:ControlType.Enum,defaultValue:\"400\",options:[\"100\",\"200\",\"300\",\"400\",\"500\",\"600\",\"700\",\"800\",\"900\"]},textAlign:{title:\"Text Align\",type:ControlType.Enum,displaySegmentedControl:true,optionTitles:[\"Left\",\"Center\",\"Right\"],options:[\"left\",\"center\",\"right\"]},color01:{title:\"Color 01\",type:ControlType.Color,defaultValue:\"#333\"},color02:{title:\"Color 02\",type:ControlType.Color,defaultValue:\"#fff\"},Duration:{type:ControlType.Number,defaultValue:1,min:.1,max:10,step:.1},delay:{title:\"Delay\",type:ControlType.Number,defaultValue:0,min:0,max:10,step:.1},replays:{title:\"Replays\",type:ControlType.Boolean,defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextColorAnimation\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Text_Animation_About_section_.map"],"mappings":"6OAAsN,SAAwB,EAAmB,CAAC,OAAK,WAAS,aAAW,aAAW,YAAU,UAAQ,UAAQ,WAAS,QAAM,WAAS,CAAC,IAAM,EAAS,GAAc,CAAO,EAAQA,GAAQ,CAC7L,OAD8L,MAAc,CAAC,IAAM,EAAS,IAAI,qBAAqB,MAAM,CAAC,KAAS,CAAI,EAAM,gBAAgB,MAAM,IAAI,QAAQ,GAAS,WAAW,EAAQ,EAAM,IAAI,CAAC,CACviB,EAAS,MAAM,UAAU,EAAU,CAAC,EAAM,gBAAgB,GAAS,EAAS,MAAM,SAAS,EAAI,CAAmC,OAAlC,EAAS,QAAQ,EAAQ,QAAQ,KAAW,EAAS,YAAY,EAAG,CAAC,EAAS,EAAS,EAAQ,EAAM,EAAQ,CAAC,CAAqB,EAAMC,EAAU,CAAC,SAAS,CAAc,EAAK,QAAQ,CAAC,SAAS,gHAAgH,CAAC,CAAc,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,EAAS,IAAe,aA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