{"version":3,"file":"scrollFader.component.bundle.js","sources":["../../../../Frontend/js/components/scrollFader.component.ts"],"sourcesContent":["import { debounce } from \"../../utils/debounce.util\"\r\n\r\nexport const setupScrollFader = (): void => {\r\n const scrollIndicator = document.querySelector(\"#scroll-indicator\")\r\n if (!scrollIndicator) {\r\n return\r\n }\r\n\r\n const debounceDelay = 50\r\n\r\n window.addEventListener(\r\n \"scroll\",\r\n debounce(() => fadeIndicator(scrollIndicator), debounceDelay)\r\n )\r\n window.addEventListener(\r\n \"resize\",\r\n debounce(() => fadeIndicator(scrollIndicator), debounceDelay)\r\n )\r\n fadeIndicator(scrollIndicator) // Initial call to set the position\r\n}\r\n\r\nconst fadeIndicator = (scrollIndicator: HTMLElement): void => {\r\n if (window.scrollY * 4 > scrollIndicator.getBoundingClientRect().top) {\r\n scrollIndicator.classList.add(\"faded\")\r\n } else {\r\n scrollIndicator.classList.remove(\"faded\")\r\n }\r\n}\r\n"],"names":["setupScrollFader","scrollIndicator","debounceDelay","debounce","fadeIndicator"],"mappings":"4DAEO,MAAMA,EAAmB,IAAY,CACpC,MAAAC,EAAkB,SAAS,cAA2B,mBAAmB,EAC/E,GAAI,CAACA,EACH,OAGF,MAAMC,EAAgB,GAEf,OAAA,iBACL,SACAC,EAAS,IAAMC,EAAcH,CAAe,EAAGC,CAAa,CAC9D,EACO,OAAA,iBACL,SACAC,EAAS,IAAMC,EAAcH,CAAe,EAAGC,CAAa,CAC9D,EACAE,EAAcH,CAAe,CAC/B,EAEMG,EAAiBH,GAAuC,CACxD,OAAO,QAAU,EAAIA,EAAgB,wBAAwB,IAC/CA,EAAA,UAAU,IAAI,OAAO,EAErBA,EAAA,UAAU,OAAO,OAAO,CAE5C"}