{"version":3,"file":"footer-7c37f591.js","sources":["../../../../../../src/scripts/modules/footer.ts"],"sourcesContent":["import { Component } from '@verndale/core';\n\nclass Footer extends Component {\n private footerObserver: IntersectionObserver;\n\n constructor(el: HTMLElement) {\n super(el);\n this.footerObserver = new IntersectionObserver(\n (entries) => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n (this.dom.backToTopBtn as HTMLElement).classList.remove('sticky');\n } else if (window.scrollY >= 600 && !entry.isIntersecting) {\n (this.dom.backToTopBtn as HTMLElement).classList.add('sticky');\n }\n });\n }, {\n threshold: 0,\n rootMargin: '0px'\n }\n );\n\n this.footerObserver.observe(this.el);\n }\n\n setupDefaults() {\n this.dom = {\n backToTopBtn: this.el.querySelector('.footer__back-top-btn'),\n }\n }\n\n addListeners() {\n (this.dom.backToTopBtn as HTMLElement).addEventListener('click', () => {\n window.scrollTo({ top: 0, behavior: 'smooth' });\n });\n\n window.addEventListener('scroll', () => {\n if (window.scrollY <= 600) {\n (this.dom.backToTopBtn as HTMLElement).classList.add('sticky');\n } \n\n if (window.scrollY == 0) {\n (this.dom.backToTopBtn as HTMLElement).classList.remove('sticky');\n }\n });\n }\n}\n\nexport default Footer;\n"],"names":["Footer","Component","el","__publicField","entries","entry"],"mappings":"4MAEA,MAAMA,UAAeC,CAAU,CAG7B,YAAYC,EAAiB,CAC3B,MAAMA,CAAE,EAHFC,EAAA,uBAIN,KAAK,eAAiB,IAAI,qBACvBC,GAAY,CACXA,EAAQ,QAAiBC,GAAA,CACnBA,EAAM,eACP,KAAK,IAAI,aAA6B,UAAU,OAAO,QAAQ,EACvD,OAAO,SAAW,KAAO,CAACA,EAAM,gBACxC,KAAK,IAAI,aAA6B,UAAU,IAAI,QAAQ,CAC/D,CACD,CACH,EAAG,CACH,UAAW,EACX,WAAY,KACd,CAAA,EAGK,KAAA,eAAe,QAAQ,KAAK,EAAE,CACrC,CAEA,eAAgB,CACd,KAAK,IAAM,CACT,aAAc,KAAK,GAAG,cAA2B,uBAAuB,CAAA,CAE5E,CAEA,cAAe,CACZ,KAAK,IAAI,aAA6B,iBAAiB,QAAS,IAAM,CACrE,OAAO,SAAS,CAAE,IAAK,EAAG,SAAU,SAAU,CAAA,CAC/C,EAEM,OAAA,iBAAiB,SAAU,IAAM,CAClC,OAAO,SAAW,KACnB,KAAK,IAAI,aAA6B,UAAU,IAAI,QAAQ,EAG3D,OAAO,SAAW,GACnB,KAAK,IAAI,aAA6B,UAAU,OAAO,QAAQ,CAClE,CACD,CACH,CACF"}