{"version":3,"file":"Scrollprogress.BGPLezaS.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/0JbLZy4cicPNL8ihEfRO/nApVOnbQSRaEXWZIDiOm/Scrollprogress.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,useRef}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";// Code component provided by Eleveight Supply™. All rights reserved 2024.\n/**\n * @framerDisableUnlink\n *\n * @framerIntrinsicWidth 1200\n * @framerIntrinsicHeight 300\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight 100%\n */export default function ScrollProgress(props){const[scrollProgress,setScrollProgress]=useState(0);const progressBarRef=useRef(null);const updateScrollProgress=()=>{const totalPageHeight=document.documentElement.scrollHeight-window.innerHeight;const scrollPosition=window.scrollY;const scrollPercentage=Math.min(scrollPosition/totalPageHeight*100,100);setScrollProgress(scrollPercentage);};useEffect(()=>{window.addEventListener(\"scroll\",updateScrollProgress);return()=>{window.removeEventListener(\"scroll\",updateScrollProgress);};},[]);const controlledGlowSpread=spread=>{return Math.log(spread+1)*10;};// For gradient fills, adjust the angle based on orientation\nconst getBackgroundStyle=()=>{if(props.fillType===\"gradient\"){const angle=props.orientation===\"vertical\"?\"180deg\":\"90deg\";return`linear-gradient(${angle}, ${props.gradientStartColor}, ${props.gradientEndColor})`;}return props.fillColor;};const getGlowStyle=()=>{if(props.fillType===\"gradient\"||!props.glowEnabled)return{};const glowColor=props.glowColor||props.fillColor;return{boxShadow:`0 0 ${controlledGlowSpread(props.glowSpread)}px ${controlledGlowSpread(props.glowSpread)}px ${glowColor}`,opacity:props.glowIntensity/100};};// Determine orientation\nconst isVertical=props.orientation===\"vertical\";// Container style: for vertical we use a fixed width (the bar \"thickness\")\nconst containerStyle=isVertical?{width:`${props.barHeight}px`,height:\"100%\",background:getBackgroundStyle(),position:\"relative\",overflow:\"visible\"}:{width:\"100%\",height:`${props.barHeight}px`,background:getBackgroundStyle(),position:\"relative\",overflow:\"visible\"};return /*#__PURE__*/_jsxs(\"div\",{ref:progressBarRef,style:containerStyle,role:\"progressbar\",\"aria-valuenow\":Math.round(scrollProgress),\"aria-valuemin\":0,\"aria-valuemax\":100,children:[/*#__PURE__*/_jsx(motion.div,{initial:isVertical?{height:\"100%\"}:{width:\"100%\"},animate:isVertical?{height:`${100-scrollProgress}%`}:{width:`${100-scrollProgress}%`},transition:props.transition,style:isVertical?{width:\"100%\",backgroundColor:props.backgroundColor,position:\"absolute\",bottom:0,left:0}:{height:\"100%\",backgroundColor:props.backgroundColor,position:\"absolute\",top:0,right:0}}),props.fillType===\"solid\"&&props.glowEnabled&&/*#__PURE__*/_jsx(motion.div,{initial:isVertical?{height:\"0%\"}:{width:\"0%\"},animate:isVertical?{height:`${scrollProgress}%`}:{width:`${scrollProgress}%`},transition:props.transition,style:isVertical?{width:\"100%\",background:props.fillColor,position:\"absolute\",top:0,left:0,...getGlowStyle(),zIndex:1}:{height:\"100%\",background:props.fillColor,position:\"absolute\",top:0,left:0,...getGlowStyle(),zIndex:1}})]});}addPropertyControls(ScrollProgress,{orientation:{type:ControlType.SegmentedEnum,title:\"Orientation\",defaultValue:\"horizontal\",options:[\"horizontal\",\"vertical\"],optionTitles:[\"Horizontal\",\"Vertical\"]},barHeight:{type:ControlType.Number,defaultValue:2,min:1,max:50,step:1,displayStepper:true,unit:\"px\",title:\"Bar Thickness\"},backgroundColor:{type:ControlType.Color,defaultValue:\"#757575\",title:\"Background\"},fillType:{type:ControlType.SegmentedEnum,title:\"Fill Type\",defaultValue:\"solid\",options:[\"solid\",\"gradient\"],optionTitles:[\"Solid\",\"Gradient\"],onChange:(value,props)=>{if(value===\"gradient\"){props.glowEnabled=false;}}},fillColor:{type:ControlType.Color,defaultValue:\"#6200EE\",title:\"Fill\",hidden(props){return props.fillType===\"gradient\";}},gradientStartColor:{type:ControlType.Color,defaultValue:\"#6200EE\",title:\"Start\",hidden(props){return props.fillType===\"solid\";}},gradientEndColor:{type:ControlType.Color,defaultValue:\"#FF00AA\",title:\"End\",hidden(props){return props.fillType===\"solid\";}},glowEnabled:{type:ControlType.Boolean,title:\"Glow\",defaultValue:false,hidden(props){return props.fillType===\"gradient\";}},glowColor:{type:ControlType.Color,defaultValue:\"#6200EE\",title:\"Color\",hidden(props){return props.fillType===\"gradient\"||!props.glowEnabled;}},glowIntensity:{type:ControlType.Number,defaultValue:12,min:0,max:100,step:1,displayStepper:true,unit:\"%\",title:\"Intensity\",hidden(props){return!props.glowEnabled;}},glowSpread:{type:ControlType.Number,defaultValue:3,min:1,max:100,step:1,displayStepper:true,unit:\"%\",title:\"Spread\",hidden(props){return!props.glowEnabled;}},transition:{type:ControlType.Transition,title:\"Transition\",defaultValue:{type:\"tween\",duration:0}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollProgress\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"100%\",\"framerIntrinsicWidth\":\"1200\",\"framerDisableUnlink\":\"*\",\"framerIntrinsicHeight\":\"300\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Scrollprogress.map"],"mappings":"+PASG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,EAAe,GAAmBA,EAAS,CAAC,EAAQ,EAAeC,EAAO,IAAI,EAAQ,MAAyB,CAAC,IAAM,EAAgB,SAAS,gBAAgB,aAAa,EAAO,YAAkB,EAAe,EAAO,QAAc,EAAiB,KAAK,IAAI,EAAe,EAAgB,IAAI,GAAG,EAAE,EAAkB,CAAgB,CAAE,EAAE,OAAe,EAAO,iBAAiB,SAAS,CAAoB,MAAY,CAAC,EAAO,oBAAoB,SAAS,CAAoB,CAAE,GAAI,CAAC,CAAC,EAAE,IAAM,EAAqB,GAAgB,KAAK,IAAI,EAAO,CAAC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