{"version":3,"file":"588.c1a48d1838cca92e372e.js","mappings":"oMAuBCA,EAAAA,QAvBc,MACXC,WAAAA,CAAYC,GACYA,KAChB,IAAIC,EAAcC,SAASC,uBAAuB,gBAC9CC,EAAeC,OAAOC,YAE1B,MAAMC,EAAQA,KACV,IAAK,IAAIC,EAAI,EAAGA,EAAIP,EAAYQ,OAAQD,IACfP,EAAYO,GAAGE,wBACXC,IACfP,EACNH,EAAYO,GAAGI,UAAUC,IAAI,eAE7BZ,EAAYO,GAAGI,UAAUE,OAAO,cAExC,EAEJP,IACAF,OAAOU,iBAAiB,SAAUR,EAAM,EAG5CS,EACJ,E","sources":["webpack://frontendplaceholder/./Src/Scripts/components/in-viewport.js"],"sourcesContent":["export default class InViewport {\n    constructor(elem) {\n        const inViewport = (elem) => {\n            let allElements = document.getElementsByClassName(\"hero-section\");\n            let windowHeight = window.innerHeight;\n\n            const elems = () => {\n                for (let i = 0; i < allElements.length; i++) {  //  loop through the sections\n                    let viewportOffset = allElements[i].getBoundingClientRect();  //  returns the size of an element and its position relative to the viewport\n                    let top = viewportOffset.top;  //  get the offset top\n                    if (top < windowHeight) {  //  if the top offset is less than the window height\n                        allElements[i].classList.add('in-viewport');  //  add the class\n                    } else {\n                        allElements[i].classList.remove('in-viewport');  //  remove the class\n                    }\n                }\n            }\n            elems();\n            window.addEventListener('scroll', elems);\n        }\n\n        inViewport('section');  //  run the function on all section elements\n    }\n}\n"],"names":["exports","constructor","elem","allElements","document","getElementsByClassName","windowHeight","window","innerHeight","elems","i","length","getBoundingClientRect","top","classList","add","remove","addEventListener","inViewport"],"sourceRoot":""}