{"version":3,"file":"FloatingNavigation.De7MMeF7.mjs","names":["useRef","useState","useCallback","_Fragment"],"sources":["https:/framerusercontent.com/modules/chMa375luAhluUpsGHz8/L6lQt0gZymK4a5z9H5FK/FloatingNavigation.js"],"sourcesContent":["// Floating glassmorphism navigation panel with draggable snap, animated menu, and full property controls\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useRef,useEffect,useCallback,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";const CORNERS=[{x:0,y:0},{x:1,y:0},{x:0,y:1},{x:1,y:1}];function getClosestCorner(x,y,w,h,vw,vh){// x, y: current top-left of panel\n// w, h: panel size\n// vw, vh: viewport size\nconst centers=[{x:0,y:0},{x:vw-w,y:0},{x:0,y:vh-h},{x:vw-w,y:vh-h}];let minDist=Infinity;let idx=0;for(let i=0;i<centers.length;i++){const dx=x-centers[i].x;const dy=y-centers[i].y;const dist=dx*dx+dy*dy;if(dist<minDist){minDist=dist;idx=i;}}return centers[idx];}/**\n * Floating Glassmorphism Navigation Panel\n *\n * @framerIntrinsicWidth 320\n * @framerIntrinsicHeight 64\n *\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n */export default function FloatingNavigation(props){const{background,blur,borderRadius,borderColor,borderWidth,brand,brandColor,brandFont,menuFont,menuColor,menuItems,style}=props;const isStatic=useIsStaticRenderer();const panelRef=useRef(null);const[open,setOpen]=useState(false);const[overlay,setOverlay]=useState(false);// Panel click toggles menu\nconst handlePanelClick=useCallback(e=>{if(overlay)return;// don't toggle menu if overlay is open\nstartTransition(()=>setOpen(v=>!v));},[overlay]);// Close menu when clicking outside\nuseEffect(()=>{if(!open)return;function handleClickOutside(event){if(panelRef.current&&!panelRef.current.contains(event.target)){startTransition(()=>setOpen(false));}}document.addEventListener(\"mousedown\",handleClickOutside);return()=>document.removeEventListener(\"mousedown\",handleClickOutside);},[open]);// Open menu when reaching bottom of page\nuseEffect(()=>{if(typeof window===\"undefined\")return;function handleScroll(){const scrollY=window.scrollY||window.pageYOffset;const windowHeight=window.innerHeight;const docHeight=document.documentElement.scrollHeight;if(scrollY+windowHeight>=docHeight-2){startTransition(()=>setOpen(true));}}window.addEventListener(\"scroll\",handleScroll);return()=>window.removeEventListener(\"scroll\",handleScroll);},[]);// Overlay close handler\nconst handleOverlayClose=useCallback(()=>{startTransition(()=>setOverlay(false));},[]);// Menu item click handler\nconst handleMenuItemClick=useCallback(item=>{// No navigation logic here, handled by <a> tag\n},[]);// Glassmorphism style\nconst glassStyle={background:background,backdropFilter:`blur(${blur}px)`,WebkitBackdropFilter:`blur(${blur}px)`,borderRadius,border:`${borderWidth}px solid ${borderColor}`,boxShadow:\"0 4px 24px rgba(0,0,0,0.10)\",cursor:\"pointer\",userSelect:\"none\",transition:\"box-shadow 0.2s, min-height 0.25s cubic-bezier(0.4,0,0.2,1)\",minWidth:180,minHeight:open?48+menuItems.length*48+32:48,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",...style,position:\"relative\",overflow:\"hidden\"};// Brand text style\nconst brandStyle={color:brandColor,textAlign:\"center\",width:\"100%\",...brandFont,cursor:\"pointer\",userSelect:\"none\",letterSpacing:brandFont?.letterSpacing,lineHeight:brandFont?.lineHeight,fontSize:brandFont?.fontSize,fontWeight:brandFont?.fontWeight,fontStyle:brandFont?.fontStyle,zIndex:3,position:\"absolute\",left:0,right:0,top:0,height:48,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",background:\"transparent\",transition:\"none\",pointerEvents:\"none\"};// Menu style\nconst menuStyle={position:\"relative\",left:0,top:0,width:\"100%\",marginTop:16,background:\"transparent\",borderRadius:0,border:\"none\",boxShadow:\"none\",padding:0,display:\"flex\",flexDirection:\"column\",alignItems:\"center\",zIndex:2,backdropFilter:\"none\",WebkitBackdropFilter:\"none\",transition:\"none\"};// Menu item style\nconst menuItemStyle={color:menuColor,textAlign:\"center\",margin:\"8px 0\",width:\"100%\",cursor:\"pointer\",...menuFont,letterSpacing:menuFont?.letterSpacing,lineHeight:menuFont?.lineHeight,fontSize:menuFont?.fontSize,fontWeight:menuFont?.fontWeight,fontStyle:menuFont?.fontStyle,borderRadius:6,padding:\"8px 0\",transition:\"background 0.05s, color 0.05s\"};// Accessibility: role=\"navigation\" for menu\nreturn /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(motion.div,{ref:panelRef,style:glassStyle,tabIndex:0,\"aria-label\":\"Floating navigation panel\",onClick:handlePanelClick,animate:{minHeight:open?48+menuItems.length*48+32:48},transition:{duration:.22,ease:\"easeOut\"},children:[/*#__PURE__*/_jsx(\"span\",{style:brandStyle,children:brand}),/*#__PURE__*/_jsx(motion.div,{style:{...menuStyle,height:open?menuItems.length*48+32:0,overflow:\"hidden\",pointerEvents:open?\"auto\":\"none\",transition:\"height 0.22s cubic-bezier(0.4,0,0.2,1)\",marginTop:48},\"aria-label\":\"Main menu\",role:\"navigation\",children:menuItems.map((item,i)=>/*#__PURE__*/_jsx(motion.div,{style:menuItemStyle,whileHover:{background:\"rgba(0,0,0,0.06)\"},whileTap:{scale:.97},tabIndex:0,role:\"menuitem\",onClick:e=>{e.stopPropagation();handleMenuItemClick(item);},children:item.link?/*#__PURE__*/_jsx(\"a\",{href:item.link,style:{color:\"inherit\",textDecoration:\"none\",display:\"block\",width:\"100%\",height:\"100%\"},tabIndex:-1,\"aria-label\":item.label,children:item.label}):item.label},item.label+i))})]}),/*#__PURE__*/_jsx(AnimatePresence,{})]});}addPropertyControls(FloatingNavigation,{background:{type:ControlType.Color,title:\"Background\",defaultValue:\"rgba(255,255,255,0.32)\"},blur:{type:ControlType.Number,title:\"Blur\",defaultValue:16,min:0,max:40,step:1,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:18,min:0,max:48,step:1,unit:\"px\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"rgba(255,255,255,0.38)\"},borderWidth:{type:ControlType.Number,title:\"Border Width\",defaultValue:1,min:0,max:8,step:1,unit:\"px\"},brand:{type:ControlType.String,title:\"Brand Name\",defaultValue:\"OXIMORON\"},brandColor:{type:ControlType.Color,title:\"Brand Color\",defaultValue:\"#111111\"},brandFont:{type:ControlType.Font,title:\"Brand Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"22px\",variant:\"Bold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},menuFont:{type:ControlType.Font,title:\"Menu Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"16px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},menuColor:{type:ControlType.Color,title:\"Menu Color\",defaultValue:\"#111111\"},menuItems:{type:ControlType.Array,title:\"Menu Items\",control:{type:ControlType.Object,controls:{label:{type:ControlType.String,defaultValue:\"Home\"},link:{type:ControlType.Link,defaultValue:\"\"}}},defaultValue:[{label:\"Home\",link:\"/home\"},{label:\"Projects\",link:\"/projects\"},{label:\"About\",link:\"/about\"},{label:\"Contact\",link:\"/contact\"}],maxCount:8}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FloatingNavigation\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicWidth\":\"320\",\"framerIntrinsicHeight\":\"64\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FloatingNavigation.map"],"mappings":"kSAYG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,aAAW,OAAK,eAAa,cAAY,cAAY,QAAM,aAAW,YAAU,WAAS,YAAU,YAAU,SAAO,EAAqB,GAAqB,CAAC,IAAM,EAASA,EAAO,KAAK,CAAM,CAAC,EAAK,GAASC,EAAS,GAAM,CAAM,CAAC,EAAQ,GA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