{"version":3,"file":"Examples.CLU6Ut2y.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/xpUANLUYs0J3TkWEzRBK/eXjwWWqt502UMQmT4cel/Examples.js"],"sourcesContent":["import{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 opacity=useTransform(progress,[starting,ending],[.15,1]);return /*#__PURE__*/_jsxs(motion.span,{style:{opacity},children:[word,\" \"]});};export default function ScrollRevealText(props){const{text,textColor,font,startOffset,endOffset}=props;const words=text.split(\" \");const totalWords=words.length;const ref=useRef(null);const{scrollYProgress}=useScroll({target:ref,offset:[`start ${1-startOffset}`,`end ${1-endOffset}`]});return /*#__PURE__*/_jsx(\"p\",{ref:ref,style:{...font,color:textColor,margin:0,padding:0,// KHẮC PHỤC: Đưa lineHeight về giá trị gốc và xóa textAlign\n// để giữ khoảng cách từ như ban đầu.\nlineHeight:1.1},children:words.map((word,idx)=>{const starting=idx/totalWords;const ending=(idx+.8)/totalWords;return /*#__PURE__*/_jsx(EachWord,{word:word,starting:starting,ending:ending,progress:scrollYProgress},idx);})});}// Property Controls không thay đổi\naddPropertyControls(ScrollRevealText,{text:{title:\"Text\",type:ControlType.String,defaultValue:\"Step into the future where each collection is a doorway to a different realm. From the nomadic trails of the desert to the bustling streets of the urban jungle, our collections merge the past's heritage with the future's possibilities. Futuristic architecture in the Amazon jungle\",displayTextArea:true},font:{type:\"font\",controls:\"extended\"},textColor:{type:ControlType.Color,defaultValue:\"#FFFFFF\"},startOffset:{title:\"Start Offset\",type:ControlType.Number,defaultValue:.9,min:0,max:1,step:.01,display:\"slider\"},endOffset:{title:\"End Offset\",type:ControlType.Number,defaultValue:.9,min:0,max:1,step:.01,display:\"slider\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollRevealText\",\"slots\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