{"version":3,"file":"Text_Opacity_Words.CIIUSs8k.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/xg321FpfebrjHiKjwRPN/nL4UGbQuhIpUNQqp9Bs4/Text_Opacity_Words.js"],"sourcesContent":["// Welcome to Code in Framer\n// Get Started: https://www.framer.com/developers\nimport{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\";const EachWord=({word,starting,ending,progress})=>{const ref=useRef();const progressVal=useTransform(progress,[starting,ending],[.2,1]);return /*#__PURE__*/_jsxs(motion.span,{style:{opacity:progressVal},children:[word,\" \"]});};/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function Text_Opacity_Words(props){const text=props.text;const words=text.split(\" \");const totalWords=words.length;const ref=useRef(null);const{scrollYProgress}=useScroll({target:ref,offset:[\"start 0.75\",\"start 0.35\"]});return /*#__PURE__*/_jsx(\"p\",{ref:ref,style:{...props.font,color:props.textColor},children:words.map((word,idx)=>{const starting=idx/totalWords;const ending=(idx+1)/totalWords;return /*#__PURE__*/_jsx(EachWord,{word:word,starting:starting,ending:ending,progress:scrollYProgress});})});}addPropertyControls(Text_Opacity_Words,{text:{title:\"Text\",type:ControlType.String,defaultValue:\"Hello\"},font:{type:\"font\",controls:\"extended\"},textColor:{type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Text_Opacity_Words\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Text_Opacity_Words.map"],"mappings":"gPAQG,SAAwB,EAAmB,EAAM,CAAuB,IAAM,EAAjB,EAAM,KAAsB,MAAM,GAAG,EAAQ,EAAW,EAAM,OAAa,EAAIA,EAAO,IAAI,EAAO,CAAC,mBAAiB,EAAU,CAAC,OAAO,EAAI,OAAO,CAAC,aAAa,YAAY,CAAC,CAAC,EAAE,OAAoB,EAAK,IAAI,CAAK,MAAI,MAAM,CAAC,GAAG,EAAM,KAAK,MAAM,EAAM,SAAS,EAAE,SAAS,EAAM,KAAK,EAAK,IAAM,CAAC,IAAM,EAAS,EAAI,EAAiB,GAAQ,EAAI,GAAG,EAAW,OAAoB,EAAK,EAAS,CAAM,OAAc,WAAgB,SAAO,SAAS,CAAe,CAAC,CAAE,CAAC,CAAC,CAAC,CAAE,mBANnd,IAAoD,IAAyD,IAA0B,EAAO,GAAU,CAAC,OAAK,WAAS,SAAO,cAAY,CAAW,EAAO,EAAE,IAAM,EAAY,EAAa,EAAS,CAAC,EAAS,CAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,OAAoB,EAAM,EAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAW,EAAE,SAAS,CAAC,EAAK,GAAG,CAAC,CAAC,CAAE,EAM2G,EAAoB,EAAmB,CAAC,KAAK,CAAC,MAAM,OAAO,KAAK,EAAY,OAAO,aAAa,OAAO,EAAE,KAAK,CAAC,KAAK,OAAO,SAAS,UAAU,EAAE,UAAU,CAAC,KAAK,EAAY,KAAK,CAAC,CAAC"}