{"version":3,"file":"ScrollDownArrow.k9aO2zD9.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/XsK645bCu1oYbCn6JVtU/UMtFRP9IIUuxd48KACnq/ScrollDownArrow.js"],"sourcesContent":["// Animated down arrow for hero section that scrolls to next section on hover\n// Lands so the next section starts right below the fixed header\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useRef}from\"react\";// Height of the fixed or sticky bar at the top of the viewport (navigation)\nfunction getHeaderHeight(){let height=0;const elements=document.elementsFromPoint(window.innerWidth/2,1);for(const element of elements){let current=element;while(current&&current!==document.body){const position=getComputedStyle(current).position;if(position===\"fixed\"||position===\"sticky\"){const rect=current.getBoundingClientRect();if(rect.top<=1&&rect.height<window.innerHeight*.5){height=Math.max(height,rect.bottom);}break;}current=current.parentElement;}}return height;}// Bottom edge of the hero: first ancestor that spans the width and at least half the viewport\nfunction getSectionBottom(start){let current=start?.parentElement??null;while(current&&current!==document.body){const rect=current.getBoundingClientRect();if(rect.width>=window.innerWidth*.9&&rect.height>=window.innerHeight*.5){return rect.bottom+window.scrollY;}current=current.parentElement;}return window.innerHeight;}/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function ScrollDownArrow(props){const{arrowColor=\"#FFFFFF\",backgroundColor=\"rgba(0, 0, 0, 0.1)\",size=60,animationSpeed=2,hoverEffect=true,scrollOffset=0}=props;const[isHovered,setIsHovered]=useState(false);const ref=useRef(null);const handleClick=()=>{if(typeof window!==\"undefined\"){const scrollTarget=getSectionBottom(ref.current)-getHeaderHeight()+scrollOffset;window.scrollTo({top:Math.max(0,scrollTarget),behavior:\"smooth\"});}};const handleMouseEnter=()=>{setIsHovered(true);if(hoverEffect){handleClick();}};const handleMouseLeave=()=>{setIsHovered(false);};return /*#__PURE__*/_jsx(motion.div,{ref:ref,style:{width:size,height:size,borderRadius:\"50%\",backgroundColor:backgroundColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",cursor:\"pointer\",position:\"relative\",backdropFilter:\"blur(10px)\",border:`1px solid rgba(255, 255, 255, 0.2)`},animate:{y:[0,10,0],scale:isHovered?1.1:1},transition:{y:{duration:animationSpeed,repeat:Infinity,ease:\"easeInOut\"},scale:{duration:.2,ease:\"easeOut\"}},whileHover:{scale:1.1},whileTap:{scale:.95},onClick:handleClick,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,children:/*#__PURE__*/_jsxs(motion.svg,{width:size*.4,height:size*.4,viewBox:\"0 0 24 24\",fill:\"none\",stroke:arrowColor,strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",animate:{y:isHovered?2:0},transition:{duration:.2,ease:\"easeOut\"},children:[/*#__PURE__*/_jsx(\"path\",{d:\"M7 13l5 5 5-5\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M7 6l5 5 5-5\"})]})});}addPropertyControls(ScrollDownArrow,{arrowColor:{type:ControlType.Color,title:\"Arrow Color\",defaultValue:\"#FFFFFF\"},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"rgba(0, 0, 0, 0.1)\"},size:{type:ControlType.Number,title:\"Size\",defaultValue:60,min:30,max:120,step:5,unit:\"px\"},animationSpeed:{type:ControlType.Number,title:\"Animation Speed\",defaultValue:2,min:.5,max:5,step:.1,unit:\"s\"},hoverEffect:{type:ControlType.Boolean,title:\"Scroll on Hover\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},scrollOffset:{type:ControlType.Number,title:\"Scroll Offset\",description:\"Extra distance after the header, 0 lands right below it\",defaultValue:0,min:-500,max:500,step:10,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollDownArrow\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"fixed\"}},\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