{"version":3,"file":"StickyNav.C5PRgxFC.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/jeWyEJisEt6Njc3XUwwQ/t9NUAorlGj7Zlw5JPD43/StickyNav.js"],"sourcesContent":["// Sticky navigation bar with scroll-based background opacity\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function StickyNav(props){const{logoText=\"Logo\",logoUrl=\"/\",links=[{label:\"Home\",url:\"#\"},{label:\"About\",url:\"#\"},{label:\"Services\",url:\"#\"},{label:\"Contact\",url:\"#\"}],backgroundColor=\"#FFFFFF\",textColor=\"#000000\",hoverColor=\"#0099FF\",logoFont,linkFont,blur=false,scrollProgression=200,mobileBreakpoint=768,hamburgerBarWidth=24,hamburgerBarHeight=2,hamburgerBarGap=4,hamburgerColor=textColor,overlayBackgroundColor=\"#FFFFFF\"}=props;const[scrollProgress,setScrollProgress]=useState(1);const[isVisible,setIsVisible]=useState(true);const[lastScrollY,setLastScrollY]=useState(0);const[isMobileMenuOpen,setIsMobileMenuOpen]=useState(false);const[isMobile,setIsMobile]=useState(false);useEffect(()=>{if(typeof window===\"undefined\")return;const handleScroll=()=>{const scrollY=window.scrollY;const maxScroll=scrollProgression;const progress=Math.min(scrollY/maxScroll,1);startTransition(()=>{setScrollProgress(progress);// Show nav when scrolling up, hide when scrolling down\nif(scrollY<lastScrollY||scrollY<10){setIsVisible(true);}else if(scrollY>lastScrollY&&scrollY>10){setIsVisible(false);}setLastScrollY(scrollY);});};window.addEventListener(\"scroll\",handleScroll);handleScroll();return()=>window.removeEventListener(\"scroll\",handleScroll);},[scrollProgression,lastScrollY]);useEffect(()=>{if(typeof window===\"undefined\")return;const handleResize=()=>{startTransition(()=>{setIsMobile(window.innerWidth<mobileBreakpoint);if(window.innerWidth>=mobileBreakpoint){setIsMobileMenuOpen(false);}});};handleResize();window.addEventListener(\"resize\",handleResize);return()=>window.removeEventListener(\"resize\",handleResize);},[mobileBreakpoint]);const getBackgroundWithOpacity=()=>{if(backgroundColor.startsWith(\"#\")){const r=parseInt(backgroundColor.slice(1,3),16);const g=parseInt(backgroundColor.slice(3,5),16);const b=parseInt(backgroundColor.slice(5,7),16);return`rgba(${r}, ${g}, ${b}, ${scrollProgress})`;}if(backgroundColor.startsWith(\"rgba\")){return backgroundColor.replace(/[\\d.]+\\)$/,`${scrollProgress})`);}return backgroundColor;};const toggleMobileMenu=()=>{startTransition(()=>{setIsMobileMenuOpen(!isMobileMenuOpen);});};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(\"nav\",{style:{position:\"relative\",width:\"100%\",height:\"auto\",backgroundColor:\"transparent\",backdropFilter:blur?\"blur(10px)\":\"none\",WebkitBackdropFilter:blur?\"blur(10px)\":\"none\",padding:\"16px 24px\",display:\"flex\",flexDirection:\"row\",alignItems:\"center\",justifyContent:\"space-between\",gap:24,transition:\"background-color 0.2s ease, transform 0.3s ease\",transform:isVisible?\"translateY(0)\":\"translateY(-100%)\",zIndex:1,...props.style},children:[/*#__PURE__*/_jsx(\"a\",{href:logoUrl,style:{textDecoration:\"none\"},children:/*#__PURE__*/_jsx(\"span\",{style:{...logoFont,color:textColor},children:logoText})}),/*#__PURE__*/_jsx(\"div\",{style:{display:isMobile?\"none\":\"flex\",gap:24},children:links.map((link,index)=>/*#__PURE__*/_jsx(\"a\",{href:link.url,target:link.target||\"_self\",rel:link.target===\"_blank\"?\"noopener noreferrer\":undefined,style:{...linkFont,color:textColor,textDecoration:\"none\",transition:\"color 0.2s ease\"},onMouseEnter:e=>{e.currentTarget.style.color=hoverColor;},onMouseLeave:e=>{e.currentTarget.style.color=textColor;},children:link.label},index))}),isMobile&&/*#__PURE__*/_jsxs(\"button\",{onClick:toggleMobileMenu,style:{background:\"none\",border:\"none\",cursor:\"pointer\",padding:8,display:\"flex\",flexDirection:\"column\",gap:hamburgerBarGap,zIndex:1001},\"aria-label\":\"Toggle menu\",children:[/*#__PURE__*/_jsx(\"span\",{style:{width:hamburgerBarWidth,height:hamburgerBarHeight,backgroundColor:hamburgerColor,transition:\"transform 0.3s ease, opacity 0.3s ease\",transform:isMobileMenuOpen?`rotate(45deg) translateY(${hamburgerBarGap+hamburgerBarHeight}px)`:\"none\"}}),/*#__PURE__*/_jsx(\"span\",{style:{width:hamburgerBarWidth,height:hamburgerBarHeight,backgroundColor:hamburgerColor,transition:\"opacity 0.3s ease\",opacity:isMobileMenuOpen?0:1}}),/*#__PURE__*/_jsx(\"span\",{style:{width:hamburgerBarWidth,height:hamburgerBarHeight,backgroundColor:hamburgerColor,transition:\"transform 0.3s ease, opacity 0.3s ease\",transform:isMobileMenuOpen?`rotate(-45deg) translateY(-${hamburgerBarGap+hamburgerBarHeight}px)`:\"none\"}})]})]}),isMobile&&/*#__PURE__*/_jsx(\"div\",{onClick:toggleMobileMenu,style:{position:\"fixed\",top:0,left:0,width:\"100%\",height:\"100vh\",backgroundColor:blur?`${overlayBackgroundColor}F5`:overlayBackgroundColor,backdropFilter:blur?\"blur(10px)\":\"none\",WebkitBackdropFilter:blur?\"blur(10px)\":\"none\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",gap:32,zIndex:1e3,transition:\"opacity 0.3s ease, visibility 0.3s ease\",opacity:isMobileMenuOpen?1:0,visibility:isMobileMenuOpen?\"visible\":\"hidden\",pointerEvents:isMobileMenuOpen?\"auto\":\"none\"},children:links.map((link,index)=>/*#__PURE__*/_jsx(\"a\",{href:link.url,target:link.target||\"_self\",rel:link.target===\"_blank\"?\"noopener noreferrer\":undefined,onClick:e=>{e.stopPropagation();setIsMobileMenuOpen(false);},style:{...linkFont,fontSize:\"24px\",color:textColor,textDecoration:\"none\",transition:\"color 0.2s ease\"},onMouseEnter:e=>{e.currentTarget.style.color=hoverColor;},onMouseLeave:e=>{e.currentTarget.style.color=textColor;},children:link.label},index))})]});}addPropertyControls(StickyNav,{logoText:{type:ControlType.String,title:\"Logo Text\",defaultValue:\"Logo\"},logoUrl:{type:ControlType.String,title:\"Logo URL\",defaultValue:\"/\"},logoFont:{type:ControlType.Font,title:\"Logo Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Bold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},links:{type:ControlType.Array,title:\"Links\",control:{type:ControlType.Object,controls:{label:{type:ControlType.String,defaultValue:\"Link\"},url:{type:ControlType.String,defaultValue:\"#\"},target:{type:ControlType.Enum,title:\"Target\",options:[\"_self\",\"_blank\"],optionTitles:[\"Same Tab\",\"New Tab\"],defaultValue:\"_self\"}}},defaultValue:[{label:\"Home\",url:\"#\",target:\"_self\"},{label:\"About\",url:\"#\",target:\"_self\"},{label:\"Services\",url:\"#\",target:\"_self\"},{label:\"Contact\",url:\"#\",target:\"_self\"}]},linkFont:{type:ControlType.Font,title:\"Link Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},hoverColor:{type:ControlType.Color,title:\"Hover Color\",defaultValue:\"#0099FF\"},blur:{type:ControlType.Boolean,title:\"Blur Effect\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},scrollProgression:{type:ControlType.Number,title:\"Scroll Distance\",defaultValue:200,min:50,max:500,step:10,unit:\"px\"},mobileBreakpoint:{type:ControlType.Number,title:\"Mobile Breakpoint\",defaultValue:768,min:320,max:1024,step:1,unit:\"px\"},hamburgerBarWidth:{type:ControlType.Number,title:\"Hamburger Width\",defaultValue:24,min:16,max:40,step:1,unit:\"px\"},hamburgerBarHeight:{type:ControlType.Number,title:\"Hamburger Bar Height\",defaultValue:2,min:1,max:6,step:.5,unit:\"px\"},hamburgerBarGap:{type:ControlType.Number,title:\"Hamburger Bar Gap\",defaultValue:4,min:2,max:8,step:1,unit:\"px\"},hamburgerColor:{type:ControlType.Color,title:\"Hamburger Color\",defaultValue:\"#000000\"},overlayBackgroundColor:{type:ControlType.Color,title:\"Overlay Background\",defaultValue:\"#FFFFFF\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StickyNav\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StickyNav.map"],"mappings":"oNAIG,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,WAAS,OAAO,UAAQ,IAAI,QAAM,CAAC,CAAC,MAAM,OAAO,IAAI,IAAI,CAAC,CAAC,MAAM,QAAQ,IAAI,IAAI,CAAC,CAAC,MAAM,WAAW,IAAI,IAAI,CAAC,CAAC,MAAM,UAAU,IAAI,IAAI,CAAC,CAAC,kBAAgB,UAAU,YAAU,UAAU,aAAW,UAAU,WAAS,WAAS,OAAK,GAAM,oBAAkB,IAAI,mBAAiB,IAAI,oBAAkB,GAAG,qBAAmB,EAAE,kBAAgB,EAAE,iBAAe,EAAU,yBAAuB,WAAW,EAAW,CAAC,EAAe,GAAmBA,EAAS,EAAE,CAAM,CAAC,EAAU,GAAcA,EAAS,GAAK,CAAM,CAAC,EAAY,GAAgBA,EAAS,EAAE,CAAM,CAAC,EAAiB,GAAqBA,EAAS,GAAM,CAAM,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAC,MAAc,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,MAAiB,CAAC,IAAM,EAAQ,EAAO,QAAc,EAAU,EAAwB,EAAS,KAAK,IAAI,EAAQ,EAAU,EAAE,C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