{"version":3,"file":"Text_Opacity_Words.BCm3A7vl.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/vZXrAaDxtBiIKMnqtNhO/6OSoM87M5l0KG7Ydln9v/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],[.1,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.15\"]});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\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Text_Opacity_Words.map"],"mappings":"gPAQG,SAAwB,EAAmB,EAAM,CAAuB,IAAM,EAAjB,EAAM,KAAsB,MAAM,IAAI,CAAO,EAAW,EAAM,OAAa,EAAIA,EAAO,KAAK,CAAM,CAAC,mBAAiB,EAAU,CAAC,OAAO,EAAI,OAAO,CAAC,aAAa,aAAa,CAAC,CAAC,CAAC,OAAoB,EAAK,IAAI,CAAK,MAAI,MAAM,CAAC,GAAG,EAAM,KAAK,MAAM,EAAM,UAAU,CAAC,SAAS,EAAM,KAAK,EAAK,IAAyF,EAAK,EAAS,CAAM,OAAK,SAA5F,EAAI,EAA0G,QAAjF,EAAI,GAAG,EAAwF,SAAS,EAAgB,CAAC,CAAG,CAAC,CAAC,oBANjd,IAAoD,IAAyD,IAA0B,CAAM,GAAU,CAAC,OAAK,WAAS,SAAO,cAAY,CAAW,GAAQ,CAAC,IAAM,EAAY,EAAa,EAAS,CAAC,EAAS,EAAO,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,OAAoB,EAAM,EAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAY,CAAC,SAAS,CAAC,EAAK,IAAI,CAAC,CAAC,EAM4G,EAAoB,EAAmB,CAAC,KAAK,CAAC,MAAM,OAAO,KAAK,EAAY,OAAO,aAAa,QAAQ,CAAC,KAAK,CAAC,KAAK,OAAO,SAAS,WAAW,CAAC,UAAU,CAAC,KAAK,EAAY,MAAM,CAAC,CAAC"}