1jQuery.noConflict(); 2(function ($) { 3 'use strict'; 4 5 var InitWaypointAnimations = (function () { 6 function onScrollInitAnimation(items, container, options) { 7 const containerOffset = (container) ? container.attr("sa-data-animation-offset") || options.offset : null; 8 items.each(function () { 9 const element = $(this), 10 animationClass = element.attr("sa-data-animation"), 11 animationDelay = element.attr("sa-data-animation-delay") || options.delay, 12 animationDuration = element.attr("sa-data-animation-duration") || options.delay, 13 animationOffset = element.attr("sa-data-animation-offset") || options.offset; 14 15 element.css({ 16 "-webkit-animation-delay": animationDelay, 17 "-moz-animation-delay": animationDelay, 18 "animation-delay": animationDelay, 19 "animation-duration": animationDuration 20 }); 21 22 const trigger = (container) ? container : element; 23 24 trigger.waypoint(function () { 25 element 26 .addClass("animated") 27 .addClass(animationClass); 28 29 }, { 30 triggerOnce: true, 31 offset: containerOffset || animationOffset 32 }); 33 }); 34 } 35 36 function InitWaypointAnimations(defaults) { 37 if (!defaults) { 38 defaults = {}; 39 } 40 const options = { 41 offset: defaults.offset || "90%", 42 delay: defaults.delay || "0ms", 43 animateClass: defaults.animateClass || "sa-data-animation", 44 animateGroupClass: defaults.animateGroupClass || "sa-data-animation-group" 45 } 46 47 const animateGroupClassSelector = classToSelector(options.animateGroupClass); 48 const animateClassSelector = classToSelector(options.animateClass); 49 50 // Attach waypoint animations to grouped animate elements 51 $(animateGroupClassSelector).each((index, group) => { 52 const container = $(group); 53 const items = $(group).find(animateClassSelector); 54 onScrollInitAnimation(items, container, options); 55 }); 56 57 // Attach waypoint animations to ungrouped animate elements 58 $(animateClassSelector) 59 .filter((index, element) => { 60 return $(element).parents(animateGroupClassSelector).length === 0; 61 }) 62 .each((index, element) => { 63 onScrollInitAnimation($(element), null, options); 64 }); 65 } 66 67 function classToSelector(className) { 68 return "." + className; 69 } 70 71 return InitWaypointAnimations; 72 }()); 73 74 $(document).ready(function () { 75 InitWaypointAnimations(); 76 }); 77 78 $("[sa-data-animation]").each(function (index, value) { 79 if ($(this).attr('sa-data-animation') !== '') { 80 $(this).addClass('sa-data-animation'); 81 } 82 }); 83 84})(jQuery); 85
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.