{"version":3,"file":"ScrollRevealText.DdFFeR__.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/kgSZgSEtMTN62wYAhHuo/JTMKXrtyQ0lULs3rbU5L/ScrollRevealText.js"],"sourcesContent":["// Scroll reveal component where text changes based on scroll position with customizable start/end points, transitions, fonts, colors, and alignment\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useRef}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,useScroll,useTransform,useInView}from\"framer-motion\";/**\n * Scroll Reveal Text Component\n * \n * Text changes based on scroll position with customizable start/end points\n * \n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function ScrollRevealText(props){const{paragraphs=[{text:\"From reporting to resolution—keep your team aligned.\"},{text:\"Collaborate on issues, prioritize what matters, and ship flawless products with ease.\"}],startOffset=0,endOffset=100,beforeColor=\"#CCCCCC\",afterColor=\"#000000\",alignment=\"left\",font,transition}=props;const containerRef=useRef(null);const isStatic=useIsStaticRenderer();const isInView=useInView(containerRef,{margin:\"-20%\"});const{scrollYProgress}=useScroll({target:containerRef,offset:[`start ${100-startOffset}%`,`end ${100-endOffset}%`]});// Transform scroll progress to text reveal progress\nconst revealProgress=useTransform(scrollYProgress,[0,1],[0,1]);// Calculate individual paragraph reveal progress\nconst getParagraphProgress=(index,totalParagraphs)=>{const segmentSize=1/totalParagraphs;const segmentStart=index*segmentSize;const segmentEnd=(index+1)*segmentSize;return useTransform(revealProgress,[segmentStart,segmentEnd],[0,1]);};if(isStatic){return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{...props.style,position:\"relative\",width:\"100%\",textAlign:alignment,...font},children:paragraphs.map((paragraph,index)=>/*#__PURE__*/_jsx(\"div\",{style:{marginBottom:index<paragraphs.length-1?\"1em\":0},children:/*#__PURE__*/_jsx(\"span\",{style:{color:beforeColor},children:paragraph.text})},index))});}return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{...props.style,position:\"relative\",width:\"100%\",textAlign:alignment,...font},children:paragraphs.map((paragraph,index)=>{const paragraphProgress=getParagraphProgress(index,paragraphs.length);return /*#__PURE__*/_jsx(motion.div,{style:{marginBottom:index<paragraphs.length-1?\"1em\":0,position:\"relative\"},children:paragraph.text.split(\"\").map((char,charIndex)=>{const totalChars=paragraph.text.length;const charProgress=charIndex/totalChars;const nextCharProgress=(charIndex+1)/totalChars;return /*#__PURE__*/_jsx(motion.span,{style:{color:useTransform(paragraphProgress,[charProgress,nextCharProgress],[beforeColor,afterColor])},transition:transition,children:char},charIndex);})},index);})});}addPropertyControls(ScrollRevealText,{paragraphs:{type:ControlType.Array,title:\"Text Paragraphs\",control:{type:ControlType.Object,controls:{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Your text here\"}}},defaultValue:[{text:\"From reporting to resolution—keep your team aligned.\"},{text:\"Collaborate on issues, prioritize what matters, and ship flawless products with ease.\"}],maxCount:10},startOffset:{type:ControlType.Number,title:\"Start Offset\",defaultValue:0,min:0,max:100,step:5,unit:\"%\"},endOffset:{type:ControlType.Number,title:\"End Offset\",defaultValue:100,min:0,max:100,step:5,unit:\"%\"},beforeColor:{type:ControlType.Color,title:\"Before Color\",defaultValue:\"#CCCCCC\"},afterColor:{type:ControlType.Color,title:\"After Color\",defaultValue:\"#000000\"},alignment:{type:ControlType.Enum,title:\"Text Alignment\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"left\",displaySegmentedControl:true},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"32px\",variant:\"Semibold\",letterSpacing:\"-0.03em\",lineHeight:\"1.2em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},transition:{type:ControlType.Transition,title:\"Transition\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollRevealText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"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