{"version":3,"file":"ImageMaskText.CCpMmFTH.mjs","names":["useRef","useState","useMemo"],"sources":["https:/framerusercontent.com/modules/5AxMEugeUkCUuqLmNLEF/EZrMgHtd43FppBJmiutd/Scroll_reveal_1_1.js","https:/framerusercontent.com/modules/Q2QaIrUFpWWlG3HMDsxi/8J7lXDGmbE2LGfNDjFvR/ImageMaskText.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useEffect,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";export default function StickyBlurReveal(props){const{text,color,font,fontSize,lineHeight,letterSpacing,alignment,fullRevealDistance,initialBlur,initialOpacity,fadeDelay,fadeDuration,fadeEasing}=props;const containerRef=useRef(null);const words=text.split(\" \");const[scrollProgress,setScrollProgress]=useState(0);const[isVisible,setIsVisible]=useState(false);const isCanvas=RenderTarget.current()===RenderTarget.canvas;useEffect(()=>{if(isCanvas)return;let startPosition=0;let containerHeight=0;const observer=new IntersectionObserver(([entry])=>{if(entry.isIntersecting){setIsVisible(true);const rect=entry.boundingClientRect;startPosition=window.scrollY+rect.top;containerHeight=rect.height;handleScroll();}else{setIsVisible(false);}},{threshold:[0]});if(containerRef.current){observer.observe(containerRef.current);}const handleScroll=()=>{if(!isVisible)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)));};window.addEventListener(\"scroll\",handleScroll,{passive:true});return()=>{window.removeEventListener(\"scroll\",handleScroll);if(containerRef.current){observer.unobserve(containerRef.current);}};},[fullRevealDistance,isCanvas,isVisible]);return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:{position:\"sticky\",top:0,width:\"100%\",color,fontFamily:font?.fontFamily,fontWeight:font?.fontWeight,fontSize:`${fontSize}px`,lineHeight,letterSpacing:`${letterSpacing}px`,textAlign:alignment,opacity:isVisible||isCanvas?1:0,padding:0,margin:0,boxSizing:\"border-box\"},children:words.map((word,index)=>{const wordProgress=isCanvas?1:(scrollProgress-index/words.length)*words.length;const progress=Math.max(0,Math.min(1,wordProgress));const blurAmount=initialBlur*(1-progress);const opacity=initialOpacity+(1-initialOpacity)*progress;return /*#__PURE__*/_jsx(\"span\",{style:{display:\"inline-block\",marginRight:\"0.25em\",filter:`blur(${blurAmount}px)`,opacity,transition:`filter ${fadeDuration}s ${fadeEasing}, opacity ${fadeDuration}s ${fadeEasing}`,transitionDelay:`${fadeDelay*index}s`},children:word},index);})});}StickyBlurReveal.defaultProps={text:\"This text unblurs and fades in word by word as you scroll\",color:\"#000000\",font:{fontFamily:\"Inter\",fontWeight:400},fontSize:24,lineHeight:1.5,letterSpacing:0,alignment:\"center\",fullRevealDistance:1e3,initialBlur:3,initialOpacity:.1,fadeDelay:.02,fadeDuration:.3,fadeEasing:\"ease-out\"};addPropertyControls(StickyBlurReveal,{text:{type:ControlType.String,title:\"Text\",displayText:\"Scroll-triggered reveal text\"},color:{type:ControlType.Color,title:\"Color\"},// Font Controls\nfont:{type:ControlType.Font,title:\"Font\"},fontSize:{type:ControlType.Number,title:\"Font Size\",min:1,max:100,defaultValue:24},lineHeight:{type:ControlType.Number,title:\"Line Height\",min:.5,max:3,step:.1,defaultValue:1.5},letterSpacing:{type:ControlType.Number,title:\"Letter Spacing\",min:-5,max:20,step:.1,defaultValue:0},alignment:{type:ControlType.Enum,title:\"Text Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\"},// Animation Controls\nfullRevealDistance:{type:ControlType.Number,title:\"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},initialOpacity:{type:ControlType.Number,title:\"Initial Opacity\",min:0,max:1,step:.05,defaultValue:.1},fadeDelay:{type:ControlType.Number,title:\"Fade Delay (per word)\",min:0,max:1,step:.01,defaultValue:.02},fadeDuration:{type:ControlType.Number,title:\"Fade Duration\",min:.1,max:2,step:.1,defaultValue:.3},fadeEasing:{type:ControlType.Enum,title:\"Fade Easing\",options:[\"linear\",\"ease\",\"ease-in\",\"ease-out\",\"ease-in-out\"],defaultValue:\"ease-out\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StickyBlurReveal\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Scroll_reveal_1_1.map","// Customizable text component with image mask, adjustable image fit (cover, contain, percent), and font controls\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * ImageMaskText\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ImageMaskText(props){const{text,image,imageFit,imagePercent,font,style}=props;// Calculate background size and position\nconst bgSize=useMemo(()=>{if(imageFit===\"cover\")return\"cover\";if(imageFit===\"contain\")return\"contain\";// percent\nreturn`${imagePercent}%`;},[imageFit,imagePercent]);const bgPosition=useMemo(()=>{if(imageFit===\"percent\")return\"center\";return\"center\";},[imageFit]);// Map text alignment to flex justifyContent\nconst justifyContent=useMemo(()=>{const textAlign=font?.textAlign||\"center\";switch(textAlign){case\"left\":return\"flex-start\";case\"right\":return\"flex-end\";case\"center\":default:return\"center\";}},[font?.textAlign]);const useImageMask=image&&image.src&&imageFit!==undefined&&image.src!==\"\";return /*#__PURE__*/_jsx(\"div\",{style:{...style,width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:justifyContent,position:\"relative\",overflow:\"hidden\"},children:/*#__PURE__*/_jsx(\"span\",{style:{...font,width:\"max-content\",minWidth:0,...useImageMask?{backgroundImage:`url(${image.src})`,backgroundSize:bgSize,backgroundPosition:bgPosition,backgroundRepeat:\"no-repeat\",WebkitBackgroundClip:\"text\",WebkitTextFillColor:\"transparent\",backgroundClip:\"text\",color:\"transparent\"}:{color:props.textColor},display:\"inline-block\",textAlign:font?.textAlign||\"center\",lineHeight:font?.lineHeight||1.1,fontSize:font?.fontSize||40,fontWeight:font?.fontWeight,fontStyle:font?.fontStyle},\"aria-label\":text,children:text})});}addPropertyControls(ImageMaskText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Masked Text\"},image:{type:ControlType.ResponsiveImage,title:\"Image\"},imageFit:{type:ControlType.Enum,title:\"Image Fit\",options:[\"cover\",\"contain\",\"percent\"],optionTitles:[\"Cover\",\"Contain\",\"Percent\"],defaultValue:\"cover\",displaySegmentedControl:true},imagePercent:{type:ControlType.Number,title:\"Image %\",defaultValue:100,min:10,max:200,step:1,unit:\"%\",hidden:({imageFit})=>imageFit!==\"percent\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:64,variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\",textAlign:\"center\"}},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ImageMaskText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ImageMaskText.map"],"mappings":"oNAAyJ,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,OAAK,QAAM,OAAK,WAAS,aAAW,gBAAc,YAAU,qBAAmB,cAAY,iBAAe,YAAU,eAAa,cAAY,EAAY,EAAaA,EAAO,KAAK,CAAO,EAAM,EAAK,MAAM,IAAI,CAAM,CAAC,EAAe,GAAmBC,EAAS,EAAE,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAO,EAAS,EAAa,S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