{"version":3,"file":"Scroll_Nav.DdmV0Pre.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/RCN1McOqac9xqFErYRMB/yZIgaTHJHeUsR42QjOHv/Scroll_Nav.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";export default function VerticalScrollNav(props){const{links,bgColor,textColor,activeColor,indicatorColor,fontSize,paddingX,paddingY,gap,borderRadius,borderWidth,borderColor}=props;const[active,setActive]=React.useState(links[0]?.id);React.useEffect(()=>{const handleScroll=()=>{links.forEach(link=>{const el=document.getElementById(link.id);if(!el)return;const rect=el.getBoundingClientRect();if(rect.top<=120&&rect.bottom>=120){setActive(link.id);}});};window.addEventListener(\"scroll\",handleScroll);return()=>window.removeEventListener(\"scroll\",handleScroll);},[links]);const scrollTo=id=>{const el=document.getElementById(id);if(!el)return;el.scrollIntoView({behavior:\"smooth\",block:\"start\"});};return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:gap,background:bgColor,padding:`${paddingY}px ${paddingX}px`,borderRadius:borderRadius,border:`${borderWidth}px solid ${borderColor}`,width:\"fit-content\"},children:links.map(link=>/*#__PURE__*/_jsxs(\"div\",{onClick:()=>scrollTo(link.id),style:{cursor:\"pointer\",fontSize:fontSize,color:active===link.id?activeColor:textColor,position:\"relative\",paddingLeft:14},children:[link.label,active===link.id&&/*#__PURE__*/_jsx(motion.div,{layoutId:\"indicator\",style:{position:\"absolute\",left:0,top:0,bottom:0,width:3,background:indicatorColor,borderRadius:3}})]},link.id))});}VerticalScrollNav.defaultProps={links:[{label:\"Home\",id:\"hero\"},{label:\"Features\",id:\"features\"},{label:\"Pricing\",id:\"pricing\"},{label:\"Contact\",id:\"contact\"}],bgColor:\"#ffffff\",textColor:\"#777\",activeColor:\"#000\",indicatorColor:\"#000\",fontSize:14,paddingX:16,paddingY:16,gap:12,borderRadius:12,borderWidth:0,borderColor:\"#e5e5e5\"};addPropertyControls(VerticalScrollNav,{links:{type:ControlType.Array,title:\"Links\",propertyControl:{type:ControlType.Object,controls:{label:{type:ControlType.String,title:\"Label\"},id:{type:ControlType.String,title:\"Section ID\"}}}},bgColor:{type:ControlType.Color,title:\"Background\"},textColor:{type:ControlType.Color,title:\"Text\"},activeColor:{type:ControlType.Color,title:\"Active Text\"},indicatorColor:{type:ControlType.Color,title:\"Indicator\"},fontSize:{type:ControlType.Number,title:\"Font Size\"},paddingX:{type:ControlType.Number,title:\"Padding X\"},paddingY:{type:ControlType.Number,title:\"Padding Y\"},gap:{type:ControlType.Number,title:\"Gap\"},borderRadius:{type:ControlType.Number,title:\"Radius\"},borderWidth:{type:ControlType.Number,title:\"Border\"},borderColor:{type:ControlType.Color,title:\"Border Color\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"VerticalScrollNav\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Scroll_Nav.map"],"mappings":"uPAA2K,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,QAAM,UAAQ,YAAU,cAAY,iBAAe,WAAS,WAAS,WAAS,MAAI,eAAa,cAAY,eAAa,EAAW,CAAC,EAAO,GAAWA,EAAe,EAAM,IAAI,GAAG,CAAC,MAAoB,CAAC,IAAM,MAAiB,CAAC,EAAM,QAAQ,GAAM,CAAC,IAAM,EAAG,SAAS,eAAe,EAAK,GAAG,CAAC,GAAG,CAAC,EAAG,OAAO,IAAM,EAAK,EAAG,uBAAuB,CAAI,EAAK,KAAK,KAAK,EAAK,QAAQ,KAAK,EAAU,EAAK,GAAG,EAAI,EAAkD,OAA/C,EAAO,iBAAiB,SAAS,EAAa,KAAW,EAAO,oBAAoB,SAAS,EAAa,EAAG,CAAC,EAAM,CAAC,CAAC,IAAM,EAAS,GAAI,CAAC,IAAM,EAA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