{"version":3,"file":"GradualBlur.B3bmePAj.mjs","names":["useRef","useState","useMemo","startTransition","p"],"sources":["https:/framerusercontent.com/modules/ndJNDHnjGsgTzxsyWZzu/NIXwBvHeXEmiPoFHIZ37/GradualBlur.js"],"sourcesContent":["// Gradual Blur component - creates a gradual blur effect overlay with customizable position, strength, and animation\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useRef,useState,useMemo,startTransition}from\"react\";const PRESETS={top:{position:\"top\",height:\"6rem\"},bottom:{position:\"bottom\",height:\"6rem\"},left:{position:\"left\",height:\"6rem\"},right:{position:\"right\",height:\"6rem\"},subtle:{height:\"4rem\",strength:1,opacity:.8,divCount:3},intense:{height:\"10rem\",strength:4,divCount:8,exponential:true},smooth:{height:\"8rem\",curve:\"bezier\",divCount:10},sharp:{height:\"5rem\",curve:\"linear\",divCount:4},header:{position:\"top\",height:\"8rem\",curve:\"ease-out\"},footer:{position:\"bottom\",height:\"8rem\",curve:\"ease-out\"},sidebar:{position:\"left\",height:\"6rem\",strength:2.5}};const CURVE_FUNCTIONS={linear:p=>p,bezier:p=>p*p*(3-2*p),\"ease-in\":p=>p*p,\"ease-out\":p=>1-Math.pow(1-p,2),\"ease-in-out\":p=>p<.5?2*p*p:1-Math.pow(-2*p+2,2)/2};const getGradientDirection=position=>{const directions={top:\"to top\",bottom:\"to bottom\",left:\"to left\",right:\"to right\"};return directions[position]||\"to bottom\";};const useIntersectionObserver=(ref,shouldObserve=false)=>{const[isVisible,setIsVisible]=useState(!shouldObserve);useEffect(()=>{if(!shouldObserve||!ref.current)return;const observer=new IntersectionObserver(([entry])=>startTransition(()=>setIsVisible(entry.isIntersecting)),{threshold:.1});observer.observe(ref.current);return()=>observer.disconnect();},[ref,shouldObserve]);return isVisible;};/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function GradualBlur(props){const containerRef=useRef(null);const[isHovered,setIsHovered]=useState(false);const config=useMemo(()=>{const presetConfig=props.preset!==\"none\"&&PRESETS[props.preset]?PRESETS[props.preset]:{};return{...props,...presetConfig};},[props]);const isVisible=useIntersectionObserver(containerRef,config.animated===\"scroll\");// Inject styles for page-level blur effect\nuseEffect(()=>{if(typeof document===\"undefined\"||config.target!==\"page\")return;const styleId=\"gradual-blur-page-styles\";if(document.getElementById(styleId))return;const styleElement=document.createElement(\"style\");styleElement.id=styleId;styleElement.textContent=`\n            .gradual-blur-page-container {\n                pointer-events: none;\n            }\n            .gradual-blur-page-container > * {\n                pointer-events: auto;\n            }\n        `;document.head.appendChild(styleElement);return()=>{const el=document.getElementById(styleId);if(el)el.remove();};},[config.target]);const blurDivs=useMemo(()=>{const divs=[];const increment=100/config.divCount;const currentStrength=isHovered&&config.hoverIntensity?config.strength*config.hoverIntensity:config.strength;const curveFunc=CURVE_FUNCTIONS[config.curve]||CURVE_FUNCTIONS.linear;for(let i=1;i<=config.divCount;i++){let progress=i/config.divCount;progress=curveFunc(progress);let blurValue;if(config.exponential){blurValue=Math.pow(2,progress*4)*.0625*currentStrength;}else{blurValue=.0625*(progress*config.divCount+1)*currentStrength;}const p1=Math.round((increment*i-increment)*10)/10;const p2=Math.round(increment*i*10)/10;const p3=Math.round((increment*i+increment)*10)/10;const p4=Math.round((increment*i+increment*2)*10)/10;let gradient=`transparent ${p1}%, black ${p2}%`;if(p3<=100)gradient+=`, black ${p3}%`;if(p4<=100)gradient+=`, transparent ${p4}%`;const direction=getGradientDirection(config.position);const divStyle={position:\"absolute\",inset:\"0\",maskImage:`linear-gradient(${direction}, ${gradient})`,WebkitMaskImage:`linear-gradient(${direction}, ${gradient})`,backdropFilter:`blur(${blurValue.toFixed(3)}rem)`,WebkitBackdropFilter:`blur(${blurValue.toFixed(3)}rem)`,opacity:config.opacity,transition:config.animated&&config.animated!==\"scroll\"?`backdrop-filter ${config.duration} ${config.easing}`:undefined};divs.push(/*#__PURE__*/_jsx(\"div\",{style:divStyle},i));}return divs;},[config,isHovered]);const containerStyle=useMemo(()=>{const isVertical=[\"top\",\"bottom\"].includes(config.position);const isHorizontal=[\"left\",\"right\"].includes(config.position);const isPageTarget=config.target===\"page\";const baseStyle={position:isPageTarget?\"fixed\":\"absolute\",pointerEvents:config.hoverIntensity?\"auto\":\"none\",opacity:isVisible?1:0,transition:config.animated?`opacity ${config.duration} ${config.easing}`:undefined,zIndex:isPageTarget?config.zIndex+100:config.zIndex};if(isVertical){baseStyle.height=config.height;baseStyle.width=config.width||\"100%\";baseStyle[config.position]=0;baseStyle.left=0;baseStyle.right=0;}else if(isHorizontal){baseStyle.width=config.width||config.height;baseStyle.height=\"100%\";baseStyle[config.position]=0;baseStyle.top=0;baseStyle.bottom=0;}return baseStyle;},[config,isVisible]);// When target is \"page\", render as a portal-like fixed element\nif(config.target===\"page\"){return /*#__PURE__*/_jsx(\"div\",{ref:containerRef,className:\"gradual-blur-page-container\",style:containerStyle,onMouseEnter:config.hoverIntensity?()=>startTransition(()=>setIsHovered(true)):undefined,onMouseLeave:config.hoverIntensity?()=>startTransition(()=>setIsHovered(false)):undefined,children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\"},children:blurDivs})});}// Default parent-relative rendering\nreturn /*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:containerStyle,onMouseEnter:config.hoverIntensity?()=>startTransition(()=>setIsHovered(true)):undefined,onMouseLeave:config.hoverIntensity?()=>startTransition(()=>setIsHovered(false)):undefined,children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\"},children:blurDivs})});}addPropertyControls(GradualBlur,{preset:{type:ControlType.Enum,title:\"Preset\",options:[\"none\",\"top\",\"bottom\",\"left\",\"right\",\"subtle\",\"intense\",\"smooth\",\"sharp\",\"header\",\"footer\",\"sidebar\"],optionTitles:[\"None\",\"Top\",\"Bottom\",\"Left\",\"Right\",\"Subtle\",\"Intense\",\"Smooth\",\"Sharp\",\"Header\",\"Footer\",\"Sidebar\"],defaultValue:\"bottom\"},position:{type:ControlType.Enum,title:\"Position\",options:[\"top\",\"bottom\",\"left\",\"right\"],optionTitles:[\"Top\",\"Bottom\",\"Left\",\"Right\"],defaultValue:\"bottom\",displaySegmentedControl:true,hidden:({preset})=>preset!==\"none\"},strength:{type:ControlType.Number,title:\"Strength\",defaultValue:2,min:0,max:10,step:.1},height:{type:ControlType.String,title:\"Height\",defaultValue:\"6rem\",placeholder:\"6rem\"},width:{type:ControlType.String,title:\"Width\",defaultValue:\"100%\",placeholder:\"100%\"},divCount:{type:ControlType.Number,title:\"Div Count\",defaultValue:5,min:1,max:20,step:1,displayStepper:true},exponential:{type:ControlType.Boolean,title:\"Exponential\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},curve:{type:ControlType.Enum,title:\"Curve\",options:[\"linear\",\"bezier\",\"ease-in\",\"ease-out\",\"ease-in-out\"],optionTitles:[\"Linear\",\"Bezier\",\"Ease In\",\"Ease Out\",\"Ease In-Out\"],defaultValue:\"linear\"},opacity:{type:ControlType.Number,title:\"Opacity\",defaultValue:1,min:0,max:1,step:.01},animated:{type:ControlType.Enum,title:\"Animated\",options:[false,true,\"scroll\"],optionTitles:[\"Off\",\"On\",\"Scroll\"],defaultValue:false},duration:{type:ControlType.String,title:\"Duration\",defaultValue:\"0.3s\",placeholder:\"0.3s\"},easing:{type:ControlType.String,title:\"Easing\",defaultValue:\"ease-out\",placeholder:\"ease-out\"},hoverIntensity:{type:ControlType.Number,title:\"Hover Intensity\",defaultValue:0,min:0,max:3,step:.1},target:{type:ControlType.Enum,title:\"Target\",options:[\"parent\",\"page\"],optionTitles:[\"Parent\",\"Page\"],defaultValue:\"parent\",displaySegmentedControl:true},zIndex:{type:ControlType.Number,title:\"Z-Index\",defaultValue:1e3,min:0,max:1e4,step:1,displayStepper:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GradualBlur\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\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