{"version":3,"file":"Scroll_progress_bar.Dik5LZSV.mjs","names":["p"],"sources":["https:/framerusercontent.com/modules/cucMiVKCuCvHX2J3vhYl/0bkjobUesjgdQ5Y7ga2Y/ulvhFsEik.js","https:/framerusercontent.com/modules/HvNHO2ScTr7HQzwUcSD4/gaG4psyF6bVtRqiDYWmW/Scroll_progress_bar.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask='url(\\'data:image/svg+xml,<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 0 10 C 0 4.477 4.477 0 10 0 C 15.523 0 20 4.477 20 10 C 20 15.523 15.523 20 10 20 C 4.477 20 0 15.523 0 10 Z\" fill=\"transparent\" height=\"20px\" id=\"shEwaHYdL\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" stroke=\"var(--1df8v9o, rgb(0,0,0))\" transform=\"translate(2 2)\" width=\"20px\"/><path d=\"M 0 0 L 0 5 L 3 8\" fill=\"transparent\" height=\"8px\" id=\"s8CzmbHTE\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" stroke=\"var(--1df8v9o, rgb(0,0,0))\" transform=\"translate(12 7)\" width=\"3px\"/></svg>\\') alpha no-repeat center / auto var(--framer-icon-mask-mode, add), var(--framer-icon-mask, none)';const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(motion.div,{...rest,layoutId:layoutId,ref:ref}):/*#__PURE__*/_jsx(\"div\",{...rest,ref:ref});});const getProps=({height,id,stroke,width,...props})=>{return{...props,n2nHSaXfp:stroke??props.n2nHSaXfp??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,n2nHSaXfp,...restProps}=getProps(props);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-nobZj\",className),layoutId:layoutId,ref:ref,style:{\"--1df8v9o\":n2nHSaXfp,...style}});});const css=[`.framer-nobZj { -webkit-mask: ${mask}; aspect-ratio: 1; background-color: var(--1df8v9o); mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"n2nHSaXfp\":\"stroke\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Clock\",\"color\":{\"type\":\"variable\",\"value\":\"1df8v9o\"},\"set\":{\"localId\":\"vectorSet/yXo17f3GZ\",\"id\":\"yXo17f3GZ\",\"moduleId\":\"eO37kitVCMcNEgHMGd3K\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-nobZj\");Icon.displayName=\"Clock\";export default Icon;addPropertyControls(Icon,{n2nHSaXfp:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Stroke\",type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"true\",\"framerIntrinsicWidth\":\"24\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"24\",\"framerVector\":\"{\\\"name\\\":\\\"Clock\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"1df8v9o\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/yXo17f3GZ\\\",\\\"id\\\":\\\"yXo17f3GZ\\\",\\\"moduleId\\\":\\\"eO37kitVCMcNEgHMGd3K\\\"}}\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerVariables\":\"{\\\"n2nHSaXfp\\\":\\\"stroke\\\"}\",\"framerContractVersion\":\"1\",\"framerImmutableVariables\":\"true\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// ScrollProgressBar.tsx\n// @framerSupportedLayoutWidth auto\n// @framerSupportedLayoutHeight auto\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{motion,useMotionValue}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export default function ScrollProgressBar({thickness,color,orientation,hPosition,vPosition}){const progress=useMotionValue(0);React.useEffect(()=>{const update=()=>{const doc=document.documentElement;const body=document.body;const scrollHeight=Math.max(body.scrollHeight,doc.scrollHeight,body.offsetHeight,doc.offsetHeight,body.clientHeight,doc.clientHeight);const viewport=doc.clientHeight;const max=Math.max(scrollHeight-viewport,1);const y=window.pageYOffset||doc.scrollTop||body.scrollTop||0;progress.set(Math.min(Math.max(y/max,0),1));};update();window.addEventListener(\"scroll\",update,{passive:true});window.addEventListener(\"resize\",update);return()=>{window.removeEventListener(\"scroll\",update);window.removeEventListener(\"resize\",update);};},[progress]);const t=Math.max(thickness,1);// Container style (fixed, full-page)\nconst container={position:\"fixed\",zIndex:9999,pointerEvents:\"none\"};let barStyle;if(orientation===\"horizontal\"){Object.assign(container,{left:0,right:0,height:t,top:hPosition===\"top\"?0:undefined,bottom:hPosition===\"bottom\"?0:undefined});barStyle={height:\"100%\",width:\"100%\",background:color,scaleX:progress,transformOrigin:\"0% 50%\",willChange:\"transform\"};}else{Object.assign(container,{top:0,bottom:0,width:t,left:vPosition===\"left\"?0:undefined,right:vPosition===\"right\"?0:undefined});barStyle={width:\"100%\",height:\"100%\",background:color,scaleY:progress,transformOrigin:\"50% 0%\",willChange:\"transform\"};}return /*#__PURE__*/_jsx(\"div\",{style:container,children:/*#__PURE__*/_jsx(motion.div,{style:barStyle})});}addPropertyControls(ScrollProgressBar,{thickness:{type:ControlType.Number,title:\"Thickness\",defaultValue:3,min:1,max:40,unit:\"px\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#FF1212\"},orientation:{type:ControlType.Enum,title:\"Orientation\",options:[\"horizontal\",\"vertical\"],optionTitles:[\"Horizontal\",\"Vertical\"],defaultValue:\"horizontal\"},hPosition:{type:ControlType.Enum,title:\"Position\",options:[\"top\",\"bottom\"],optionTitles:[\"Top\",\"Bottom\"],defaultValue:\"top\",hidden:p=>p.orientation!==\"horizontal\"},vPosition:{type:ControlType.Enum,title:\"Position\",options:[\"left\",\"right\"],optionTitles:[\"Left\",\"Right\"],defaultValue:\"left\",hidden:p=>p.orientation!==\"vertical\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollProgressBar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Scroll_progress_bar.map"],"mappings":"4RAC2C,IAAsE,IAA4B,CAAoC,EAAK,wxBAAgyB,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG,GAAM,EAAM,OAAO,EAAsB,EAAK,EAAO,IAAI,CAAC,GAAG,EAAc,WAAa,MAAI,CAAC,CAAc,EAAK,MAAM,CAAC,GAAG,EAAS,MAAI,CAAC,EAAG,CAAO,GAAU,CAAC,SAAO,KAAG,SAAO,QAAM,GAAG,MAAgB,CAAC,GAAG,EAAM,UAAU,GAAQ,EAAM,WAAW,eAAe,EAU9xC,EAAK,EAVyzC,EAAiB,SAAS,EAAM,EAAI,CAAC,GAAK,CAAC,QAAM,YAAU,WAAS,UAAQ,YAAU,GAAG,GAAW,EAAS,EAAM,CAAC,OAAoB,EAAK,EAAI,CAAC,GAAG,EAAU,UAAU,EAAG,eAAe,EAAU,CAAU,WAAa,MAAI,MAAM,CAAC,YAAY,EAAU,GAAG,EAAM,CAAC,CAAC,EAAG,CAAW,CAAC,iCAAiC,EAAK,6DAA6D,EAAK,kBAAkB,CAUprD,eAAe,CAAC,E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