{"version":3,"file":"SmoothFade.DFEYyJFa.mjs","names":[],"sources":["https:/framerusercontent.com/modules/JvPYS54dPSyy3HGprX6s/cBWTlTC5yKyz3TkywHq2/SmoothFade.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * SOLARIS — Smooth Fade\n * A fade from a solid colour to nothing, drawn by the browser at the screen's own resolution (not stretched from a small picture),\n * with a very eased curve and a whisper of dither so it stays smooth even on a big monitor.\n * \"Top is\" says which end is solid: \"Clear\" = clear at the top and solid at the bottom; \"Solid\" = solid at the top and clear at the bottom.\n * Put it where a fade picture used to be: full width, with the height of the fade.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */function parse(c,fallback){const m=(c||\"\").match(/rgba?\\(([^)]+)\\)/i);if(m){const p=m[1].split(\",\").map(v=>parseFloat(v));if(p.length>=3&&p.slice(0,3).every(v=>isFinite(v)))return[p[0],p[1],p[2]];}const h=(c||\"\").replace(\"#\",\"\");if(/^[0-9a-f]{6}$/i.test(h))return[parseInt(h.slice(0,2),16),parseInt(h.slice(2,4),16),parseInt(h.slice(4,6),16)];return fallback;}const NOISE=\"url(\\\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 1.4 -0.2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>\\\")\";export default function SmoothFade(props){const{color,topIs,dither,style}=props;const[r,g,b]=parse(color,[8,11,15]);const N=32;const alphas=[];for(let i=0;i<N;i++){const t=i/(N-1);const s=t*t*t*(t*(6*t-15)+10)// smootherstep: no visible start or end\n;alphas.push(topIs===\"solid\"?1-s:s);}const colorStops=alphas.map((a,i)=>`rgba(${r},${g},${b},${a.toFixed(4)}) ${(i/(N-1)*100).toFixed(2)}%`).join(\", \");const maskStops=alphas.map((a,i)=>`rgba(0,0,0,${a.toFixed(4)}) ${(i/(N-1)*100).toFixed(2)}%`).join(\", \");const grad=`linear-gradient(to bottom, ${colorStops})`;const mask=`linear-gradient(to bottom, ${maskStops})`;return /*#__PURE__*/_jsxs(\"div\",{\"aria-hidden\":\"true\",style:{...style,position:\"relative\",width:\"100%\",height:\"100%\",pointerEvents:\"none\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,backgroundImage:grad}}),dither>0&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,backgroundImage:NOISE,backgroundSize:\"180px 180px\",opacity:dither,mixBlendMode:\"soft-light\",WebkitMaskImage:mask,maskImage:mask}})]});}SmoothFade.defaultProps={color:\"rgb(8, 11, 15)\",topIs:\"clear\",dither:0};addPropertyControls(SmoothFade,{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"rgb(8, 11, 15)\"},topIs:{type:ControlType.Enum,title:\"Top is\",options:[\"clear\",\"solid\"],optionTitles:[\"Clear\",\"Solid\"],defaultValue:\"clear\",displaySegmentedControl:true},dither:{type:ControlType.Number,title:\"Grain\",min:0,max:.2,step:.01,defaultValue:0}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmoothFade\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SmoothFade.map"],"mappings":"mKASG,SAAS,EAAM,EAAE,EAAS,CAAC,IAAM,GAAG,GAAG,GAAA,CAAI,MAAM,mBAAmB,EAAE,GAAG,EAAE,CAAC,IAAM,EAAE,EAAE,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG,WAAW,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,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