{"version":3,"file":"BackToTopButton.DCfbMTlk.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/PMi7zHdQ2j6wCuuRmtuI/4eDqm2hxVSVD2wvHrhjX/BackToTopButton.js"],"sourcesContent":["// Back to top button that scrolls to page top with customizable styling\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect,startTransition}from\"react\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function BackToTopButton(props){const{backgroundColor,iconColor,padding,borderRadius}=props;const[isVisible,setIsVisible]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;const handleScroll=()=>{const scrollTop=window.pageYOffset||document.documentElement.scrollTop;startTransition(()=>{setIsVisible(scrollTop>200);});};window.addEventListener(\"scroll\",handleScroll);// Check initial scroll position\nhandleScroll();return()=>{window.removeEventListener(\"scroll\",handleScroll);};},[]);const handleClick=()=>{if(typeof window!==\"undefined\"){window.scrollTo({top:0,behavior:\"smooth\"});}};return /*#__PURE__*/_jsx(\"button\",{onClick:handleClick,style:{...props.style,backgroundColor,border:\"none\",borderRadius,padding,cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",transition:\"all 0.3s ease\",boxShadow:\"0 2px 8px rgba(0, 0, 0, 0.1)\",opacity:isVisible?1:0,visibility:isVisible?\"visible\":\"hidden\",transform:isVisible?\"translateY(0)\":\"translateY(20px)\"},onMouseEnter:e=>{if(isVisible){e.currentTarget.style.transform=\"translateY(-2px)\";e.currentTarget.style.boxShadow=\"0 4px 12px rgba(0, 0, 0, 0.15)\";}},onMouseLeave:e=>{if(isVisible){e.currentTarget.style.transform=\"translateY(0)\";e.currentTarget.style.boxShadow=\"0 2px 8px rgba(0, 0, 0, 0.1)\";}},\"aria-label\":\"Back to top\",children:/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",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 Color\",defaultValue:\"#000000\"},iconColor:{type:ControlType.Color,title:\"Icon Color\",defaultValue:\"#FFFFFF\"},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:12,min:4,max:32,step:2,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Border Radius\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BackToTopButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BackToTopButton.map"],"mappings":"4LAIG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,kBAAgB,YAAU,UAAQ,gBAAc,EAAW,CAAC,EAAU,GAAcA,EAAS,EAAK,EAC+B,OAD7B,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,MAAiB,CAAC,IAAM,EAAU,EAAO,aAAa,SAAS,gBAAgB,UAAU,MAAoB,CAAC,EAAa,EAAU,GAAG,CAAE,CAAC,CAAE,EACrV,OADuV,EAAO,iBAAiB,SAAS,CAAY,EACnZ,EAAa,MAAY,CAAC,EAAO,oBAAoB,SAAS,CAAY,CAAE,CAAE,EAAE,CAAC,CAAC,EAA2H,EAAK,SAAS,CAAC,YAAlH,CAAW,IAAS,QAAa,EAAO,SAAS,CAAC,IAAI,EAAE,SAAS,QAAQ,CAAC,CAAG,EAAyD,MAAM,CAAC,GAAG,EAAM,MAAM,kBAAgB,OAAO,OAAO,eAAa,UAAQ,OAAO,UAAU,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,WAAW,gBAAgB,UA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