{"version":3,"sources":["homepage.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"homepage.js","sourcesContent":["jQuery(document).ready(function ($) {\r\n\r\n $('.news-item, article.event').addClass('fade');\r\n\r\n window.odometerOptions = {\r\n animation: 'count'\r\n };\r\n\r\n $('.alerts .close').on('click', function () {\r\n $('.alerts').addClass('closed');\r\n });\r\n\r\n\r\n var isInViewport = function (elem) {\r\n if (elem !== null) {\r\n var bounding = elem.getBoundingClientRect();\r\n return (\r\n bounding.top >= 0 &&\r\n bounding.left >= 0 &&\r\n bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\r\n bounding.right <= (window.innerWidth || document.documentElement.clientWidth)\r\n );\r\n }\r\n };\r\n\r\n\r\n $(document, 'body').scroll(function () {\r\n var odometer = document.querySelector('.odometer');\r\n var news = document.querySelector('.featured-news > h2');\r\n var events = document.querySelector('.events-container > h2');\r\n\r\n if (isInViewport(odometer)) {\r\n $('.odometer').each(function (index) {\r\n var timeout = index * 500;\r\n $(this).delay(timeout).queue(function () { $(this).text($(this).data('number')); });\r\n });\r\n }\r\n\r\n if (isInViewport(news)) {\r\n $('.news-item').each(function (index) {\r\n var timeout = index * 250;\r\n $(this).delay(timeout).queue(function () { $(this).addClass('in'); });\r\n });\r\n }\r\n\r\n if (isInViewport(events)) {\r\n $('article.event').each(function (index) {\r\n var timeout = index * 250;\r\n $(this).delay(timeout).queue(function () { $(this).addClass('in'); });\r\n });\r\n }\r\n\r\n });\r\n\r\n $(document, 'body').scroll();\r\n});"]}