{"version":3,"file":"Text_reveal.BKJGoSLF.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/sj6Zj1jwC3Y5Vbj3FhNF/jZgqG0C4MeX2zGig0IN9/Text_reveal.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion,useScroll,useTransform,useSpring}from\"framer-motion\";import{useRef,useEffect,useState}from\"react\";const EachWord=({word,starting,ending,startOpacity,endOpacity,progress,stiffness,damping})=>{const[sanitizedWord,setSanitizedWord]=useState(word);const progressVal=useTransform(progress,[starting,ending],[startOpacity,endOpacity]);const smoothProgress=useSpring(progressVal,{stiffness,damping});const animationStyles={opacity:smoothProgress,willChange:\"opacity\"};useEffect(()=>{if(typeof window!==\"undefined\"){import(\"dompurify\").then(DOMPurify=>{setSanitizedWord(DOMPurify.sanitize(word));});}},[word]);return /*#__PURE__*/_jsx(motion.span,{style:animationStyles,dangerouslySetInnerHTML:{__html:sanitizedWord}});};export default function Reveal(props){const text=props.text;const words=text.split(/(<[^>]+>[^<]*<\\/[^>]+>|<[^>]+>|[^<>\\s]+)/g).filter(Boolean)// Split by HTML tags and words, keeping tags with their content together\n;const totalWords=words.length;const ref=useRef(null);const{scrollYProgress}=useScroll({target:ref,offset:[`start ${props.startOffset}`,`end ${props.endOffset}`]});return /*#__PURE__*/_jsx(\"p\",{ref:ref,style:{...props.font,color:props.textColor,margin:0,padding:0},children:words.map((word,idx)=>{const starting=idx/totalWords;const ending=(idx+1)/totalWords;return /*#__PURE__*/_jsx(EachWord,{word:word,starting:starting,ending:ending,startOpacity:props.startOpacity,endOpacity:props.endOpacity,progress:scrollYProgress,stiffness:props.stiffness,damping:props.damping},idx);})});}addPropertyControls(Reveal,{text:{title:\"Text\",type:ControlType.String,defaultValue:\"Step into the future where each collection is a doorway to a different realm. <br><br>From the <b>nomadic trails</b> of the desert to the bustling streets of the urban jungle, our collections merge the <u>past's heritage</u> with the future's possibilities.<br><br>Futuristic architecture in the Amazon jungle\",displayTextArea:true},font:{type:\"font\",controls:\"extended\"},textColor:{type:ControlType.Color},startOffset:{title:\"Start Offset\",type:ControlType.Number,defaultValue:.75,min:0,max:1,step:.01},endOffset:{title:\"End Offset\",type:ControlType.Number,defaultValue:.15,min:0,max:1,step:.01},stiffness:{title:\"Stiffness\",type:ControlType.Number,defaultValue:100,min:0,max:1e3,step:1},damping:{title:\"Damping\",type:ControlType.Number,defaultValue:20,min:0,max:100,step:1},startOpacity:{title:\"Start Opacity\",type:ControlType.Number,defaultValue:.1,min:0,max:1,step:.01},endOpacity:{title:\"End Opacity\",type:ControlType.Number,defaultValue:1,min:0,max:1,step:.01}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Reveal\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Text_reveal.map"],"mappings":"4QAAszB,SAAwB,EAAO,EAAM,CAAuB,IAAM,EAAjB,EAAM,KAAsB,MAAM,4CAA4C,CAAC,OAAO,QAAQ,CAC97B,EAAW,EAAM,OAAa,EAAIA,EAAO,KAAK,CAAM,CAAC,mBAAiB,EAAU,CAAC,OAAO,EAAI,OAAO,CAAC,SAAS,EAAM,cAAc,OAAO,EAAM,YAAY,CAAC,CAAC,CAAC,OAAoB,EAAK,IAAI,CAAK,MAAI,MAAM,CAAC,GAAG,EAAM,KAAK,MAAM,EAAM,UAAU,OAAO,EAAE,QAAQ,EAAE,CAAC,SAAS,EAAM,KAAK,EAAK,IAAyF,EAAK,EAAS,CAAM,OAAK,SAA5F,EAAI,EAA0G,QAAjF,EAAI,GAAG,EAAwF,aAAa,EAAM,aAAa,WAAW,EAAM,WAAW,SAAS,EAAgB,UAAU,EAAM,UAAU,QAAQ,EAAM,QAAQ,CAAC,EAAI,CAAG,CAAC,CAAC,wBADxhB,IAAoD,IAAmE,IAA6C,CAAM,GAAU,CAAC,OAAK,W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