{"version":3,"file":"Text_Opacity_Letters.CUNhiPqf.mjs","names":[],"sources":["https:/framerusercontent.com/modules/rjv4LY3PamFi1kzloCs0/n1CbuMyqNS1KF3EpLwdd/Text_Opacity_Letters.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 EachCharacter=({char,start,end,progress})=>{const opacityProgress=useTransform(progress,[start,end],[.1,1]);return /*#__PURE__*/_jsx(motion.span,{style:{opacity:opacityProgress},children:char});};const EachWord=({word,progress,starting,ending})=>{const characters=word.split(\"\");const wordLength=word.length;const amount=ending-starting;const step=amount/wordLength;return /*#__PURE__*/_jsxs(motion.span,{children:[characters.map((char,idx)=>{const charStart=starting+step*idx;const charEnd=starting+step*(idx+1);return /*#__PURE__*/_jsx(EachCharacter,{char:char,start:charStart,end:charEnd,progress:progress});}),\"\\xa0\"]});};/**\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_Letters(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,display:\"flex\",flexWrap:\"wrap\",color:props.textColor},children:words.map((word,idx)=>{const starting=idx/totalWords;const ending=(idx+1)/totalWords;return /*#__PURE__*/_jsx(EachWord,{word:word,progress:scrollYProgress,starting:starting,ending:ending});})});}addPropertyControls(Text_Opacity_Letters,{text:{title:\"Text\",type:ControlType.String,defaultValue:\"Hello Text\"},font:{type:\"font\",controls:\"extended\"},textColor:{type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Text_Opacity_Letters\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Text_Opacity_Letters.map"],"mappings":"0XAQG,SAAwB,EAAqB,EAAM,CAAC,IAAM,EAAK,EAAM,KAAW,EAAM,EAAK,MAAM,IAAI,CAAO,EAAW,EAAM,OAAa,EAAI,EAAO,KAAK,CAAM,CAAC,kBAAgB,CAAC,EAAU,CAAC,OAAO,EAAI,OAAO,CAAC,aAAa,YAAa,CAAC,EAAC,CAAC,MAAoB,GAAK,IAAI,CAAK,MAAI,MAAM,CAAC,GAAG,EAAM,KAAK,QAAQ,OAAO,SAAS,OAAO,MAAM,EAAM,SAAU,EAAC,SAAS,EAAM,IAAI,CAAC,EAAK,IAAM,CAAC,IAAM,EAAS,EAAI,EAAiB,GAAQ,EAAI,GAAG,EAAW,MAAoB,GAAK,EAAS,CAAM,OAAK,SAAS,EAAyB,WAAgB,QAAO,EAAC,AAAE,EAAC,AAAC,EAAC,AAAE,kBAAA,AAN7iB,GAAyD,IAAoD,IAAyD,IAA0B,CAAM,EAAc,CAAC,CAAC,OAAK,QAAM,MAAI,WAAS,GAAG,CAAC,IAAM,EAAgB,EAAa,EAAS,CAAC,EAAM,CAAI,EAAC,CAAC,GAAG,CAAE,EAAC,CAAC,MAAoB,GAAK,EAAO,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAgB,EAAC,SAAS,CAAK,EAAC,AAAE,EAAO,EAAS,CAAC,CAAC,OAAK,WAAS,WAAS,SAAO,GAAG,CAAC,IAAM,EAAW,EAAK,MAAM,GAAG,CAAO,EAAW,EAAK,OAAa,EAAO,EAAO,EAAe,EAAK,EAAO,EAAW,MAAoB,GAAM,EAAO,KAAK,CAAC,SAAS,CAAC,EAAW,IAAI,CAAC,EAAK,IAAM,CAAC,IAAM,EAAU,EAAS,EAAK,EA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