{"version":3,"file":"NavBackground.D2AsXJxp.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/iv4sBHCHWxpS4Bp67efi/MHbTlora3yerjJI92UtY/NavBackground.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Navigation Scroll Background Component\n *\n * Adds a customizable background color to the main navigation (nav tag)\n * when the user starts scrolling.\n *\n * Drag this component to your canvas to activate the scroll background effect.\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function NavigationScrollBackground(props){const{backgroundColor,scrollThreshold,showDebug}=props;const[isScrolled,setIsScrolled]=useState(false);useEffect(()=>{const handleScroll=()=>{const scrollY=window.scrollY||window.pageYOffset;const threshold=scrollThreshold||0;setIsScrolled(scrollY>threshold);};// Initial check\nhandleScroll();// Add scroll event listener\nwindow.addEventListener(\"scroll\",handleScroll,{passive:true});// Cleanup\nreturn()=>{window.removeEventListener(\"scroll\",handleScroll);};},[scrollThreshold]);useEffect(()=>{// Find the navigation element (nav tag)\nconst navElement=document.querySelector(\"nav\");if(navElement){if(isScrolled){// Apply background color when scrolled (immediate change)\nnavElement.style.backgroundColor=backgroundColor;}else{// Remove background when at top (immediate change)\nnavElement.style.backgroundColor=\"transparent\";}}// Cleanup function to reset on unmount\nreturn()=>{if(navElement){navElement.style.backgroundColor=\"\";}};},[isScrolled,backgroundColor]);// Render a minimal container (invisible but functional)\nreturn /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:showDebug&&/*#__PURE__*/_jsxs(\"div\",{style:debugStyle,children:[\"Nav Scroll Background Active\",/*#__PURE__*/_jsx(\"br\",{}),isScrolled?\"Scrolled\":\"At Top\"]})});}// --- Styles ---\nconst containerStyle={width:\"100%\",height:\"100%\",position:\"relative\",pointerEvents:\"none\",opacity:0};const debugStyle={position:\"absolute\",top:10,left:10,padding:\"8px 12px\",backgroundColor:\"rgba(0, 0, 0, 0.8)\",color:\"#fff\",fontSize:\"12px\",borderRadius:\"4px\",fontFamily:\"system-ui, sans-serif\",pointerEvents:\"none\",zIndex:9999};// --- Property Controls ---\naddPropertyControls(NavigationScrollBackground,{backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#ff0000\",description:\"Background color applied to navigation when scrolling\"},scrollThreshold:{type:ControlType.Number,title:\"Scroll Threshold\",defaultValue:0,min:0,max:500,step:1,unit:\"px\",description:\"Scroll distance in pixels before background appears\"},showDebug:{type:ControlType.Boolean,title:\"Show Debug Info\",defaultValue:false,description:\"Show debug information in preview mode\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"NavigationScrollBackground\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NavBackground.map"],"mappings":"sMAUG,SAAwB,EAA2B,EAAM,CAAC,GAAK,CAAC,kBAAgB,kBAAgB,aAAW,EAAW,CAAC,EAAW,GAAeA,EAAS,GAAM,CAQnK,OARoK,MAAc,CAAC,IAAM,MAAiB,CAAqF,GAAtE,EAAO,SAAS,EAAO,cAA4B,GAAiB,GAAkC,EAG/T,OAFA,GAAc,CACd,EAAO,iBAAiB,SAAS,EAAa,CAAC,QAAQ,GAAK,CAAC,KACnD,CAAC,EAAO,oBAAoB,SAAS,EAAa,GAAK,CAAC,EAAgB,CAAC,CAAC,MAAc,CAClG,IAAM,EAAW,SAAS,cAAc,MAAM,CAG9C,OAHkD,IAAe,EACjE,EAAW,MAAM,gBAAgB,EACjC,EAAW,MAAM,gBAAgB,mBACvB,CAAI,IAAY,EAAW,MAAM,gBAAgB,MAAQ,CAAC,EAAW,EAAgB,CAAC,CAC5E,EAAK,MAAM,CAAC,MAAM,EAAe,SAAS,GAAwB,EAAM,MAAM,CAAC,MAAM,EAAW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