{"version":3,"file":"BackToTopButton.Cos4t4rd.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/FfztsQTHjTlzLXThFLK9/aEoQYZmZLdwg4XRWvDvx/BackToTopButton.js"],"sourcesContent":["// Back to Top button with shiny gleam animation\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,useRef,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Back to Top Button with Shiny Gleam\n *\n * @framerIntrinsicWidth 120\n * @framerIntrinsicHeight 48\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function BackToTopButton(props){const{label,backgroundColor,textColor,borderRadius,font,gleamColor,gleamDuration,showAt,style}=props;const[visible,setVisible]=useState(false);const isStatic=useIsStaticRenderer();const gleamRef=useRef(null);useEffect(()=>{if(typeof window===\"undefined\"||isStatic)return;const onScroll=()=>{startTransition(()=>setVisible(window.scrollY>showAt));};window.addEventListener(\"scroll\",onScroll);onScroll();return()=>window.removeEventListener(\"scroll\",onScroll);},[showAt,isStatic]);function handleClick(){if(typeof window!==\"undefined\"){window.scrollTo({top:0,behavior:\"smooth\"});}}// Gleam animation\nuseEffect(()=>{if(isStatic||!gleamRef.current)return;gleamRef.current.style.animation=`gleam ${gleamDuration}s linear infinite`;},[gleamDuration,isStatic]);if(!visible&&!isStatic)return null;return /*#__PURE__*/_jsxs(\"button\",{\"aria-label\":\"Back to top\",onClick:handleClick,style:{...style,position:\"relative\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",background:backgroundColor,color:textColor,border:\"none\",borderRadius,padding:\"0 24px\",minHeight:48,minWidth:120,boxShadow:\"0 4px 16px rgba(0,0,0,0.10)\",cursor:\"pointer\",overflow:\"hidden\",outline:\"none\",...font,fontFamily:font.fontFamily,fontSize:font.fontSize,fontWeight:font.fontWeight,lineHeight:font.lineHeight,letterSpacing:font.letterSpacing,WebkitTapHighlightColor:\"transparent\",transition:\"box-shadow 0.2s, transform 0.2s\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{position:\"relative\",zIndex:2},children:label}),/*#__PURE__*/_jsx(\"span\",{ref:gleamRef,\"aria-hidden\":\"true\",style:{pointerEvents:\"none\",position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\",zIndex:3,background:`linear-gradient(120deg, transparent 30%, ${gleamColor} 50%, transparent 70%)`,opacity:.7,transform:\"translateX(-100%) skewX(-20deg)\"}}),/*#__PURE__*/_jsx(\"style\",{children:`\n                @keyframes gleam {\n                    0% { transform: translateX(-100%) skewX(-20deg); opacity: 0.7; }\n                    60% { opacity: 0.7; }\n                    80% { opacity: 0.2; }\n                    100% { transform: translateX(120%) skewX(-20deg); opacity: 0; }\n                }\n                button:active { transform: scale(0.97); }\n                button:focus { box-shadow: 0 0 0 2px ${gleamColor}33; }\n            `})]});}addPropertyControls(BackToTopButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Back to Top\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#111\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#fff\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},gleamColor:{type:ControlType.Color,title:\"Gleam Color\",defaultValue:\"#fff\"},gleamDuration:{type:ControlType.Number,title:\"Gleam Speed (s)\",defaultValue:2,min:1,max:10,step:.1},showAt:{type:ControlType.Number,title:\"Show After (px)\",defaultValue:200,min:0,max:2e3,step:10}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"BackToTopButton\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"120\",\"framerSupportedLayoutHeight\":\"fixed\",\"framerIntrinsicHeight\":\"48\",\"fram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