{"version":3,"file":"ScrollShaed.BE2InKWv.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/McWHW4kufw8tbXeIUrQ8/3MukGSCSsmx3W089opzk/ScrollShaed.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useRef}from\"react\";import{motion,useScroll,useTransform}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Scroll-linked black-to-white shade.\n *\n * A static multi-stop linear gradient sits underneath at all times, so the\n * very top edge always matches the section above and the very bottom edge\n * always matches the section below, regardless of scroll position. On top\n * of that, a rounded \"dome\" of the last (bottom-most) color grows outward\n * from the bottom-center as you scroll, giving the curved U-shaped reveal\n * where the bottom color visibly takes over more of the frame.\n *\n * Usage: drop into a Frame sized to fill its section (e.g. 100vh), placed\n * in normal document flow, between your black section and your white\n * section(s).\n */export default function ScrollShade(props){const{colors,softness,reverse}=props;const containerRef=useRef(null);const{scrollYProgress}=useScroll({target:containerRef,offset:[\"start end\",\"end start\"]});const progress=reverse?useTransform(scrollYProgress,v=>1-v):scrollYProgress;const stops=[...colors].sort((a,b)=>a.stop-b.stop);const gradient=`linear-gradient(to bottom, ${stops.map(c=>`${c.color} ${c.stop}%`).join(\", \")})`;const bottomColor=stops[stops.length-1].color;// a circle's visible area grows roughly with radius^2, so a linearly\n// growing radius reaches \"visually full\" long before progress hits 1.\n// Easing progress with sqrt makes the *area* grow evenly with scroll,\n// so full white only lands right at the end (progress = 1).\nconst eased=useTransform(progress,v=>Math.sign(v)*Math.sqrt(Math.abs(v)));// padded so the dome is fully collapsed at progress 0 and fully\n// covers the frame (pure bottomColor, no visible edge) at progress 1\nconst radius=useTransform(eased,[0,1],[-softness,100+softness]);const domeBackground=useTransform(radius,r=>{const inner=Math.max(0,r-softness);const outer=Math.min(100,r+softness);// explicit wide/shallow ellipse instead of the default\n// farthest-corner shape, which reads as tall and pointy\nreturn`radial-gradient(ellipse 140% 55% at 50% 100%, ${bottomColor} ${inner}%, transparent ${outer}%)`;});return /*#__PURE__*/_jsxs(\"div\",{ref:containerRef,style:{position:\"relative\",width:\"100%\",height:\"100%\",overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,background:gradient}}),/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",inset:0,background:domeBackground}})]});}addPropertyControls(ScrollShade,{colors:{type:ControlType.Array,title:\"Gradient\",control:{type:ControlType.Object,controls:{color:{type:ControlType.Color,title:\"Color\"},stop:{type:ControlType.Number,title:\"Stop %\",min:0,max:100,defaultValue:0}}},defaultValue:[{color:\"#0A0A0C\",stop:0},{color:\"#0E0B16\",stop:14},{color:\"#5A35C8\",stop:40},{color:\"#8A7AE8\",stop:55},{color:\"#C3D3F7\",stop:72},{color:\"#EEF3FD\",stop:88},{color:\"#FFFFFF\",stop:100}]},softness:{type:ControlType.Number,title:\"Edge Softness %\",min:0,max:50,step:1,defaultValue:20,description:\"How feathered the dome's edge is.\"},reverse:{type:ControlType.Boolean,title:\"Reverse\",defaultValue:true,description:\"Flips which scroll direction grows the dome, if it feels backwards.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollShade\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollShaed.map"],"mappings":"gPAaG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,SAAO,WAAS,WAAS,EAAY,EAAaA,EAAO,IAAI,EAAO,CAAC,mBAAiB,EAAU,CAAC,OAAO,EAAa,OAAO,CAAC,YAAY,WAAW,CAAC,CAAC,EAAQ,EAAS,EAAQ,EAAa,EAAgB,GAAG,EAAE,CAAC,EAAE,EAAsB,EAAM,CAAC,GAAG,CAAM,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAQ,EAAS,8BAA8B,EAAM,IAAI,GAAG,GAAG,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