{"version":3,"sources":["components/our-team/our-team.js"],"names":["counters","document","querySelectorAll","forEach","counter","updateCount","target","parseInt","getAttribute","count","innerText","countSpeed","isNaN","countIncrement","setTimeout","isInViewport","elem","distance","getBoundingClientRect","top","left","bottom","window","innerHeight","documentElement","clientHeight","right","innerWidth","clientWidth","addEventListener"],"mappings":"aAAA,KAAMA,CAAAA,QAAQ,CAAGC,QAAQ,CAACC,gBAAT,CAA0B,uBAA1B,CAAjB,CAEAF,QAAQ,CAACG,OAAT,CAAkBC,OAAD,EAAa,CAC1B,KAAMC,CAAAA,WAAW,CAAG,IAAM,CACtB,KAAMC,CAAAA,MAAM,CAAGC,QAAQ,CAACH,OAAO,CAACI,YAAR,CAAqB,qBAArB,CAAD,CAAvB,CACA,KAAMC,CAAAA,KAAK,CAAGF,QAAQ,CAACH,OAAO,CAACM,SAAT,CAAtB,CAEA,GAAIC,CAAAA,UAAU,CAAGJ,QAAQ,CAACH,OAAO,CAACI,YAAR,CAAqB,oBAArB,CAAD,CAAzB,CACA,GAAII,KAAK,CAACD,UAAD,CAAT,CAAuB,CACnBA,UAAU,CAAG,GAChB,CAED,GAAIE,CAAAA,cAAc,CAAGN,QAAQ,CAACH,OAAO,CAACI,YAAR,CAAqB,wBAArB,CAAD,CAA7B,CACA,GAAII,KAAK,CAACC,cAAD,CAAT,CAA2B,CACvBA,cAAc,CAAG,CACpB,CAED,GAAIJ,KAAK,CAAGH,MAAZ,CAAoB,CAChBF,OAAO,CAACM,SAAR,CAAoBD,KAAK,CAAGI,cAA5B,CACAC,UAAU,CAACT,WAAD,CAAcM,UAAd,CACb,CAHD,IAGO,CACHP,OAAO,CAACM,SAAR,CAAoBJ,MACvB,CACJ,CApBD,CAsBA,KAAMS,CAAAA,YAAY,CAAG,SAAUC,IAAV,CAAgB,CACjC,GAAIC,CAAAA,QAAQ,CAAGD,IAAI,CAACE,qBAAL,EAAf,CACA,MACID,CAAAA,QAAQ,CAACE,GAAT,EAAgB,CAAhB,EACAF,QAAQ,CAACG,IAAT,EAAiB,CADjB,EAEAH,QAAQ,CAACI,MAAT,GAAoBC,MAAM,CAACC,WAAP,EAAsBtB,QAAQ,CAACuB,eAAT,CAAyBC,YAAnE,CAFA,EAGAR,QAAQ,CAACS,KAAT,GAAmBJ,MAAM,CAACK,UAAP,EAAqB1B,QAAQ,CAACuB,eAAT,CAAyBI,WAAjE,CAEP,CARD,CAUAN,MAAM,CAACO,gBAAP,CAAwB,QAAxB,CAAkC,UAAY,CAC1C,GAAId,YAAY,CAACX,OAAD,CAAhB,CAA2B,CACvBC,WAAW,EACd,CACJ,CAJD,CAIG,KAJH,EAMA,GAAIU,YAAY,CAACX,OAAD,CAAhB,CAA2B,CACvBC,WAAW,EACd,EAEJ,CA3CD","sourcesContent":["const counters = document.querySelectorAll('[data-counter-target]');\r\n\r\ncounters.forEach((counter) => {\r\n const updateCount = () => {\r\n const target = parseInt(counter.getAttribute('data-counter-target'));\r\n const count = parseInt(counter.innerText);\r\n\r\n let countSpeed = parseInt(counter.getAttribute('data-counter-speed'));\r\n if (isNaN(countSpeed)) {\r\n countSpeed = 500;\r\n }\r\n\r\n let countIncrement = parseInt(counter.getAttribute('data-counter-increment'));\r\n if (isNaN(countIncrement)) {\r\n countIncrement = 1;\r\n }\r\n\r\n if (count < target) {\r\n counter.innerText = count + countIncrement;\r\n setTimeout(updateCount, countSpeed);\r\n } else {\r\n counter.innerText = target;\r\n }\r\n };\r\n\r\n const isInViewport = function (elem) {\r\n let distance = elem.getBoundingClientRect();\r\n return (\r\n distance.top >= 0 &&\r\n distance.left >= 0 &&\r\n distance.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\r\n distance.right <= (window.innerWidth || document.documentElement.clientWidth)\r\n );\r\n };\r\n\r\n window.addEventListener('scroll', function () {\r\n if (isInViewport(counter)) {\r\n updateCount();\r\n }\r\n }, false);\r\n\r\n if (isInViewport(counter)) {\r\n updateCount();\r\n };\r\n\r\n});"],"file":"our-team.min.js"}