{"version":3,"file":"TOPBUTTON.C_Chxdis.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/KPIG1EdGXzcjhercXZO8/ytMDLdwE8rXLSz7J9mXq/TOPBUTTON.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{motion,AnimatePresence}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";export default function BackToTopButton(props){const{label,showIcon,backgroundColor,hoverBackgroundColor,textColor,position,borderRadius,shadow,scrollThreshold,hoverScale}=props;const[visible,setVisible]=React.useState(false);const[isHovered,setIsHovered]=React.useState(false);React.useEffect(()=>{const handleScroll=()=>{const y=window.scrollY||document.documentElement.scrollTop;setVisible(y>scrollThreshold);};window.addEventListener(\"scroll\",handleScroll,{passive:true});handleScroll()// check on mount\n;return()=>window.removeEventListener(\"scroll\",handleScroll);},[scrollThreshold]);const scrollToTop=()=>{window.scrollTo({top:0,behavior:\"smooth\"});};// Position presets\nconst cornerStyle=(()=>{switch(position){case\"bottom-left\":return{left:24,bottom:24};case\"bottom-right\":return{right:24,bottom:24};case\"top-left\":return{left:24,top:24};case\"top-right\":return{right:24,top:24};default:return{left:24,bottom:24};}})();const style={position:\"fixed\",zIndex:9999,display:\"flex\",alignItems:\"center\",gap:8,padding:\"10px 16px\",border:\"none\",borderRadius,background:isHovered?hoverBackgroundColor:backgroundColor,color:textColor,fontSize:14,fontWeight:500,cursor:\"pointer\",boxShadow:shadow?\"0 6px 16px rgba(0,0,0,0.25)\":\"none\",transition:\"background 0.25s ease\",...cornerStyle};const iconStyle={width:16,height:16};return /*#__PURE__*/_jsx(AnimatePresence,{children:visible&&/*#__PURE__*/_jsxs(motion.button,{onClick:scrollToTop,style:style,initial:{opacity:0,y:16},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:16},transition:{duration:.25},onMouseEnter:()=>setIsHovered(true),onMouseLeave:()=>setIsHovered(false),whileHover:{scale:hoverScale},children:[showIcon&&/*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",style:iconStyle,children:/*#__PURE__*/_jsx(\"path\",{d:\"M12 5.5v13M6.75 11.25L12 5.5l5.25 5.75\",stroke:\"currentColor\",strokeWidth:\"1.8\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})}),/*#__PURE__*/_jsx(\"span\",{children:label})]})});}BackToTopButton.defaultProps={label:\"Back to Top\",showIcon:true,backgroundColor:\"#000000\",hoverBackgroundColor:\"#333333\",textColor:\"#ffffff\",position:\"bottom-left\",borderRadius:9999,shadow:true,scrollThreshold:100,hoverScale:1.05};addPropertyControls(BackToTopButton,{label:{type:ControlType.String,title:\"Text\"},showIcon:{type:ControlType.Boolean,title:\"Show Arrow\"},backgroundColor:{type:ControlType.Color,title:\"Background\"},hoverBackgroundColor:{type:ControlType.Color,title:\"Hover BG\"},textColor:{type:ControlType.Color,title:\"Text\"},borderRadius:{type:ControlType.Number,title:\"Roundness\",min:0,max:9999},shadow:{type:ControlType.Boolean,title:\"Shadow\"},position:{type:ControlType.Enum,title:\"Position\",options:[\"bottom-left\",\"bottom-right\",\"top-left\",\"top-right\"],optionTitles:[\"Bottom Left\",\"Bottom Right\",\"Top Left\",\"Top Right\"]},scrollThreshold:{type:ControlType.Number,title:\"Scroll Trigger (px)\",min:0,max:1e3,defaultValue:100},hoverScale:{type:ControlType.Number,title:\"Hover Scale\",min:1,max:1.2,step:.01}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BackToTopButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TOPBUTTON.map"],"mappings":"8PAA2L,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,QAAM,WAAS,kBAAgB,uBAAqB,YAAU,WAAS,eAAa,SAAO,kBAAgB,cAAY,EAAW,CAAC,EAAQ,GAA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