/Bulk.io/www/assets/js/animation.js

https://bitbucket.org/sylvainmichaud/trackingcargo · JavaScript · 132 lines · 33 code · 23 blank · 76 comment · 8 complexity · a2d0b4b2ca150fffc1c618b11d91788d MD5 · raw file

  1. $(function(){
  2. var ua = navigator.userAgent.toLowerCase(),
  3. isAndroid = ua.indexOf("android") > -1;
  4. // Only animate elements when using non-mobile devices
  5. if (jQuery.browser.mobile === false && !isAndroid)
  6. {
  7. /*---------------------------------------*/
  8. /* INTRO SECTION
  9. /*---------------------------------------*/
  10. /*$('#intro').find('.intro-content').css('opacity', 0).one('inview', function(isInView){
  11. if (isInView) {$(this).addClass('animated bounceIn').css('opacity', 1);}
  12. });*/
  13. /*---------------------------------------*/
  14. /* WHO WE ARE SECTION
  15. /*---------------------------------------*/
  16. $('#carousel-who-we-are').css('opacity', 0).one('inview', function(isInView){
  17. if (isInView) {$(this).addClass('animated fadeInUp delayp1').css('opacity', 1);}
  18. });
  19. $('#who-we-are').find('.who-we-are-text').css('opacity', 0).one('inview', function(isInView){
  20. if (isInView) {$(this).addClass('animated fadeInUp delayp3').css('opacity', 1);}
  21. });
  22. /*---------------------------------------*/
  23. /* OUR MAIN SKILLS SECTION
  24. /*---------------------------------------*/
  25. $('#our-main-skills').find('.bar-chart-text').css('opacity', 0).one('inview', function(isInView){
  26. if (isInView) {$(this).addClass('animated flipInX delayp1').css('opacity', 1);}
  27. });
  28. /*---------------------------------------*/
  29. /* QUOTE SECTION
  30. /*---------------------------------------*/
  31. $('#quote .quote-text').css('opacity', 0).one('inview', function(isInView){
  32. if (isInView) {$(this).addClass('animated fadeInUp delayp1').css('opacity', 1);}
  33. });
  34. /*---------------------------------------*/
  35. /* KEEP IN TOUCH SECTION
  36. /*---------------------------------------*/
  37. /*$('#keep-in-touch').find('.social-icon-item').each(function(i){
  38. var element = $(this),
  39. itemsDelay = ( isNaN($(this).data('animation-delay')) ? 50 : $(this).data('animation-delay'));
  40. element.css('opacity', 0).one('inview', function(isInView) {
  41. if (isInView){
  42. setTimeout(function(){
  43. element.addClass('animated bounceIn').css('opacity', 1);
  44. } , itemsDelay * (i * 2));
  45. }
  46. });
  47. });*/
  48. /*---------------------------------------*/
  49. /* MEET THE TEAM SECTION
  50. /*---------------------------------------*/
  51. $('#meet-the-team').find('.team-element').each(function(i){
  52. var element = $(this),
  53. itemsDelay = ( isNaN($(this).data('animation-delay')) ? 50 : $(this).data('animation-delay'));
  54. element.css('opacity', 0).one('inview', function(isInView) {
  55. if (isInView){
  56. setTimeout(function(){
  57. element.addClass('animated fadeInUp').css('opacity', 1);
  58. } , itemsDelay * (i * 2));
  59. }
  60. });
  61. });
  62. /*---------------------------------------*/
  63. /* TESTIMONIALS SECTION
  64. /*---------------------------------------*/
  65. $('#testimonials').find('.testimonial-item').css('opacity', 0).one('inview', function(isInView){
  66. if (isInView) {$(this).addClass('animated flipInY').css('opacity', 1);}
  67. })
  68. /*---------------------------------------*/
  69. /* COMING SOON SECTION
  70. /*---------------------------------------*/
  71. /*$('#coming-soon').find('.countdown-form').css('opacity', 0).one('inview', function(isInView){
  72. if (isInView) {$(this).addClass('animated fadeInUp delayp3').css('opacity', 1);}
  73. });
  74. $('#coming-soon').find('.countdown-text').css('opacity', 0).one('inview', function(isInView){
  75. if (isInView) {$(this).addClass('animated fadeInUp delayp5').css('opacity', 1);}
  76. });*/
  77. /*---------------------------------------*/
  78. /* CONTACT US SECTION
  79. /*---------------------------------------*/
  80. /*$('#contact-us').find('.contact-us-form').css('opacity', 0).one('inview', function(isInView){
  81. if (isInView) {$(this).addClass('animated fadeInUp delayp1').css('opacity', 1);}
  82. });
  83. $('#contact-us').find('.social-icon-text').css('opacity', 0).one('inview', function(isInView){
  84. if (isInView) {$(this).addClass('animated fadeInUp delayp3').css('opacity', 1);}
  85. });*/
  86. /*---------------------------------------*/
  87. /* MAP
  88. /*---------------------------------------*/
  89. /*$('#cd-google-map').css('opacity', 0).one('inview', function(isInView){
  90. if (isInView) {$(this).addClass('animated flipInX').css('opacity', 1);}
  91. });*/
  92. /*---------------------------------------*/
  93. /* FOOTER
  94. /*---------------------------------------*/
  95. /*$('#footer').find('.footer-column').each(function(i){
  96. var element = $(this),
  97. itemsDelay = ( isNaN($(this).data('animation-delay')) ? 50 : $(this).data('animation-delay'));
  98. element.css('opacity', 0).one('inview', function(isInView) {
  99. if (isInView){
  100. setTimeout(function(){
  101. element.addClass('animated fadeInUp').css('opacity', 1);
  102. } , itemsDelay * (i * 2));
  103. }
  104. });
  105. });*/
  106. }
  107. });