{"version":3,"file":"TextReveal_1.EPZwGDUD.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/gGXLFANbZFKf2qU8bbVL/uQjjbN7Yn6nBRqTZdwzU/HoKrrnQcM.js","https:/framerusercontent.com/modules/dTEX4b7x3bKwdyWofEbg/DWkvPMX9TqIoQqko5xHl/TextReveal_1.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 0 0 L 5.5 5.25 L 0 10.5\" fill=\"transparent\" height=\"10.5px\" id=\"pTO_zwTXv\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--1335ju, 1.5)\" stroke=\"var(--18mrqx2, rgb(0, 0, 0))\" transform=\"translate(13.75 6.75)\" width=\"5.5px\"/><path d=\"M 14.25 0 L 0 0\" fill=\"transparent\" height=\"1px\" id=\"Jh7NTfV71\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--1335ju, 1.5)\" stroke=\"var(--18mrqx2, rgb(0, 0, 0))\" transform=\"translate(4.75 12)\" width=\"14.25px\"/></svg>';const getProps=({dots,height,id,stroke,width,width1,...props})=>{return{...props,BKVe8Pgvw:dots??props.BKVe8Pgvw??1,fICyAUQY1:stroke??props.fICyAUQY1??\"rgb(0, 0, 0)\",lKf_CQTz5:width1??props.lKf_CQTz5??1.5};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,fICyAUQY1,lKf_CQTz5,BKVe8Pgvw,...restProps}=getProps(props);const href=useSVGTemplate(\"1173457374\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-EcgqK\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1335ju\":lKf_CQTz5,\"--18mrqx2\":fICyAUQY1,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-EcgqK { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"fICyAUQY1\":\"stroke\",\"lKf_CQTz5\":\"width1\",\"BKVe8Pgvw\":\"dots\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Arrow Right\",\"color\":{\"type\":\"variable\",\"value\":\"18mrqx2\"},\"set\":{\"localId\":\"vectorSet/SuYHhKUZG\",\"id\":\"SuYHhKUZG\",\"moduleId\":\"EqX8thWQjdZcOB1c6p5N\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-EcgqK\");Icon.displayName=\"Arrow Right\";export default Icon;addPropertyControls(Icon,{fICyAUQY1:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Stroke\",type:ControlType.Color},lKf_CQTz5:{defaultValue:1.5,displayStepper:true,hidden:false,max:4,min:0,step:.5,title:\"Width\",type:ControlType.Number},BKVe8Pgvw:{defaultValue:1,displayStepper:true,hidden:true,max:4,min:1,title:\"Dots\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"24\",\"framerIntrinsicHeight\":\"24\",\"framerVariables\":\"{\\\"fICyAUQY1\\\":\\\"stroke\\\",\\\"lKf_CQTz5\\\":\\\"width1\\\",\\\"BKVe8Pgvw\\\":\\\"dots\\\"}\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerVector\":\"{\\\"name\\\":\\\"Arrow Right\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"18mrqx2\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/SuYHhKUZG\\\",\\\"id\\\":\\\"SuYHhKUZG\\\",\\\"moduleId\\\":\\\"EqX8thWQjdZcOB1c6p5N\\\"}}\",\"framerContractVersion\":\"1\",\"framerImmutableVariables\":\"true\",\"framerDisableUnlink\":\"true\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useEffect,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * TextReveal - Text that reveals as you scroll with responsive font sizing\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function TextReveal(props){const{text=\"This text unblurs and fades in word by word as you scroll\",baseColor=\"#888888\",revealColor=\"#000000\",font={fontSize:24,lineHeight:1.5,letterSpacing:\"0em\",variant:\"Regular\",textAlign:\"left\"},fullRevealDistance=1e3,initialBlur=3,tag=\"p\",fitText=false,minFontSize=16,maxFontSize=72,style={}}=props;const outerRef=useRef(null);const containerRef=useRef(null);const animationFrameRef=useRef(null);const words=(text||\"\").split(\" \");const[scrollProgress,setScrollProgress]=useState(0);const[fontSize,setFontSize]=useState(font?.fontSize||24);const isCanvas=RenderTarget.current()===RenderTarget.canvas;// Effect for responsive font sizing (also run in canvas)\nuseEffect(()=>{if(!fitText)return;const handleResize=()=>{if(!containerRef.current||typeof window===\"undefined\")return;// Get container width (prefer container, fallback to viewport)\nconst containerWidth=containerRef.current.offsetWidth||window.innerWidth;const baseFontSize=parseInt(font?.fontSize)||24;// Use a base width of 1000px as reference\nconst baseWidth=1e3;// Calculate proportional font size\nconst scaledFontSize=baseFontSize*(containerWidth/baseWidth);// Clamp between min and max font sizes\nconst clampedSize=Math.max(minFontSize,Math.min(maxFontSize,scaledFontSize));setFontSize(clampedSize);};handleResize();window.addEventListener(\"resize\",handleResize);return()=>{window.removeEventListener(\"resize\",handleResize);};},[fitText,font?.fontSize,minFontSize,maxFontSize]);// Effect for scroll tracking\nuseEffect(()=>{if(isCanvas)return;let startPosition=0;let containerHeight=0;let endPosition=0;const updateScrollPositions=()=>{if(outerRef.current){const rect=outerRef.current.getBoundingClientRect();startPosition=window.scrollY+rect.top;containerHeight=rect.height;endPosition=startPosition+fullRevealDistance;}};const handleScroll=()=>{if(!outerRef.current)return;const currentScroll=window.scrollY;const elementTop=startPosition-currentScroll;const visibleHeight=window.innerHeight-elementTop;const progress=(visibleHeight-containerHeight)/(fullRevealDistance-containerHeight);setScrollProgress(Math.max(0,Math.min(1,progress)));};const trackScroll=()=>{handleScroll();animationFrameRef.current=requestAnimationFrame(trackScroll);};const initializeScrollTracking=()=>{updateScrollPositions();handleScroll();animationFrameRef.current=requestAnimationFrame(trackScroll);};window.addEventListener(\"resize\",updateScrollPositions);initializeScrollTracking();return()=>{cancelAnimationFrame(animationFrameRef.current);window.removeEventListener(\"resize\",updateScrollPositions);};},[fullRevealDistance,isCanvas]);// Effect for responsive font sizing\nuseEffect(()=>{if(!fitText||isCanvas)return;const handleResize=()=>{if(!containerRef.current||typeof window===\"undefined\")return;// Get container width (prefer container, fallback to viewport)\nconst containerWidth=containerRef.current.offsetWidth||window.innerWidth;const baseFontSize=parseInt(font?.fontSize)||24;// Use a base width of 1000px as reference\nconst baseWidth=1e3;// Calculate proportional font size\nconst scaledFontSize=baseFontSize*(containerWidth/baseWidth);// Clamp between min and max font sizes\nconst clampedSize=Math.max(minFontSize,Math.min(maxFontSize,scaledFontSize));setFontSize(clampedSize);};handleResize();window.addEventListener(\"resize\",handleResize);return()=>{window.removeEventListener(\"resize\",handleResize);};},[fitText,font?.fontSize,minFontSize,maxFontSize,isCanvas]);const Tag=tag;return /*#__PURE__*/_jsx(\"div\",{ref:outerRef,style:{minWidth:5,minHeight:5,width:style.width||100,// Remove fixed height, let height fit content\ndisplay:\"flex\",alignItems:\"flex-start\",justifyContent:\"flex-start\",...style},children:/*#__PURE__*/_jsx(Tag,{ref:containerRef,style:{position:\"sticky\",top:0,fontFamily:font?.fontFamily,fontWeight:font?.fontWeight,fontSize:fitText?`${fontSize}px`:font?.fontSize,lineHeight:font?.lineHeight,letterSpacing:font?.letterSpacing,textAlign:font?.textAlign,margin:0,padding:0,width:\"100%\",minWidth:5,minHeight:5},children:words.map((word,index)=>{const wordProgress=isCanvas?1:scrollProgress*words.length-index;const progress=Math.max(0,Math.min(1,wordProgress));const blurAmount=initialBlur*(1-progress);const color=progress===1?revealColor:baseColor;return /*#__PURE__*/_jsx(\"span\",{style:{display:\"inline-block\",marginRight:\"0.25em\",filter:`blur(${blurAmount}px)`,color:color,transition:\"filter 0.2s ease-out, color 0.2s ease-out\"},children:word},index);})})});}addPropertyControls(TextReveal,{text:{type:ControlType.String,title:\"Text\",displayTextArea:true},baseColor:{type:ControlType.Color,title:\"Base Color\",defaultValue:\"#888888\"},revealColor:{type:ControlType.Color,title:\"Reveal Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:24,lineHeight:1.5,letterSpacing:\"0em\",variant:\"Regular\",textAlign:\"left\"}},fullRevealDistance:{type:ControlType.Number,title:\"Full Reveal Distance\",min:100,max:5e3,step:10,defaultValue:1e3},initialBlur:{type:ControlType.Number,title:\"Initial Blur\",min:0,max:10,step:.5,defaultValue:3},tag:{type:ControlType.Enum,title:\"Tag\",options:[\"p\",\"h1\",\"h2\",\"h3\"],optionTitles:[\"P\",\"H1\",\"H2\",\"H3\"],defaultValue:\"p\",displaySegmentedControl:true},fitText:{type:ControlType.Boolean,title:\"Responsive Text\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\",description:\"Scale font size based on screen width\"},minFontSize:{type:ControlType.Number,title:\"Min Font Size\",defaultValue:16,min:8,max:48,step:1,unit:\"px\",hidden:({fitText})=>!fitText},maxFontSize:{type:ControlType.Number,title:\"Max Font Size\",defaultValue:72,min:24,max:200,step:1,unit:\"px\",hidden:({fitText})=>!fitText}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextReveal\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextReveal_1.map"],"mappings":"sTAC2C,IAAqF,IAA4B,CAAoC,EAAK,0BAAgC,EAAkB,EAAW,SAAS,EAAM,EAAI,CAAC,OAAoB,EAAK,MAAM,CAAC,GAAG,EAAU,MAAI,SAAS,EAAM,SAAS,CAAC,EAAG,CAAO,EAAU,EAAO,OAAO,EAAK,CAAO,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG,GAAM,EAAM,OAAO,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAc,WAAa,MAAa,WAAS,CAAC,CAAc,EAAK,MAAM,CAAC,GAAG,EAAS,MAAa,WAAS,CAAC,EAAG,CAAO,EAAI,+nBAAqoB,GAAU,CAAC,OAAK,SAAO,KAAG,SAAO,QAAM,SAAO,GAAG,MAAgB,CAAC,GAAG,EAAM,UAAU,GAAM,EAAM,WAAW,EAAE,UAAU,GAAQ,EAAM,WAAW,eAAe,UAAU,GAAQ,EAAM,WAAW,IAAI,EAUx9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