{"version":3,"file":"CircularScrollprogress.BUfbiZfd.mjs","names":[],"sources":["https:/framerusercontent.com/modules/98QywUBnB7yeRTfxG0Ra/QQV8NfM6DK6zFy6tM9Kg/CircularScrollprogress.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{motion,useScroll,useSpring,useTransform}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";const defaultArrowUpIcon=`\n<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 256 256\"><rect width=\"256\" height=\"256\" fill=\"none\"/><line x1=\"128\" y1=\"216\" x2=\"128\" y2=\"40\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"16\"/><polyline points=\"56 112 128 40 200 112\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"16\"/></svg>\n`;/**\n * By Noman (https://framercrafts.com/)\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n *\n * @framerDisableUnlink\n\n */export default function CircularScrollProgress(props){const{backgroundColor,progressColorStart,progressColorEnd,size,thickness,springConfig,reverse,useGradient,isScrollToTopButton,icon,iconColor,iconVisiblePercentage}=props;const{scrollYProgress}=useScroll();const progress=useSpring(scrollYProgress,springConfig);const range=reverse?[1,0]:[0,1];const progressValue=useTransform(progress,range,[0,1]);const center=50;const radius=45-thickness/2;const circumference=2*Math.PI*radius;const handleClick=()=>{if(isScrollToTopButton){window.scrollTo({top:0,behavior:\"smooth\"});}};const gradientId=React.useId();const iconToUse=icon||`data:image/svg+xml;charset=utf-8,${encodeURIComponent(defaultArrowUpIcon.replace(/currentColor/g,iconColor))}`;return /*#__PURE__*/_jsxs(\"div\",{style:{width:size,height:size,cursor:isScrollToTopButton?\"pointer\":\"default\"},onClick:handleClick,children:[/*#__PURE__*/_jsxs(\"svg\",{width:\"100%\",height:\"100%\",viewBox:\"0 0 100 100\",style:{transform:\"rotate(-90deg)\"},children:[useGradient&&/*#__PURE__*/_jsx(\"defs\",{children:/*#__PURE__*/_jsxs(\"linearGradient\",{id:gradientId,x1:\"0%\",y1:\"0%\",x2:\"100%\",y2:\"0%\",children:[/*#__PURE__*/_jsx(\"stop\",{offset:\"0%\",stopColor:progressColorStart}),/*#__PURE__*/_jsx(\"stop\",{offset:\"100%\",stopColor:progressColorEnd})]})}),/*#__PURE__*/_jsx(\"circle\",{cx:center,cy:center,r:radius,fill:\"none\",stroke:backgroundColor,strokeWidth:thickness}),/*#__PURE__*/_jsx(motion.circle,{cx:center,cy:center,r:radius,fill:\"none\",stroke:useGradient?`url(#${gradientId})`:progressColorStart,strokeWidth:thickness,strokeDasharray:circumference,strokeDashoffset:useTransform(progressValue,value=>circumference*(1-value)),strokeLinecap:\"round\"})]}),isScrollToTopButton&&/*#__PURE__*/_jsx(motion.div,{style:{position:\"absolute\",top:\"50%\",left:\"50%\",transform:\"translate(-50%, -50%)\",opacity:useTransform(progressValue,[0,iconVisiblePercentage/100],[0,1])},children:/*#__PURE__*/_jsx(\"img\",{src:iconToUse,alt:\"Scroll to top\",style:{width:size/2,height:size/2}})})]});}CircularScrollProgress.defaultProps={backgroundColor:\"#e0e0e0\",progressColorStart:\"#fc5025\",progressColorEnd:\"#fc9f25\",size:100,thickness:4,springConfig:{stiffness:100,damping:30},reverse:false,useGradient:false,isScrollToTopButton:false,icon:null,iconColor:\"#ffffff\",iconVisiblePercentage:50};addPropertyControls(CircularScrollProgress,{backgroundColor:{type:ControlType.Color,title:\"Background Color\"},useGradient:{type:ControlType.Boolean,title:\"Use Gradient\"},progressColorStart:{type:ControlType.Color,title:\"Progress Color Start\"},progressColorEnd:{type:ControlType.Color,title:\"Progress Color End\",hidden:props=>!props.useGradient},size:{type:ControlType.Number,title:\"Size\",min:50,max:500,step:1,displayStepper:true},thickness:{type:ControlType.Number,title:\"Thickness\",min:1,max:20,step:1,displayStepper:true},springConfig:{type:ControlType.Object,title:\"Spring\",controls:{stiffness:{type:ControlType.Number,title:\"Stiffness\",min:0,max:1e3,step:10},damping:{type:ControlType.Number,title:\"Damping\",min:0,max:100,step:1}}},reverse:{type:ControlType.Boolean,title:\"Reverse\"},isScrollToTopButton:{type:ControlType.Boolean,title:\"Scroll to Top Button\"},icon:{type:ControlType.Image,title:\"Custom Icon\",hidden:props=>!props.isScrollToTopButton},iconColor:{type:ControlType.Color,title:\"Icon Color\",hidden:props=>!props.isScrollToTopButton||props.icon!==null}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CircularScrollProgress\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CircularScrollprogress.map"],"mappings":"ibASG,SAAwB,EAAuB,EAAM,CAAC,GAAK,CAAC,kBAAgB,qBAAmB,mBAAiB,OAAK,YAAU,eAAa,UAAQ,cAAY,sBAAoB,OAAK,YAAU,wBAAsB,CAAC,EAAW,CAAC,kBAAgB,CAAC,GAAW,CAAO,EAAS,EAAU,EAAgB,EAAa,CAAO,EAAM,EAAQ,CAAC,EAAE,CAAE,EAAC,CAAC,EAAE,CAAE,EAAO,EAAc,EAAa,EAAS,EAAM,CAAC,EAAE,CAAE,EAAC,CAAO,EAAO,GAAS,EAAO,GAAG,EAAU,EAAQ,EAAc,EAAE,KAAK,GAAG,EAAa,EAAY,IAAI,CAAC,AAAG,GAAqB,EAAO,SAAS,CAAC,IAAI,EAAE,SAAS,QAAS,EAAC,AAAG,EAAO,EAAW,GAAa,CAAO,EAAU,IAAO,mCAAmC,mBAAmB,EAAmB,QAAQ,gBAAgB,EAAU,CAAC,GAAG,MAAoB,GAAM,MAAM,CAAC,MAAM,CAAC,MAAM,EAAK,OAAO,EAAK,OAAO,EAAoB,UAAU,SAAU,EAAC,QAAQ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