{"version":3,"file":"GlassFade.DbD0Gsad.mjs","names":[],"sources":["https:/framerusercontent.com/modules/44aNaPG3tDmesHTfZvE8/BamR5mN3xVEbd39sw8Cx/GlassFade.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";const STEPS=10;function clamp(value,min,max){return Math.min(max,Math.max(min,value));}function pct(value){return`${Math.round(value*100)/100}%`;}/**\n * Glass Fade\n *\n * A smooth frosted-glass fade: the content behind stays sharp above\n * \"Start\", blurs gradually, and is fully frosted from \"End\" downwards.\n * Place it over images, filling the area it should cover.\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function GlassFade(props){const{start=18,end=58,blur=40,frost=35,tint=\"#FFFFFF\",tintStrength=96,style}=props;const s=clamp(start,0,99);const e=clamp(Math.max(end,s+1),1,100);const span=e-s;const step=span/STEPS;const maxBlur=clamp(blur,0,80);// Each layer blurs a little more than the one before it and only shows in\n// its own band; neighbouring bands overlap so the change is seamless.\nconst layers=[];for(let i=0;i<STEPS;i++){const amount=maxBlur*Math.pow((i+1)/STEPS,1.6);const fadeInStart=s+step*(i-1);const fullStart=s+step*i;const fullEnd=s+step*(i+1);const fadeOutEnd=s+step*(i+2);const isLast=i===STEPS-1;const mask=isLast?`linear-gradient(to bottom, rgba(0,0,0,0) ${pct(fadeInStart)}, rgba(0,0,0,1) ${pct(fullStart)}, rgba(0,0,0,1) 100%)`:`linear-gradient(to bottom, rgba(0,0,0,0) ${pct(fadeInStart)}, rgba(0,0,0,1) ${pct(fullStart)}, rgba(0,0,0,1) ${pct(fullEnd)}, rgba(0,0,0,0) ${pct(fadeOutEnd)})`;layers.push(/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,backdropFilter:`blur(${amount}px)`,WebkitBackdropFilter:`blur(${amount}px)`,maskImage:mask,WebkitMaskImage:mask}},i));}// Soft tint on an eased curve: fades in with the blur, strongest at the bottom.\nconst tintEnd=Math.min(100,e+14);const tintStops=[`rgba(0,0,0,0) ${pct(s)}`];for(let k=1;k<=8;k++){const t=k/8;const eased=t*t*(3-2*t);tintStops.push(`rgba(0,0,0,${Math.round(eased*.86*1e3)/1e3}) ${pct(s+(tintEnd-s)*t)}`);}tintStops.push(\"rgba(0,0,0,1) 100%\");const tintMask=`linear-gradient(to bottom, ${tintStops.join(\", \")})`;// Milky frost: a translucent white haze that builds up early in the fade\n// and then holds, so the blurred area reads as frosted glass.\nconst frostEnd=s+span*.5;const frostStops=[`rgba(0,0,0,0) ${pct(s)}`];for(let k=1;k<=6;k++){const t=k/6;const eased=t*t*(3-2*t);frostStops.push(`rgba(0,0,0,${Math.round(eased*1e3)/1e3}) ${pct(s+(frostEnd-s)*t)}`);}frostStops.push(\"rgba(0,0,0,1) 100%\");const frostMask=`linear-gradient(to bottom, ${frostStops.join(\", \")})`;return /*#__PURE__*/_jsxs(\"div\",{\"aria-hidden\":\"true\",style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\",pointerEvents:\"none\"},children:[layers,/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,background:tint,opacity:clamp(frost,0,100)/100,maskImage:frostMask,WebkitMaskImage:frostMask}}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,background:tint,opacity:clamp(tintStrength,0,100)/100,maskImage:tintMask,WebkitMaskImage:tintMask}})]});}addPropertyControls(GlassFade,{start:{type:ControlType.Number,title:\"Start\",description:\"Where the glass begins, from the top.\",defaultValue:18,min:0,max:99,unit:\"%\"},end:{type:ControlType.Number,title:\"End\",description:\"Where it becomes fully frosted.\",defaultValue:58,min:1,max:100,unit:\"%\"},blur:{type:ControlType.Number,title:\"Blur\",defaultValue:40,min:0,max:80,unit:\"px\"},frost:{type:ControlType.Number,title:\"Frost\",description:\"Milky haze over the blurred area.\",defaultValue:35,min:0,max:100,unit:\"%\"},tint:{type:ControlType.Color,title:\"Tint\",defaultValue:\"#FFFFFF\"},tintStrength:{type:ControlType.Number,title:\"Tint Strength\",defaultValue:96,min:0,max:100,unit:\"%\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"GlassFade\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"400\",\"framerIntrinsicWidth\":\"600\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./GlassFade.map"],"mappings":"mKAA4H,SAAS,EAAM,EAAM,EAAI,EAAI,CAAC,OAAO,KAAK,IAAI,EAAI,KAAK,IAAI,EAAI,CAAK,CAAC,CAAE,CAAC,SAAS,EAAI,EAAM,CAAC,MAAM,GAAG,KAAK,MAAM,EAAM,GAAG,EAAE,IAAI,EAAG,CAY3P,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,QAAM,GAAG,MAAI,GAAG,OAAK,GAAG,QAAM,GAAG,OAAK,UAAU,eAAa,GAAG,SAAO,EAAY,EAAE,EAAM,EAAM,EAAE,EAAE,EAAQ,EAAE,EAAM,KAAK,IAAI,EAAI,EAAE,CAAC,EAAE,EAAE,GAAG,EAAQ,EAAK,EAAE,EAAQ,EAAK,EAAK,EAAY,EAAQ,EAAM,EAAK,EAAE,EAAE,EAE5P,EAAO,CAAC,EAAE,IAAI,IAAI,EAAE,EAAE,EAAE,EAAM,IAAI,CAAC,IAAM,EAAO,IAAkB,EAAE,GAAG,IAAM,IAAW,EAAY,EAAE,GAAM,EAAE,GAAS,EAAU,EAAE,EAAK,EAAQ,EAAQ,EAAE,GAAM,EAAE,GAAS,EAAW,EAAE,GAAM,EAAE,GAAkC,EAAlB,IAAI,EAAM,EAAoB,4CAA4C,EAAI,CAAW,EAAE,kBAAkB,EAAI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