{"version":3,"file":"Progress_Bar.DfJrHTZ8.mjs","names":[],"sources":["https:/framerusercontent.com/modules/oeM7c6Hb3ir8NQSx6uNz/ZbA8qYgC7znfb34pYTMc/Progress_Bar.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,useRef}from\"react\";import{motion,useScroll}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";// Scroll Progress Bar component with scroll tracking\nexport default function ScrollProgressBar(props){const{size,trackWidth,indicatorWidth,arrowSize,scrollOffset,smoothing,useFixedPosition,fixedPositionRight,fixedPositionBottom,showTrackWhenInactive,visibilityScrollThreshold,fadeInAnimation,animationDuration,...rest}=props;// Hard-coded component colors\nconst COLORS={background:\"transparent\",circleBackground:\"#17293D\",indicator:\"#17293D\",track:\"#17293D\",arrow:\"#FFFFFF\",dot:\"#17293D\"};// Track scroll information from Framer Motion\nconst{scrollYProgress}=useScroll();// Track scroll position directly\nconst[scrollY,setScrollY]=useState(0);// State for storing scroll progress\nconst[progress,setProgress]=useState(0);// Reference to track component mounted state\nconst isMounted=useRef(false);// Function to scroll to top when clicked\nconst scrollToTop=()=>{window.scrollTo({top:0,behavior:\"smooth\"});};useEffect(()=>{// Set mounted on first render\nisMounted.current=true;// Function to track scroll position\nconst handleScroll=()=>{if(isMounted.current){window.requestAnimationFrame(()=>{setScrollY(window.scrollY);});}};// Add scroll event listener\nwindow.addEventListener(\"scroll\",handleScroll,{passive:true});const unsubscribe=scrollYProgress.onChange(value=>{// Only update if component is mounted\nif(isMounted.current){// Apply offset to control when to start showing progress\nlet adjustedValue=value;// If offset is set, adjust progress value\nif(scrollOffset>0){adjustedValue=Math.max(0,(value-scrollOffset)/(1-scrollOffset));}// Limit values from 0 to 1\nadjustedValue=Math.min(1,Math.max(0,adjustedValue));// Convert to percentage (0-100)\nsetProgress(adjustedValue*100);}});// Call it once to initialize\nhandleScroll();// Remove subscription on unmount\nreturn()=>{isMounted.current=false;unsubscribe();window.removeEventListener(\"scroll\",handleScroll);};},[scrollYProgress,scrollOffset]);// Determine whether to show the outer ring\nconst isActive=progress>1// Consider active if progress is greater than 1%\n;const shouldShowTrack=showTrackWhenInactive||isActive;// Check if component should be visible based on scroll position\nconst isVisible=scrollY>=visibilityScrollThreshold;// Generate animation style based on selected animation type\nconst getAnimationStyle=()=>{const duration=`${animationDuration}s`;const timing=\"ease-out\";switch(fadeInAnimation){case\"fade\":return{opacity:isVisible?1:0,transition:`opacity ${duration} ${timing}, visibility ${duration}`};case\"slide-up\":return{opacity:isVisible?1:0,transform:isVisible?\"translateY(0)\":\"translateY(20px)\",transition:`opacity ${duration} ${timing}, transform ${duration} ${timing}, visibility ${duration}`};case\"scale\":return{opacity:isVisible?1:0,transform:isVisible?\"scale(1)\":\"scale(0.8)\",transition:`opacity ${duration} ${timing}, transform ${duration} ${timing}, visibility ${duration}`};case\"none\":return{opacity:isVisible?1:0,visibility:isVisible?\"visible\":\"hidden\",transition:\"none\"};default:return{opacity:isVisible?1:0,transition:`opacity ${duration} ${timing}, visibility ${duration}`};}};// Define position if fixed position is used\nconst positionStyle=useFixedPosition?{position:\"fixed\",right:fixedPositionRight,bottom:fixedPositionBottom,zIndex:1e3}:{};// Get animation style based on selected animation type\nconst animationStyle=getAnimationStyle();// Calculate circle size and position for the indicator\nconst center=size/2;const radius=center-Math.max(trackWidth,indicatorWidth)/2;const circumference=2*Math.PI*radius;return /*#__PURE__*/_jsxs(\"div\",{style:{width:size,height:size,position:\"relative\",display:\"flex\",visibility:isVisible?\"visible\":\"hidden\",justifyContent:\"center\",alignItems:\"center\",borderRadius:\"50%\",backgroundColor:COLORS.background,cursor:\"pointer\",...animationStyle,...positionStyle},onClick:scrollToTop,...rest,children:[/*#__PURE__*/_jsxs(\"svg\",{width:size,height:size,style:{position:\"absolute\",transform:\"rotate(-90deg)\"},children:[shouldShowTrack&&/*#__PURE__*/_jsx(\"circle\",{cx:center,cy:center,r:radius,fill:\"transparent\",stroke:\"#17293D\",strokeWidth:trackWidth,opacity:.2}),/*#__PURE__*/_jsx(motion.circle,{cx:center,cy:center,r:radius,fill:\"transparent\",stroke:\"#17293D\",strokeWidth:indicatorWidth,strokeDasharray:circumference,strokeDashoffset:circumference*(1-progress/100),strokeLinecap:\"round\",initial:{strokeDashoffset:circumference},animate:{strokeDashoffset:circumference*(1-progress/100)},transition:{duration:smoothing,ease:\"linear\"}})]}),/*#__PURE__*/_jsx(\"div\",{style:{width:size*.45,height:size*.45,borderRadius:\"50%\",backgroundColor:COLORS.circleBackground,display:\"flex\",justifyContent:\"center\",alignItems:\"center\",zIndex:1,border:\"none\"},children:/*#__PURE__*/_jsx(\"svg\",{width:arrowSize,height:arrowSize,viewBox:\"0 0 24 24\",fill:\"none\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M12 6L12 18M12 6L7 11M12 6L17 11\",stroke:\"#FFFFFF\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})})]});}// Component controls for Framer\naddPropertyControls(ScrollProgressBar,{size:{type:ControlType.Number,title:\"Size\",defaultValue:60,min:50,max:500,step:10},trackWidth:{type:ControlType.Number,title:\"Track width\",defaultValue:4,min:1,max:50,step:1},indicatorWidth:{type:ControlType.Number,title:\"Indicator width\",defaultValue:4,min:1,max:50,step:1},arrowSize:{type:ControlType.Number,title:\"Arrow size\",defaultValue:14,min:10,max:100,step:1},scrollOffset:{type:ControlType.Number,title:\"Scroll offset\",defaultValue:0,min:0,max:.9,step:.05,displayStepper:true},smoothing:{type:ControlType.Number,title:\"Animation smoothing (sec)\",defaultValue:.2,min:0,max:1,step:.1},useFixedPosition:{type:ControlType.Boolean,title:\"Fixed position\",defaultValue:true},fixedPositionRight:{type:ControlType.Number,title:\"Right offset\",defaultValue:30,min:0,max:100,step:1,hidden(props){return!props.useFixedPosition;}},fixedPositionBottom:{type:ControlType.Number,title:\"Bottom offset\",defaultValue:30,min:0,max:100,step:1,hidden(props){return!props.useFixedPosition;}},visibilityScrollThreshold:{type:ControlType.Number,title:\"Show after scroll (px)\",defaultValue:200,min:0,max:2e3,step:10,displayStepper:true},fadeInAnimation:{type:ControlType.Enum,title:\"Animation style\",options:[\"fade\",\"slide-up\",\"scale\",\"none\"],optionTitles:[\"Fade in\",\"Slide up\",\"Scale\",\"None\"],defaultValue:\"fade\"},animationDuration:{type:ControlType.Number,title:\"Animation duration (s)\",defaultValue:.5,min:.1,max:2,step:.1,displayStepper:true},showTrackWhenInactive:{type:ControlType.Boolean,title:\"Show track when inactive\",defaultValue:false}});// Default size settings\nScrollProgressBar.defaultProps={width:60,height:60};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollProgressBar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Progress_Bar.map"],"mappings":"gaACA,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,OAAK,aAAW,iBAAe,YAAU,eAAa,YAAU,mBAAiB,qBAAmB,sBAAoB,wBAAsB,4BAA0B,kBAAgB,oBAAkB,GAAG,EAAK,CAAC,EACpQ,EAAO,CAAC,WAAW,cAAc,iBAAiB,UAAU,UAAU,UAAU,MAAM,UAAU,MAAM,UAAU,IAAI,SAAU,EAC/H,CAAC,kBAAgB,CAAC,GAAW,CAC7B,CAAC,EAAQ,EAAW,CAAC,EAAS,EAAE,CAChC,CAAC,EAAS,EAAY,CAAC,EAAS,EAAE,CACjC,EAAU,GAAO,EAAM,CACvB,EAAY,IAAI,CAAC,EAAO,SAAS,CAAC,IAAI,EAAE,SAAS,QAAS,EAAC,AAAE,EAAC,EAAU,IAAI,CAClF,EAAU,SAAQ,EAClB,IAAM,EAAa,IAAI,CAAC,AAAG,EAAU,SAAS,EAAO,sBAAsB,IAAI,CAAC,EAAW,EAAO,QAAQ,AAAE,EAAC,AAAG,EAChH,EAAO,iBAAiB,SAAS,EAAa,CAAC,SAAQ,CAAK,EAAC,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