{"version":3,"file":"BackToTopButton.DaVIm1o7.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/4azbe8uKEjbO6fViVdpI/AeyR5eatk4yz6KUfzHpW/BackToTopButton.js"],"sourcesContent":["// Back to top component with customizable background, icon color, shadow and size\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function BackToTopButton(props){const{backgroundColor,iconColor,showShadow,size}=props;const[isVisible,setIsVisible]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;const toggleVisibility=()=>{const scrollTop=window.pageYOffset;if(scrollTop>=1500){startTransition(()=>setIsVisible(true));}else{startTransition(()=>setIsVisible(false));}};window.addEventListener(\"scroll\",toggleVisibility);return()=>window.removeEventListener(\"scroll\",toggleVisibility);},[]);const scrollToTop=()=>{if(typeof window!==\"undefined\"){// Custom smooth scroll with elegant easing\nconst startPosition=window.pageYOffset;const startTime=performance.now();const duration=1200// Longer duration for elegance\n;const easeOutCubic=t=>1-Math.pow(1-t,3);const animateScroll=currentTime=>{const elapsed=currentTime-startTime;const progress=Math.min(elapsed/duration,1);const easedProgress=easeOutCubic(progress);const currentPosition=startPosition*(1-easedProgress);window.scrollTo(0,currentPosition);if(progress<1){requestAnimationFrame(animateScroll);}};requestAnimationFrame(animateScroll);}};return /*#__PURE__*/_jsx(\"button\",{onClick:scrollToTop,style:{position:\"fixed\",bottom:32,right:32,width:size,height:size,backgroundColor,border:\"none\",borderRadius:\"50%\",cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",boxShadow:showShadow?\"0 4px 12px rgba(0, 0, 0, 0.15)\":\"none\",transition:\"all 0.3s ease\",opacity:isVisible?1:0,visibility:isVisible?\"visible\":\"hidden\",zIndex:9999,overflow:\"visible\"},onMouseEnter:e=>{e.currentTarget.style.transform=\"scale(1.1)\";},onMouseLeave:e=>{e.currentTarget.style.transform=\"scale(1)\";},\"aria-label\":\"Back to top\",children:/*#__PURE__*/_jsx(\"svg\",{width:size*.4,height:size*.4,viewBox:\"0 0 24 24\",fill:\"none\",stroke:iconColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M12 19V5m-7 7l7-7 7 7\"})})});}addPropertyControls(BackToTopButton,{backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#000000\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#FFFFFF\"},showShadow:{type:ControlType.Boolean,title:\"Drop Shadow\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},size:{type:ControlType.Number,title:\"Size\",defaultValue:56,min:32,max:80,step:4,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BackToTopButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BackToTopButton.map"],"mappings":"yTAIG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,kBAAgB,YAAU,aAAW,QAAM,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAM,CAEwO,OAFvO,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,MAAqB,CAAiB,EAAO,aAA0B,KAAM,MAAoB,EAAa,GAAK,CAAC,CAAO,MAAoB,EAAa,GAAM,CAAC,EAAuD,OAAnD,EAAO,iBAAiB,SAAS,EAAiB,KAAW,EAAO,oBAAoB,SAAS,EAAiB,EAAG,EAAE,CAAC,CAE/F,EAAK,SAAS,CAAC,YAFuG,CAAC,GAAU,IAAS,OAAY,CACxiB,IAAM,EAAc,EAAO,YAAkB,EAAU,YAAY,KAAK,CACjE,EAAa,GAAG,GAAW,E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