{"version":3,"file":"ScrollHeader.B3CT_DLO.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/Reci18yx4MWtceO9zI3Q/uec9qm4lWJdVfANmCTls/ScrollHeader.js"],"sourcesContent":["// Framer Code Override — ScrollHeader\n// Apply this override to the Header component in the Framer UI.\n// In addition to its scroll behaviour, this override sets the html\n// element's lang attribute on mount so search engines and screen\n// readers can identify the page language. This addresses SEO audit\n// item 1.5.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";export function ScrollHeader(Component){return props=>{// 3 states: \"top\" = page top, \"down\" = scrolling down, \"up\" = scrolling up\nconst[scrollState,setScrollState]=useState(\"top\");const lastScrollY=useRef(0);// SEO 1.5: Ensure the html element declares its language.\n// Set once on mount so the attribute is in the DOM before\n// search-engine bots that execute JavaScript take their snapshot.\nuseEffect(()=>{if(typeof document!==\"undefined\"){document.documentElement.setAttribute(\"lang\",\"en\");}},[]);useEffect(()=>{const handleScroll=()=>{const currentScrollY=window.scrollY;if(currentScrollY<=10){// Page ke bilkul upar → transparent\nsetScrollState(\"top\");}else if(currentScrollY>lastScrollY.current){// Scroll DOWN → #23080A solid\nsetScrollState(\"down\");}else{// Scroll UP → #23080A semi-transparent (menu visible rahega)\nsetScrollState(\"up\");}lastScrollY.current=currentScrollY;};window.addEventListener(\"scroll\",handleScroll,{passive:true});return()=>window.removeEventListener(\"scroll\",handleScroll);},[]);const barColor=scrollState===\"top\"?\"rgba(0,0,0,0)\":\"#23080A\";const bgColor=scrollState===\"top\"?\"#0C534F\"// Page top → fully transparent\n:\"#23080A\";useEffect(()=>{document.body.style.background=bgColor;document.documentElement.style.backgroundColor=bgColor;},[bgColor]);return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,backgroundColor:barColor,backdropFilter:scrollState!==\"top\"?\"blur(8px)\":\"none\",transition:\"background-color 0.4s ease, backdrop-filter 0.4s ease\",position:\"fixed\",top:0,left:0,right:0,zIndex:9999}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"ScrollHeader\":{\"type\":\"reactHoc\",\"name\":\"ScrollHeader\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollHeader.map"],"mappings":"8IAMwF,SAAgB,EAAa,EAAU,CAAC,MAAO,IAAO,CAC9I,GAAK,CAAC,EAAY,GAAgBA,EAAS,MAAM,CAAO,EAAYC,EAAO,EAAE,CAG7E,MAAc,CAAI,OAAO,SAAW,KAAa,SAAS,gBAAgB,aAAa,OAAO,KAAK,EAAI,EAAE,CAAC,CAAC,MAAc,CAAC,IAAM,MAAiB,CAAC,IAAM,EAAe,EAAO,QAAW,GAAgB,GACzM,EAAe,MAAM,CAAU,EAAe,EAAY,QAC1D,EAAe,OAAO,CACtB,EAAe,KAAK,CAAE,EAAY,QAAQ,GAA+E,OAA9D,EAAO,iBAAiB,SAAS,EAAa,CAAC,QAAQ,GAAK,CAAC,KAAW,EAAO,oBAAoB,SAAS,EAAa,EAAG,EAAE,CAAC,CAAC,IAAM,EAAS,IAAc,MAAM,gBAAgB,UAAgB,EAAQ,IAAc,MAAM,UACzR,UAAoI,OAA1H,MAAc,CAAC,SAAS,KAAK,MAAM,WAAW,EAAQ,SAAS,gBAAgB,MAAM,gBAAgB,GAAU,CAAC,EAAQ,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,MAAM,CAAC,GAAG,EAAM,MAAM,gBAAgB,EAAS,eAAe,IAAc,MAAkB,OAAZ,YAAmB,WAAW,wDAAwD,SAAS,QAAQ,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,KAAK,CAAC,CAAC,uBARnW,IAA6C"}