{"version":3,"file":"ProgressAnimation.CuisNNIh.mjs","names":["useRef","useState","useState"],"sources":["https:/framerusercontent.com/modules/llu9wuVFGZRQhk5ev46L/ACSOPjd005eX2km4AgTB/Border.js","https:/framerusercontent.com/modules/mmuwK1mPwrz4fzUMsH9Y/THaKXfxCGFwaaxdolhs7/ProgressAnimation.js"],"sourcesContent":["// Animated border that transforms from left to right or top to bottom when in view, with arrow icon control for direction and full Framer animation control. Only triggers on layer in view.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useRef,useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * BorderReveal\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight fixed\n */export default function BorderReveal(props){const{direction=\"leftToRight\",transition={type:\"tween\",ease:\"easeInOut\",duration:.7,delay:0},borderColor,size,borderRadius,replay=false,style}=props;const ref=useRef(null);const[inView,setInView]=useState(false);const[hasAnimated,setHasAnimated]=useState(false);const isStatic=useIsStaticRenderer();useEffect(()=>{if(isStatic){setInView(true);return;}const node=ref.current;if(!node)return;let observer=null;observer=new window.IntersectionObserver(([entry])=>{if(replay){startTransition(()=>setInView(entry.isIntersecting));}else{if(entry.isIntersecting&&!hasAnimated){startTransition(()=>setInView(true));setHasAnimated(true);}}},{threshold:0});observer.observe(node);return()=>{if(observer&&node)observer.unobserve(node);};},[isStatic,replay,hasAnimated]);return /*#__PURE__*/_jsx(\"div\",{ref:ref,style:{...style,position:\"relative\",width:direction===\"leftToRight\"?\"100%\":size,height:direction===\"leftToRight\"?size:\"100%\",minWidth:5,minHeight:5,overflow:\"hidden\",borderRadius,background:\"transparent\"},children:/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",left:direction===\"leftToRight\"?0:undefined,top:direction===\"topToBottom\"?0:undefined,width:direction===\"leftToRight\"?inView?\"100%\":0:size,height:direction===\"topToBottom\"?inView?\"100%\":0:size,background:borderColor,borderRadius,transition:transition.type===\"tween\"?`${direction===\"leftToRight\"?\"width\":\"height\"} ${transition.duration??.7}s ${transition.ease===\"linear\"?\"linear\":transition.ease===\"easeIn\"?\"cubic-bezier(0.4,0,1,1)\":transition.ease===\"easeOut\"?\"cubic-bezier(0,0,0.2,1)\":transition.ease===\"easeInOut\"?\"cubic-bezier(0.4,0,0.2,1)\":\"cubic-bezier(0.4,0,0.2,1)\"} ${transition.delay??0}s`:transition.type===\"spring\"?undefined:undefined},\"aria-hidden\":\"true\"})});}addPropertyControls(BorderReveal,{direction:{type:ControlType.Enum,title:\"Direction\",options:[\"leftToRight\",\"topToBottom\"],optionTitles:[\"→\",\"↓\"],defaultValue:\"leftToRight\",displaySegmentedControl:true},replay:{type:ControlType.Boolean,title:\"Replay\",defaultValue:false,enabledTitle:\"Yes\",disabledTitle:\"No\"},transition:{type:ControlType.Transition,title:\"Animation\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#222\"},size:{type:ControlType.Number,title:\"Size\",defaultValue:4,min:1,max:40,step:1,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:2,min:0,max:20,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BorderReveal\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Border.map","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export default function ProgressAnimation(props){const{backgroundColor,progressColor,timeAnimation}=props;const[width,setWidth]=useState(0);useEffect(function(){const interval=setInterval(function(){setWidth(prevWidth=>prevWidth>=100?0:prevWidth+1);},timeAnimation);return function cleanup(){clearInterval(interval);};},[timeAnimation]);const styles={container:{width:\"100%\",height:\"100%\",position:\"relative\",overflow:\"hidden\"},background:{position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",background:backgroundColor},progress:{position:\"absolute\",top:0,left:0,height:\"100%\",width:`${width}%`,background:progressColor,transition:`width ${timeAnimation}ms linear`}};return /*#__PURE__*/_jsxs(\"div\",{style:styles.container,children:[/*#__PURE__*/_jsx(\"div\",{style:styles.background}),/*#__PURE__*/_jsx(\"div\",{style:styles.progress})]});}addPropertyControls(ProgressAnimation,{backgroundColor:{title:\"Background Color\",type:ControlType.Color,defaultValue:\"rgba(0, 0, 0, 0.12)\"},progressColor:{title:\"Progress Color\",type:ControlType.Color,defaultValue:\"black\"},timeAnimation:{title:\"Animation Time (ms)\",type:ControlType.Number,defaultValue:90,min:10,max:1e3,step:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProgressAnimation\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ProgressAnimation.map"],"mappings":"4NAMG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,YAAU,cAAc,aAAW,CAAC,KAAK,QAAQ,KAAK,YAAY,SAAS,GAAG,MAAM,CAAC,EAAE,cAAY,OAAK,eAAa,SAAO,GAAM,SAAO,EAAY,EAAIA,EAAO,IAAI,EAAO,CAAC,EAAO,GAAWC,EAAS,EAAK,EAAO,CAAC,EAAY,GAAgBA,EAAS,EAAK,EAAQ,EAAS,EAAoB,EAA8c,OAA5c,MAAc,CAAC,GAAG,EAAS,CAAC,EAAU,EAAI,EAAE,MAAO,CAAC,IAAM,EAAK,EAAI,QAAQ,GAAG,CAAC,EAAK,OAAO,IAAI,EAAS,KAA2Q,MAAtQ,GAAS,IAAI,EAAO,sBAAsB,CAAC,KAAS,CAAI,EAAQ,MAAoB,EAAU,EAAM,cAAc,CAAC,EAAW,EAAM,gBAAgB,CAAC,IAAa,MAAoB,EAAU,EAAI,CAAC,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