{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/25JEPkKrfa8J9J0EGzti/fl7XIKLe8aA0wPnxMvE1/TextRevealScroll.js"],
  "sourcesContent": ["// Text reveal scroll component that reveals another layer of text as user scrolls down\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef}from\"react\";import{useScroll,useTransform,motion,useInView}from\"framer-motion\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function TextRevealScroll(props){const{backgroundText=\"SCROLL TO REVEAL\",revealText=\"AMAZING CONTENT\",backgroundColor=\"#000000\",backgroundTextColor=\"#333333\",revealTextColor=\"#FFFFFF\",backgroundFont,revealFont,alignment=\"center\",revealMode=\"line\",startOffset=0,endOffset=100}=props;const containerRef=useRef(null);const isInView=useInView(containerRef,{once:false,margin:\"0px\"});const isStatic=useIsStaticRenderer();const{scrollYProgress}=useScroll({target:containerRef,offset:[\"start end\",\"end start\"]});// Transform scroll progress to reveal progress with custom start/end offsets\nconst revealProgress=useTransform(scrollYProgress,[startOffset/100,endOffset/100],[0,100]);// Split text based on reveal mode\nconst splitText=text=>{switch(revealMode){case\"line\":return text.split(\"\\n\").map(line=>line||\" \");case\"word\":return text.split(/(\\s+)/);case\"letter\":return text.split(\"\");default:return[text];}};const textParts=splitText(revealText);const backgroundParts=splitText(backgroundText);if(isStatic){return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",backgroundColor,display:\"flex\",alignItems:\"center\",justifyContent:alignment,overflow:\"hidden\",padding:\"40px 20px\"},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",textAlign:alignment,...revealFont,color:revealTextColor,whiteSpace:\"pre-wrap\",wordBreak:\"break-word\"},children:revealText})});}return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",backgroundColor,display:\"flex\",alignItems:\"center\",justifyContent:alignment,overflow:\"hidden\",padding:\"40px 20px\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",textAlign:alignment,...backgroundFont,color:backgroundTextColor,whiteSpace:\"pre-wrap\",wordBreak:\"break-word\",zIndex:1,width:\"calc(100% - 40px)\",display:revealMode===\"line\"?\"block\":\"inline\"},children:revealMode===\"line\"?backgroundParts.map((part,index)=>/*#__PURE__*/_jsx(\"div\",{style:{display:\"block\"},children:part},index)):backgroundParts.map((part,index)=>/*#__PURE__*/_jsx(\"span\",{style:{display:revealMode===\"word\"?\"inline\":\"inline-block\"},children:part},index))}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",textAlign:alignment,...revealFont,color:revealTextColor,whiteSpace:\"pre-wrap\",wordBreak:\"break-word\",zIndex:2,width:\"calc(100% - 40px)\",display:revealMode===\"line\"?\"block\":\"inline\"},children:revealMode===\"line\"?textParts.map((part,index)=>{const partProgress=(index+1)/textParts.length*100;return /*#__PURE__*/_jsx(motion.div,{style:{display:\"block\",opacity:useTransform(revealProgress,[partProgress-100/textParts.length,partProgress],[0,1])},children:part},index);}):textParts.map((part,index)=>{const partProgress=(index+1)/textParts.length*100;return /*#__PURE__*/_jsx(motion.span,{style:{display:revealMode===\"word\"?\"inline\":\"inline-block\",opacity:useTransform(revealProgress,[partProgress-100/textParts.length,partProgress],[0,1])},children:part},index);})})]});}addPropertyControls(TextRevealScroll,{backgroundText:{type:ControlType.String,title:\"Background Text\",defaultValue:\"SCROLL TO REVEAL\",displayTextArea:true},revealText:{type:ControlType.String,title:\"Reveal Text\",defaultValue:\"AMAZING CONTENT\",displayTextArea:true},revealMode:{type:ControlType.Enum,title:\"Reveal Mode\",options:[\"line\",\"word\",\"letter\"],optionTitles:[\"Line by Line\",\"Word by Word\",\"Letter by Letter\"],defaultValue:\"line\",displaySegmentedControl:true},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#000000\"},backgroundTextColor:{type:ControlType.Color,title:\"Background Text Color\",defaultValue:\"#333333\"},revealTextColor:{type:ControlType.Color,title:\"Reveal Text Color\",defaultValue:\"#FFFFFF\"},backgroundFont:{type:ControlType.Font,title:\"Background Font\",defaultValue:{fontSize:\"48px\",variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1.1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},revealFont:{type:ControlType.Font,title:\"Reveal Font\",defaultValue:{fontSize:\"48px\",variant:\"Bold\",letterSpacing:\"-0.02em\",lineHeight:\"1.1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},alignment:{type:ControlType.Enum,title:\"Text Alignment\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\",displaySegmentedControl:true},startOffset:{type:ControlType.Number,title:\"Start Offset\",defaultValue:0,min:0,max:100},endOffset:{type:ControlType.Number,title:\"End Offset\",defaultValue:100,min:0,max:100}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextRevealScroll\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextRevealScroll.map"],
  "mappings": "0IAIkB,SAARA,EAAkCC,EAAM,CAAC,GAAK,CAAC,eAAAC,EAAe,mBAAmB,WAAAC,EAAW,kBAAkB,gBAAAC,EAAgB,UAAU,oBAAAC,EAAoB,UAAU,gBAAAC,EAAgB,UAAU,eAAAC,EAAe,WAAAC,EAAW,UAAAC,EAAU,SAAS,WAAAC,EAAW,OAAO,YAAAC,EAAY,EAAE,UAAAC,EAAU,GAAG,EAAEX,EAAYY,EAAaC,E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undColor", "backgroundTextColor", "revealTextColor", "backgroundFont", "revealFont", "alignment", "revealMode", "startOffset", "endOffset", "containerRef", "pe", "isInView", "useInView", "isStatic", "useIsStaticRenderer", "scrollYProgress", "useScroll", "revealProgress", "useTransform", "splitText", "text", "line", "textParts", "backgroundParts", "p", "u", "part", "index", "partProgress", "motion", "addPropertyControls", "ControlType"]
}
