{"version":3,"file":"ScrollProgress_1.C5OVajT2.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/xWrgCRm9U6e44lcVmnWt/5WjlonxCN7XUT9XaiJ1c/ScrollProgress_1.js"],"sourcesContent":["/**\n * By Huig van der Waal (huigvanderwaal.nl)\n * Free for personal and commercial use\n */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function ScrollProgressCircle(props){const[progress,setProgress]=useState(0);useEffect(()=>{const handleScroll=()=>{const scrollTop=window.scrollY;const docHeight=document.body.offsetHeight-window.innerHeight;const scrolled=scrollTop/docHeight;setProgress(scrolled);};window.addEventListener(\"scroll\",handleScroll);return()=>window.removeEventListener(\"scroll\",handleScroll);},[]);const circleDiameter=props.size;const circleRadius=circleDiameter/2;const strokeWidth=props.strokeWidth;const circlePath=`\n        M ${circleRadius},${circleRadius} m 0,-${circleRadius-strokeWidth/2}\n        a ${circleRadius-strokeWidth/2},${circleRadius-strokeWidth/2} 0 1,1 0,${(circleRadius-strokeWidth/2)*2}\n        a ${circleRadius-strokeWidth/2},${circleRadius-strokeWidth/2} 0 1,1 0,-${(circleRadius-strokeWidth/2)*2}\n    `;const strokeDasharray=2*Math.PI*(circleRadius-strokeWidth/2);return /*#__PURE__*/_jsx(\"div\",{style:{...props.style},children:/*#__PURE__*/_jsxs(\"svg\",{width:`${circleDiameter}px`,height:`${circleDiameter}px`,viewBox:`0 0 ${circleDiameter} ${circleDiameter}`,children:[/*#__PURE__*/_jsx(\"path\",{d:circlePath,fill:\"none\",stroke:props.trackColor,strokeWidth:strokeWidth}),/*#__PURE__*/_jsx(motion.path,{d:circlePath,fill:\"none\",stroke:props.progressColor,strokeWidth:strokeWidth,strokeDasharray:strokeDasharray,strokeDashoffset:strokeDasharray*(1-progress),initial:{strokeDashoffset:strokeDasharray},animate:{strokeDashoffset:strokeDasharray*(1-progress)},transition:{duration:.2}})]})});}ScrollProgressCircle.displayName=\"Scroll Progress\";addPropertyControls(ScrollProgressCircle,{size:{type:ControlType.Number,title:\"Size\",defaultValue:64,min:30,max:200,step:1},trackColor:{type:ControlType.Color,title:\"Track Color\",defaultValue:\"#ddd\"},progressColor:{type:ControlType.Color,title:\"Progress Color\",defaultValue:\"#4f5b62\"},strokeWidth:{type:ControlType.Number,title:\"Stroke Width\",defaultValue:5,min:1,max:20,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollProgressCircle\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollProgress_1.map"],"mappings":"uPAMG,SAAwB,EAAqB,EAAM,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAS,EAAE,CAAC,MAAc,CAAC,IAAM,MAAiB,CAAiI,EAAhH,EAAO,SAAwB,SAAS,KAAK,aAAa,EAAO,aAAoE,EAAkD,OAA/C,EAAO,iBAAiB,SAAS,EAAa,KAAW,EAAO,oBAAoB,SAAS,EAAa,EAAG,EAAE,CAAC,CAAC,IAAM,EAAe,EAAM,KAAW,EAAa,EAAe,EAAQ,EAAY,EAAM,YAAkB,EAAW;YAC5f,EAAa,GAAG,EAAa,QAAQ,EAAa,EAAY,EAAE;YAChE,EAAa,EAAY,EAAE,GAAG,EAAa,EAAY,EAAE,YAAY,EAAa,EAAY,GAAG,EAAE;YACnG,EAAa,EAAY,EAAE,GAAG,EAAa,EAAY,EAAE,aAAa,EAAa,EAAY,GAAG,EAAE;MACpG,EAAgB,EAAE,KAAK,IAAI,EAAa,EAAY,GAAG,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,MAAM,CAAC,SAAsB,EAAM,MAAM,C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