1// Animations v1.4, Copyright 2014, Joe Mottershaw, https://github.com/joemottershaw/ 2// ================================================================================== 3 4 // Animate 5 function animateElement() { 6 if (jQuery(window).width() >= 960) { 7 jQuery('.animate').each(function(i, elem) { 8 var elem = jQuery(elem), 9 type = jQuery(this).attr('data-anim-type'), 10 delay = jQuery(this).attr('data-anim-delay'); 11 12 if (elem.visible(true)) { 13 setTimeout(function() { 14 elem.addClass(type); 15 }, delay); 16 } 17 }); 18 } else { 19 jQuery('.animate').each(function(i, elem) { 20 var elem = jQuery(elem), 21 type = jQuery(this).attr('data-anim-type'), 22 delay = jQuery(this).attr('data-anim-delay'); 23 24 setTimeout(function() { 25 elem.addClass(type); 26 }, delay); 27 }); 28 } 29 } 30 31 jQuery(document).ready(function() { 32 if (jQuery('html').hasClass('no-js')) 33 jQuery('html').removeClass('no-js').addClass('js'); 34 35 animateElement(); 36 }); 37 38 jQuery(window).resize(function() { 39 animateElement(); 40 }); 41 42 jQuery(window).scroll(function() { 43 animateElement(); 44 45 if (jQuery(window).scrollTop() + jQuery(window).height() == jQuery(document).height()) 46 animateElement(); 47 }); 48 49 // Triggers 50 function randomClass() { 51 var random = Math.ceil(Math.random() * classAmount) 52 53 return classesArray[random]; 54 } 55 56 function animateOnce(target, type) { 57 if (type == 'random') 58 type = randomClass(); 59 60 jQuery(target).removeClass('trigger infinite ' + triggerClasses).addClass('trigger').addClass(type).one('webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend', function() { 61 jQuery(this).removeClass('trigger infinite ' + triggerClasses); 62 }); 63 } 64 65 function animateInfinite(target, type) { 66 if (type == 'random') 67 type = randomClass(); 68 69 jQuery(target).removeClass('trigger infinite ' + triggerClasses).addClass('trigger infinite').addClass(type).one('webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend', function() { 70 jQuery(this).removeClass('trigger infinite ' + triggerClasses); 71 }); 72 } 73 74 function animateEnd(target) { 75 jQuery(target).removeClass('trigger infinite ' + triggerClasses); 76 } 77 78 // Variables 79 var triggerClasses = 'flash strobe shakeH shakeV bounce tada wave spinCW spinCCW slingshotCW slingshotCCW wobble pulse pulsate heartbeat panic', 80 classesArray = new Array, 81 classesArray = triggerClasses.split(' '), 82 classAmount = classesArray.length;
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.