{"version":3,"file":"NavigationMenu.CekfT8we.mjs","names":["useTransition","useRef","useState"],"sources":["https:/framerusercontent.com/modules/vexGsTXUouquDKlp9E6k/Mu87TgthudmHZHS00Kp3/NavigationMenu.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useTransition,useRef}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion}from\"framer-motion\";// Multi-page navigation configuration\nconst NAV_ITEMS=[{id:\"home\",label:\"HOME\",path:\"/\"},{id:\"experience\",label:\"EXPERIENCE\",path:\"/experience\"},{id:\"projects\",label:\"PROJECTS\",path:\"/projects\"}];// Store the previous tab outside the React lifecycle so it persists across page navigations!\nlet globalPreviousTab=null;/**\n * NavigationMenu\n *\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 40\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function NavigationMenu(props){const{activePage=\"auto\",pillColor=\"rgba(0,0,0,0.05)\",hoverPillColor=\"rgba(0,0,0,0.02)\",activeTextColor=\"rgb(29, 29, 31)\",inactiveTextColor=\"rgb(134, 134, 139)\",font}=props;const isStatic=useIsStaticRenderer();const[,startTransitionHook]=useTransition();const linkRefs=useRef([]);// Safely determine the actual current tab based on URL\nconst getActualTab=()=>{if(activePage!==\"auto\")return activePage;if(typeof window===\"undefined\"||isStatic)return\"home\";const path=window.location.pathname.toLowerCase();if(path.includes(\"/projects\"))return\"projects\";if(path.includes(\"/experience\"))return\"experience\";return\"home\";};const currentActualTab=getActualTab();// Initialize state to the PREVIOUS tab if one exists, otherwise the current tab.\n// This allows us to fake a seamless sliding animation across page loads!\nconst[activeTab,setActiveTab]=useState(globalPreviousTab&&globalPreviousTab!==currentActualTab?globalPreviousTab:currentActualTab);const[hoveredTab,setHoveredTab]=useState(null);// Trigger the slide animation right after the new page mounts\nuseEffect(()=>{if(activeTab!==currentActualTab){// Wait for Framer Motion to register the layout, then snap to the new tab\nconst timer=setTimeout(()=>{startTransitionHook(()=>setActiveTab(currentActualTab));},50);return()=>clearTimeout(timer);}// Update the global store for the NEXT time they navigate\nglobalPreviousTab=currentActualTab;},[currentActualTab,activeTab]);// Watch for URL changes inside the same page instance\nuseEffect(()=>{if(typeof window===\"undefined\"||isStatic||activePage!==\"auto\")return;const handleLocationCheck=()=>{const newTab=getActualTab();if(newTab!==activeTab){globalPreviousTab=activeTab// Save where we came from\n;startTransitionHook(()=>setActiveTab(newTab));}};const interval=setInterval(handleLocationCheck,500);window.addEventListener(\"popstate\",handleLocationCheck);return()=>{clearInterval(interval);window.removeEventListener(\"popstate\",handleLocationCheck);};},[isStatic,activePage,activeTab]);const handleItemClick=(item,e)=>{if(typeof window===\"undefined\")return;globalPreviousTab=activeTab// Store the tab they are leaving\n;startTransitionHook(()=>setActiveTab(item.id));};const highlightedTab=hoveredTab||activeTab;const resolvedFontFamily=font?.fontFamily&&!font.fontFamily.toLowerCase().includes(\"inter\")&&!font.fontFamily.toLowerCase().includes(\"sans-serif\")&&!font.fontFamily.toLowerCase().includes(\"system-ui\")?font.fontFamily:'\"Google Sans Code-regular\", \"Google Sans Code\", monospace';return /*#__PURE__*/_jsx(\"nav\",{style:{display:\"flex\",alignItems:\"center\",gap:\"8px\",position:\"relative\",padding:\"4px\",borderRadius:\"999px\",...props.style},children:NAV_ITEMS.map((item,index)=>{const isActive=activeTab===item.id;const isHighlighted=highlightedTab===item.id;return /*#__PURE__*/_jsxs(\"a\",{ref:el=>{linkRefs.current[index]=el;},href:item.path,target:\"_self\",onClick:e=>handleItemClick(item,e),onMouseEnter:()=>startTransitionHook(()=>setHoveredTab(item.id)),onMouseLeave:()=>startTransitionHook(()=>setHoveredTab(null)),style:{...font,fontFamily:resolvedFontFamily,fontWeight:font?.fontWeight||400,fontSize:font?.fontSize||\"13px\",letterSpacing:font?.letterSpacing||\"0.12em\",lineHeight:font?.lineHeight||\"1.1em\",textTransform:\"uppercase\",position:\"relative\",padding:\"8px 16px\",borderRadius:\"999px\",textDecoration:\"none\",color:isActive?activeTextColor:inactiveTextColor,transition:\"color 0.25s ease\",display:\"inline-block\",cursor:\"pointer\",zIndex:1},children:[isHighlighted&&!isStatic&&/*#__PURE__*/_jsx(motion.div,{layoutId:\"nav-sliding-pill\",style:{position:\"absolute\",inset:0,backgroundColor:isActive?pillColor:hoverPillColor,borderRadius:\"999px\",zIndex:-1},transition:{type:\"spring\",stiffness:320,damping:28,mass:.8}}),isActive&&isStatic&&/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,backgroundColor:pillColor,borderRadius:\"999px\",zIndex:-1}}),item.label]},item.id);})});}addPropertyControls(NavigationMenu,{activePage:{type:ControlType.Enum,options:[\"auto\",\"home\",\"experience\",\"projects\"],optionTitles:[\"Auto-detect (URL)\",\"Home\",\"Experience\",\"Projects\"],title:\"Active Page\",defaultValue:\"auto\"},pillColor:{type:ControlType.Color,title:\"Active Pill\",defaultValue:\"rgba(0, 0, 0, 0.05)\"},hoverPillColor:{type:ControlType.Color,title:\"Hover Pill\",defaultValue:\"rgba(0, 0, 0, 0.02)\"},activeTextColor:{type:ControlType.Color,title:\"Active Text\",defaultValue:\"rgb(29, 29, 31)\"},inactiveTextColor:{type:ControlType.Color,title:\"Inactive Text\",defaultValue:\"rgb(134, 134, 139)\"},font:{type:ControlType.Font,title:\"Font Settings\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"13px\",variant:\"Regular\",letterSpacing:\"0.12em\",lineHeight:\"1.1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"NavigationMenu\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"40\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NavigationMenu.map"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