{"version":3,"file":"SimpleScrollProgressBar.CUOlnCj2.mjs","names":["useState","useCallback"],"sources":["https:/framerusercontent.com/modules/oIa9jYqVoiduNUSqRQ7h/utuZoJKJkJROgiqROlgk/ProgressiveBlur.js","https:/framerusercontent.com/modules/xnSemAfc3j4voYPQKydT/ZX7TYn9T3AqomAkx7Tfb/SimpleScrollProgressBar.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";const computeDirection=dir=>{switch(dir){case\"toTop\":return\"to top\";case\"toLeft\":return\"to left\";case\"toRight\":return\"to right\";case\"toBottom\":default:return\"to bottom\";}};// Code component provided by Eleveight Supply™. All rights reserved 2024.\n/**\n * @framerDisableUnlink\n *\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 300\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ProgressiveBlur(props){const{blur,blurDirection,allCorners,radius,topLeft,topRight,bottomRight,bottomLeft}=props;const layers=[];const base=blur;const dir=computeDirection(blurDirection);for(let i=0;i<8;i++){const b=base/2**(8-i);const start=(i*12.5).toFixed(1);const mid1=(+start+12.5).toFixed(1);const mid2=(+start+25).toFixed(1);const end=(+start+37.5).toFixed(1);layers.push({blur:`${b}px`,gradient:[`rgba(0,0,0,0) ${start}%`,`rgba(0,0,0,1) ${mid1}%`,`rgba(0,0,0,1) ${mid2}%`,`rgba(0,0,0,0) ${end}%`].join(\", \")});}const cornerRadius=allCorners?`${radius}px`:`${topLeft}px ${topRight}px ${bottomRight}px ${bottomLeft}px`;return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",height:\"100%\",borderRadius:cornerRadius,overflow:\"hidden\",background:\"none\"},children:layers.map((layer,idx)=>/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,zIndex:idx+1,pointerEvents:\"none\",backdropFilter:`blur(${layer.blur})`,WebkitBackdropFilter:`blur(${layer.blur})`,maskImage:`linear-gradient(${dir}, ${layer.gradient})`,WebkitMaskImage:`linear-gradient(${dir}, ${layer.gradient})`,borderRadius:cornerRadius}},idx))});}ProgressiveBlur.defaultProps={blur:10,blurDirection:\"toBottom\",allCorners:true,radius:0,topLeft:0,topRight:0,bottomRight:0,bottomLeft:0};addPropertyControls(ProgressiveBlur,{blur:{type:ControlType.Number,title:\"Blur\",defaultValue:10,min:0,max:100,step:1},blurDirection:{type:ControlType.SegmentedEnum,title:\"Direction\",options:[\"toBottom\",\"toTop\",\"toLeft\",\"toRight\"],optionTitles:[\"↓\",\"↑\",\"←\",\"→\"],defaultValue:\"toBottom\"},cornerRadius:{type:ControlType.FusedNumber,title:\"Radius\",toggleKey:\"allCorners\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"topLeft\",\"topRight\",\"bottomRight\",\"bottomLeft\"],valueLabels:[\"TL\",\"TR\",\"BR\",\"BL\"],defaultValue:0,min:0,max:200,step:1,description:\"If you need rounded corners, apply them here—don’t put them on the parent container or the blur will break.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProgressiveBlur\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"*\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"300\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"300\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ProgressiveBlur.map","// Simple scroll progress bar with customizable colors and radius\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,useCallback,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * SimpleScrollProgressBar\n *\n * Scroll-linked progress bar with customizable colors, radius, and thickness.\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 8\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function SimpleScrollProgressBar(props){const{trackColor,fillColor,borderRadius,thickness,style}=props;const[progress,setProgress]=useState(0);const updateProgress=useCallback(()=>{if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const scrollTop=window.scrollY||window.pageYOffset||0;const docHeight=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight);const winHeight=window.innerHeight||0;const scrollable=Math.max(docHeight-winHeight,0);const next=scrollable>0?Math.min(Math.max(scrollTop/scrollable*100,0),100):0;startTransition(()=>setProgress(next));},[]);useEffect(()=>{if(typeof window===\"undefined\")return;updateProgress();const onScroll=()=>updateProgress();const onResize=()=>updateProgress();window.addEventListener(\"scroll\",onScroll,{passive:true});window.addEventListener(\"resize\",onResize);return()=>{window.removeEventListener(\"scroll\",onScroll);window.removeEventListener(\"resize\",onResize);};},[updateProgress]);const isWidthFixed=style&&style.width===\"100%\";return /*#__PURE__*/_jsx(\"div\",{style:{position:\"relative\",width:\"100%\",backgroundColor:trackColor,borderRadius,overflow:\"hidden\",// Allow ultra-thin bars while keeping a minimal canvas footprint\n...isWidthFixed?{}:{minWidth:\"max-content\"},...style,height:Math.max(thickness,.5),minHeight:5},\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,height:\"100%\",width:`${progress}%`,backgroundColor:fillColor,borderRadius:\"inherit\"}})});}addPropertyControls(SimpleScrollProgressBar,{trackColor:{type:ControlType.Color,title:\"Track\",defaultValue:\"#EEEEEE\"},fillColor:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#000000\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:4,min:0,max:32,unit:\"px\",step:1},thickness:{type:ControlType.Number,title:\"Thickness\",defaultValue:8,min:.5,max:40,unit:\"px\",step:.5}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SimpleScrollProgressBar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"8\",\"framerIntrinsicWidth\":\"400\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SimpleScrollProgressBar.map"],"mappings":"6MASG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,OAAK,gBAAc,aAAW,SAAO,UAAQ,WAAS,cAAY,cAAY,EAAY,EAAO,CAAC,EAAQ,EAAK,EAAW,EAAI,EAAiB,CAAa,EAAE,IAAI,IAAI,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,IAAM,EAAE,EAAK,IAAI,EAAE,GAAS,GAAO,EAAE,KAAA,CAAM,QAAQ,CAAC,EAAQ,GAAM,CAAC,EAAM,KAAA,CAAM,QAAQ,CAAC,EAAQ,GAAM,CAAC,EAAM,GAAA,CAAI,QAAQ,CAAC,EAAQ,GAAK,CAAC,EAAM,KAAA,CAAM,QAAQ,CAAC,EAAE,EAAO,KAAK,CAAC,KAAK,GAAG,EAAE,IAAI,SAAS,CAAC,iBAAiB,EAAM,GAAG,iBAAiB,EAAK,GAAG,iBAAiB,EAAK,GAAG,iBAAiB,EAAI,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAE,CAAC,IAAM,EAAa,EAAW,GAAG,EAAO,IAAI,GAAG,EAAQ,KAAK,EAAS,KAAK,EAAY,KAAK,EAAW,IAAI,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,MAAM,OAAO,OAAO,OAAO,aAAa,EAAa,SAAS,SAAS,WAAW,MAAM,EAAE,SAAS,EAAO,KAAK,EAAM,IAAmB,EAAK,MAAM,CAAC,MAAM,CAAC,SAAS,WAAW,MAAM,EAAE,OAAO,EAAI,EAAE,cAAc,OAAO,eAAe,QAAQ,EAAM,KAAK,GAAG,qBAAqB,QAA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