{"version":3,"file":"animation.js","sources":["webpack:///./Content/Scripts/animate.ts"],"sourcesContent":["$(() => {\r\n const selector = '.fadeMeIn';\r\n\r\n animateOnScroll();\r\n animate(selector, '.animated', 'fadeIn animated');\r\n\r\n function animateOnScroll() {\r\n $(window).scroll(function () {\r\n animate(selector, '.animated', 'fadeIn animated');\r\n });\r\n }\r\n\r\n function animate(selector: string, notSelector: string, classes: string) {\r\n $(selector).not(notSelector).each(function () {\r\n if (isScrolledIntoView(this)) {\r\n $(this).addClass(classes);\r\n $(this).css({ opacity: 1 });\r\n }\r\n });\r\n }\r\n\r\n function isScrolledIntoView(elem: any) {\r\n const topOfElement = $(elem).offset().top;\r\n const bottomOfElement = $(elem).offset().top + $(elem).outerHeight();\r\n const bottomOfScreen = $(window).scrollTop() + $(window).innerHeight();\r\n const topOfScreen = $(window).scrollTop();\r\n return (bottomOfScreen > topOfElement) && (topOfScreen < bottomOfElement);\r\n }\r\n});"],"mappings":";;;;;;;;;AAAA;AACA;AAEA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;A","sourceRoot":""}