{"version":3,"file":"GradualBlur.CSyE2OUd.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/eVUUms6iYLDQs0GeoaK2/TutDfX1G747vUBClt7rQ/GradualBlur.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * GradualBlur\n *\n * A progressive backdrop-blur overlay for Framer.\n * Based on the technique from reactbits.dev/animations/gradual-blur\n *\n * Place this component over any frame. Set the parent frame to\n * position: relative and overflow: visible (not hidden) so the\n * absolutely-positioned layers are not clipped.\n */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 GRADIENT_DIRECTION={top:\"to top\",bottom:\"to bottom\",left:\"to left\",right:\"to right\"};export default function GradualBlur({position=\"bottom\",strength=2,height=96,divCount=6,exponential=false,curve=\"bezier\",opacity=1}){const isVertical=position===\"top\"||position===\"bottom\";const containerStyle={position:\"absolute\",pointerEvents:\"none\",zIndex:10,left:0,right:0,...isVertical?{[position]:0,width:\"100%\",height}:{top:0,bottom:0,[position]:0,width:height,height:\"100%\"}};const blurDivs=useMemo(()=>{const divs=[];const increment=100/divCount;const curveFunc=CURVE_FUNCTIONS[curve]||CURVE_FUNCTIONS.linear;const direction=GRADIENT_DIRECTION[position]||\"to bottom\";for(let i=1;i<=divCount;i++){let progress=i/divCount;progress=curveFunc(progress);let blurValue;if(exponential){blurValue=Math.pow(2,progress*4)*.0625*strength;}else{blurValue=.0625*(progress*divCount+1)*strength;}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 maskValue=`linear-gradient(${direction}, ${gradient})`;const divStyle={position:\"absolute\",inset:0,maskImage:maskValue,WebkitMaskImage:maskValue,backdropFilter:`blur(${blurValue.toFixed(3)}rem)`,WebkitBackdropFilter:`blur(${blurValue.toFixed(3)}rem)`,opacity};divs.push(/*#__PURE__*/_jsx(\"div\",{style:divStyle},i));}return divs;},[position,strength,divCount,exponential,curve,opacity]);return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",isolation:\"isolate\"},children:blurDivs})});}addPropertyControls(GradualBlur,{position:{type:ControlType.Enum,title:\"Position\",options:[\"top\",\"bottom\",\"left\",\"right\"],optionTitles:[\"Top\",\"Bottom\",\"Left\",\"Right\"],defaultValue:\"bottom\"},strength:{type:ControlType.Number,title:\"Strength\",min:.5,max:10,step:.5,defaultValue:2},height:{type:ControlType.Number,title:\"Height (px)\",min:20,max:400,step:4,defaultValue:96,description:\"Size of the blur zone in px\"},divCount:{type:ControlType.Number,title:\"Layers\",min:2,max:16,step:1,defaultValue:6,description:\"More layers = smoother gradient\"},exponential:{type:ControlType.Boolean,title:\"Exponential\",defaultValue:false,description:\"Ramp blur exponentially for a sharper edge\"},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:\"bezier\"},opacity:{type:ControlType.Number,title:\"Opacity\",min:0,max:1,step:.05,defaultValue:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GradualBlur\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GradualBlur.map"],"mappings":"0KAS4P,SAAwB,EAAY,CAAC,WAAS,SAAS,WAAS,EAA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