{"version":3,"file":"MobileMenuOverlay_1.Bdp0Q_xd.mjs","names":["useState","useRef","useCallback","_Fragment"],"sources":["https:/framerusercontent.com/modules/lP868xWIxLIQruGrSu5i/vo9aodvNGnViFVqTZBZs/MobileMenuOverlay_1.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect,useRef,useCallback}from\"react\";export default function MobileMenuOverlay({logoImage,logoHref=\"/\",logoText=\"SB\",logoCrop=\"cover\",logoPosition=\"center center\",navLinks=[{label:\"Home\",href:\"/\"},{label:\"Projects\",href:\"/ux\"},{label:\"About\",href:\"/about-me\"}],bgColor=\"rgba(255,255,255,0.95)\",menuBgColor=\"#fafafa\",textColor=\"#121111\",dimOpacity=.4,hideOnScroll=true}){const[isOpen,setIsOpen]=useState(false);const[navVisible,setNavVisible]=useState(true);const isOpenRef=useRef(false);const lastDirectionChangeY=useRef(0);const lastDirection=useRef(null);const prevScrollY=useRef(0);useEffect(()=>{isOpenRef.current=isOpen;},[isOpen]);useEffect(()=>{if(!hideOnScroll){setNavVisible(true);return;}lastDirectionChangeY.current=window.scrollY;prevScrollY.current=window.scrollY;const handleScroll=()=>{const currentY=window.scrollY;// Always show at top\nif(currentY<10){setNavVisible(true);lastDirection.current=null;lastDirectionChangeY.current=currentY;prevScrollY.current=currentY;return;}// Determine instant direction\nconst delta=currentY-prevScrollY.current;prevScrollY.current=currentY;if(delta===0)return;const dir=delta>0?\"down\":\"up\";// Direction changed — record where the turn happened\nif(dir!==lastDirection.current){lastDirectionChangeY.current=currentY;lastDirection.current=dir;}// How far have we scrolled since the direction changed?\nconst distance=Math.abs(currentY-lastDirectionChangeY.current);if(dir===\"down\"&&distance>30){if(!isOpenRef.current)setNavVisible(false);}else if(dir===\"up\"&&distance>10){setNavVisible(true);}};window.addEventListener(\"scroll\",handleScroll,{passive:true});return()=>window.removeEventListener(\"scroll\",handleScroll);},[hideOnScroll]);useEffect(()=>{if(isOpen){setNavVisible(true);const scrollY=window.scrollY;document.body.style.position=\"fixed\";document.body.style.top=`-${scrollY}px`;document.body.style.width=\"100%\";document.body.style.overflow=\"hidden\";}else{if(document.body.style.position===\"fixed\"){const savedScroll=parseInt(document.body.style.top||\"0\",10)*-1;document.body.style.position=\"\";document.body.style.top=\"\";document.body.style.width=\"\";document.body.style.overflow=\"\";window.scrollTo({top:savedScroll,behavior:\"instant\"});prevScrollY.current=savedScroll;lastDirectionChangeY.current=savedScroll;lastDirection.current=null;}}return()=>{document.body.style.position=\"\";document.body.style.top=\"\";document.body.style.width=\"\";document.body.style.overflow=\"\";};},[isOpen]);const toggle=()=>setIsOpen(v=>!v);const handleLinkClick=useCallback(()=>setIsOpen(false),[]);const TRANSITION=\"0.32s cubic-bezier(0.22, 1, 0.36, 1)\";const objectFitMap={fill:\"fill\",fit:\"contain\",cover:\"cover\"};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(\"div\",{style:{position:\"sticky\",top:0,left:0,width:\"100%\",zIndex:200,background:bgColor,backdropFilter:\"blur(12px)\",WebkitBackdropFilter:\"blur(12px)\",boxSizing:\"border-box\",transform:navVisible?\"translateY(0)\":\"translateY(-100%)\",transition:`transform 0.35s cubic-bezier(0.22, 1, 0.36, 1)`},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",padding:\"16px 24px\",height:\"64px\",boxSizing:\"border-box\"},children:[/*#__PURE__*/_jsx(\"a\",{href:logoHref,\"aria-label\":\"Go to home\",onClick:handleLinkClick,style:{textDecoration:\"none\",display:\"flex\",alignItems:\"center\",padding:0,margin:0},children:logoImage?/*#__PURE__*/_jsx(\"img\",{src:logoImage,alt:\"Logo\",style:{height:\"32px\",width:\"auto\",display:\"block\",objectFit:objectFitMap[logoCrop]||\"cover\",objectPosition:logoPosition}}):/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:\"'Inter Display','Inter',system-ui,sans-serif\",fontWeight:600,fontSize:\"16px\",letterSpacing:\"-0.5px\",color:textColor,textDecoration:\"none\"},children:logoText})}),/*#__PURE__*/_jsxs(\"button\",{onClick:toggle,\"aria-label\":isOpen?\"Close menu\":\"Open menu\",\"aria-expanded\":isOpen,style:{background:\"none\",border:\"none\",cursor:\"pointer\",padding:\"8px\",margin:\"-8px\",display:\"flex\",flexDirection:\"column\",justifyContent:\"center\",alignItems:\"center\",width:\"40px\",height:\"40px\",position:\"relative\"},children:[/*#__PURE__*/_jsx(\"span\",{style:{display:\"block\",width:\"20px\",height:\"2px\",background:textColor,borderRadius:\"1px\",position:\"absolute\",transformOrigin:\"center\",transform:isOpen?\"translateY(0px) rotate(45deg)\":\"translateY(-5px) rotate(0deg)\",transition:TRANSITION}}),/*#__PURE__*/_jsx(\"span\",{style:{display:\"block\",width:\"20px\",height:\"2px\",background:textColor,borderRadius:\"1px\",position:\"absolute\",transformOrigin:\"center\",transform:isOpen?\"translateY(0px) rotate(-45deg)\":\"translateY(5px) rotate(0deg)\",transition:TRANSITION}})]})]}),/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:\"100%\",left:0,width:\"100%\",background:menuBgColor,overflow:\"hidden\",maxHeight:isOpen?\"480px\":\"0px\",opacity:isOpen?1:0,transition:`max-height ${TRANSITION}, opacity 0.22s ease`,boxShadow:isOpen?\"0 8px 24px rgba(0,0,0,0.08)\":\"none\",zIndex:201},children:/*#__PURE__*/_jsx(\"nav\",{style:{display:\"flex\",flexDirection:\"column\",padding:\"8px 24px 32px\",gap:\"4px\"},children:navLinks.map((link,i)=>/*#__PURE__*/_jsx(\"a\",{href:link.href,onClick:handleLinkClick,style:{fontFamily:\"'Inter Display','Inter',system-ui,sans-serif\",fontWeight:500,fontSize:\"22px\",lineHeight:\"1.2\",letterSpacing:\"-0.5px\",color:textColor,textDecoration:\"none\",padding:\"14px 0\",borderBottom:i<navLinks.length-1?\"1px solid rgba(0,0,0,0.06)\":\"none\",display:\"block\",width:\"100%\",textAlign:\"left\",cursor:\"pointer\",transform:isOpen?\"translateY(0)\":\"translateY(-8px)\",transition:`transform ${TRANSITION} ${i*40}ms, opacity ${TRANSITION} ${i*40}ms`,opacity:isOpen?1:0},children:link.label},i))})})]}),/*#__PURE__*/_jsx(\"div\",{onClick:()=>setIsOpen(false),style:{position:\"fixed\",inset:0,background:`rgba(0,0,0,${dimOpacity})`,zIndex:199,opacity:isOpen?1:0,pointerEvents:isOpen?\"auto\":\"none\",transition:`opacity 0.28s ease`},\"aria-hidden\":\"true\"})]});}addPropertyControls(MobileMenuOverlay,{logoImage:{type:ControlType.Image,title:\"Logo Image\"},logoHref:{type:ControlType.String,title:\"Logo Link\",defaultValue:\"/\"},logoText:{type:ControlType.String,title:\"Logo Text\",description:\"Shown if no Logo Image is set\",defaultValue:\"SB\"},logoCrop:{type:ControlType.Enum,title:\"Logo Crop\",options:[\"fill\",\"fit\",\"cover\"],optionTitles:[\"Fill\",\"Fit\",\"Cover\"],defaultValue:\"cover\"},logoPosition:{type:ControlType.String,title:\"Logo Position\",description:\"CSS object-position (e.g. 'center center', 'left top', '50% 20%')\",defaultValue:\"center center\"},navLinks:{type:ControlType.Array,title:\"Nav Links\",control:{type:ControlType.Object,controls:{label:{type:ControlType.String,title:\"Label\"},href:{type:ControlType.String,title:\"Href\"}}},defaultValue:[{label:\"Home\",href:\"/\"},{label:\"Projects\",href:\"/ux\"},{label:\"About\",href:\"/about-me\"}]},bgColor:{type:ControlType.Color,title:\"Nav BG\",defaultValue:\"rgba(255,255,255,0.95)\"},menuBgColor:{type:ControlType.Color,title:\"Menu BG\",defaultValue:\"#fafafa\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#121111\"},dimOpacity:{type:ControlType.Number,title:\"Dim Opacity\",defaultValue:.4,min:0,max:1,step:.05,displayStepper:true},hideOnScroll:{type:ControlType.Boolean,title:\"Hide on Scroll\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"MobileMenuOverlay\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./MobileMenuOverlay_1.map"],"mappings":"sNAA4L,SAAwB,EAAkB,CAAC,YAAU,WAAS,IAAI,WAAS,KAAK,WAAS,QAAQ,eAAa,gBAAgB,WAAS,CAAC,CAAC,MAAM,OAAO,KAAK,IAAI,CAAC,CAAC,MAAM,WAAW,KAAK,MAAM,CAAC,CAAC,MAAM,QAAQ,KAAK,YAAY,CAAC,CAAC,UAAQ,yBAAyB,cAAY,UAAU,YAAU,UAAU,aAAW,GAAG,eAAa,IAAM,CAAC,GAAK,CAAC,EAAO,GAAWA,EAAS,GAAM,CAAM,CAAC,EAAW,GAAeA,EAAS,GAAK,CAAO,EAAUC,EAAO,GAAM,CAAO,EAAqBA,EAAO,EAAE,CAAO,EAAcA,EAAO,KAAK,CAAO,EAAYA,EAAO,EAAE,CAAC,MAAc,CAAC,EAAU,QAAQ,GAAS,CAAC,EAAO,CAAC,CAAC,MAAc,CAAC,GAAG,CAAC,EAAa,CAAC,EAAc,GAAK,CAAC,OAAQ,EAAqB,QAAQ,EAAO,QAAQ,EAAY,QAAQ,EAAO,QAAQ,IAAM,MAAiB,CAAC,IAAM,EAAS,EAAO,QAC98B,GAAG,EAAS,GAAG,CAAC,EAAc,GAAK,CAAC,EAAc,QAAQ,KAAK,EAAqB,QAAQ,EAAS,EAAY,QAAQ,EAAS,OAClI,IAAM,EAAM,EAAS,EAAY,QAAqC,GAA7B,EAAY,QAAQ,EAAY,IAAQ,EAAE,OAAO,IAAM,EAAI,EAAM,EAAE,OAAO,KAChH,IAAM,EAAc,UAAS,EAAqB,QAAQ,EAAS,EAAc,QAAQ,GAC5F,IAAM,EAAS,KAAK,IAAI,EAAS,EAAqB,QAAQ,CAAI,IAAM,QAAQ,EAAS,GAAQ,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