{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/3OEbnaDsj6XU8xqUNF0I/E8KaMA4Pcbb8SHDDcB6q/ScrollBlur.js"],
  "sourcesContent": ["// Dynamic background blur for top/bottom edges, fading softly to the middle, responsive to scroll speed, with adjustable zones, intensity, sensitivity, and tint.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,RenderTarget,useIsStaticRenderer}from\"framer\";function clamp(val,min,max){return Math.max(min,Math.min(max,val));}/**\n * ScrollBlur\n *\n * Adds a dynamic background blur to the top and/or bottom edges of the screen, fading softly to the middle, responsive to scroll speed.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 40\n * @framerIntrinsicHeight 40\n */export default function ScrollBlur(props){const{applyTo,topSize,bottomSize,maxBlur,sensitivity,tintColor,style}=props;const[blur,setBlur]=useState(0);const lastScrollY=useRef(0);const lastTimestamp=useRef(0);const fadeTimeout=useRef(null);const isStatic=useIsStaticRenderer();useEffect(()=>{if(isStatic||typeof window===\"undefined\")return;let ticking=false;let lastBlur=0;let fadeRAF=null;function fadeBlur(){// Instantly set blur to 0\nlastBlur=0;startTransition(()=>setBlur(0));fadeRAF=null;}function onScroll(){if(!ticking){window.requestAnimationFrame(()=>{const now=performance.now();const y=window.scrollY;const dt=now-(lastTimestamp.current||now);const dy=y-lastScrollY.current;lastScrollY.current=y;lastTimestamp.current=now;const speed=Math.abs(dy)/(dt||1);const blurValue=clamp(speed*maxBlur*(sensitivity||1),0,maxBlur);lastBlur=blurValue;startTransition(()=>setBlur(blurValue));if(fadeRAF)cancelAnimationFrame(fadeRAF);if(fadeTimeout.current)clearTimeout(fadeTimeout.current);fadeTimeout.current=setTimeout(()=>{fadeRAF=requestAnimationFrame(fadeBlur);},80);ticking=false;});ticking=true;}}window.addEventListener(\"scroll\",onScroll,{passive:true});// Trigger blur on initial mount if already scrolling\nif(window.scrollY!==0)onScroll();return()=>{window.removeEventListener(\"scroll\",onScroll);if(fadeTimeout.current)clearTimeout(fadeTimeout.current);if(fadeRAF)cancelAnimationFrame(fadeRAF);};},[maxBlur,sensitivity,isStatic]);if(RenderTarget.current()===RenderTarget.thumbnail||isStatic)return null;// Soft fade mask for blur: fade to transparent at the middle of the blur zone\nfunction getMask(position){if(position===\"top\"){// Smoother, longer fade, no visible edge\nreturn`linear-gradient(to bottom, black 0%, black 60%, rgba(0,0,0,0.5) 80%, transparent 100%)`;}else{return`linear-gradient(to top, black 0%, black 60%, rgba(0,0,0,0.5) 80%, transparent 100%)`;}}// Blur layer style\nconst blurLayer=(position,size)=>/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":\"true\",style:{pointerEvents:\"none\",position:\"fixed\",left:0,[position]:0,width:\"100vw\",height:`calc(${size}vh)`,zIndex:9999,backdropFilter:`blur(${blur}px)`,WebkitBackdropFilter:`blur(${blur}px)`,background:tintColor?`linear-gradient(to ${position===\"top\"?\"bottom\":\"top\"}, ${tintColor} 0%, transparent 100%)`:undefined,transition:\"backdrop-filter 0.25s, -webkit-backdrop-filter 0.25s, opacity 0.7s cubic-bezier(.4,0,.2,1)\",opacity:blur>0?Math.min(1,blur/(maxBlur*.7)):0,willChange:\"backdrop-filter, opacity\",maskImage:getMask(position),WebkitMaskImage:getMask(position)}});return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",minWidth:5,minHeight:5,width:\"100%\",height:\"100%\"},children:[(applyTo===\"top\"||applyTo===\"both\")&&topSize>0&&blurLayer(\"top\",topSize),(applyTo===\"bottom\"||applyTo===\"both\")&&bottomSize>0&&blurLayer(\"bottom\",bottomSize)]});}addPropertyControls(ScrollBlur,{applyTo:{type:ControlType.Enum,title:\"Apply To\",options:[\"top\",\"bottom\",\"both\"],optionTitles:[\"Top\",\"Bottom\",\"Both\"],defaultValue:\"both\",displaySegmentedControl:true},topSize:{type:ControlType.Number,title:\"Top Size\",defaultValue:10,min:1,max:50,step:.1,unit:\"%\",hidden:({applyTo})=>applyTo===\"bottom\"},bottomSize:{type:ControlType.Number,title:\"Bottom Size\",defaultValue:10,min:1,max:50,step:.1,unit:\"%\",hidden:({applyTo})=>applyTo===\"top\"},maxBlur:{type:ControlType.Number,title:\"Max Blur\",defaultValue:32,min:1,max:10,step:1,unit:\"px\"},sensitivity:{type:ControlType.Number,title:\"Sensitivity\",defaultValue:.5,min:.01,max:1,step:.01},tintColor:{type:ControlType.Color,title:\"Tint Color\",defaultValue:\"rgba(255,255,255,0.12)\",optional:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollBlur\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"40\",\"framerIntrinsicWidth\":\"40\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollBlur.map"],
  "mappings": "mJAC2M,SAASA,EAAMC,EAAIC,EAAIC,EAAI,CAAC,OAAO,KAAK,IAAID,EAAI,KAAK,IAAIC,EAAIF,CAAG,CAAC,CAAE,CAS5P,SAARG,EAA4BC,EAAM,CAAC,GAAK,CAAC,QAAAC,EAAQ,QAAAC,EAAQ,WAAAC,EAAW,QAAAC,EAAQ,YAAAC,EAAY,UAAAC,EAAU,MAAAC,CAAK,EAAEP,EAAW,CAACQ,EAAKC,CAAO,EAAEC,EAAS,CAAC,EAAQC,EAAYC,EAAO,CAAC,EAAQC,EAAcD,EAAO,CAAC,EAAQE,EAAYF,EAAO,IAAI,EAAQG,EAASC,EAAoB,EAErD,GAFuDC,EAAU,IAAI,CAAC,GAAGF,GAAU,OAAOG,EAAS,IAAY,OAAO,IAAIC,EAAQ,GAAUC,EAAS,EAAMC,EAAQ,KAAK,SAASC,GAAU,CAC3ZF,EAAS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aAAa,GAAG,IAAI,IAAI,IAAI,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,KAAKA,EAAY,MAAM,MAAM,aAAa,aAAa,yBAAyB,SAAS,EAAI,CAAC,CAAC",
  "names": ["clamp", "val", "min", "max", "ScrollBlur", "props", "applyTo", "topSize", "bottomSize", "maxBlur", "sensitivity", "tintColor", "style", "blur", "setBlur", "ye", "lastScrollY", "pe", "lastTimestamp", "fadeTimeout", "isStatic", "useIsStaticRenderer", "ue", "window", "ticking", "lastBlur", "fadeRAF", "fadeBlur", "Z", "onScroll", "now", "y", "dt", "dy", "speed", "blurValue", "RenderTarget", "getMask", "position", "blurLayer", "size", "p", "u", "addPropertyControls", "ControlType"]
}
