SUA IDEIA + CRIATIVA!

var u75666_delay = 0; u75666_delay = u75666_delay * 1000; $(document).ready(function(){ u75666_animationClass(); u75666_viewPort(); if( 'false' == 'true'){ onHover(); } }); function onHover(){ if($('.' + 'logo').hasClass != 'fadeIn'){ $('.' + 'logo').hover(function(){ console.log('test'); $('.' + 'logo').addClass('fadeIn'); }, function(){ setTimeout(function(){ console.log('leaving'); $('.' + 'logo').removeClass('fadeIn'); }, (2 * 1000) ); }); } } function u75666_animationClass(){ if( $('.' + 'logo').hasClass != 'animated' ){ $('.' + 'logo').addClass('animated'); $('.animated').css({ 'opacity': 0 }) if('playOnce' == 'loopInfinite' ){ $('.' + 'logo').addClass("infinite"); } } else{ return; } }; function u75666_viewPort(){ const $animation_elements = $('.' + 'logo'); const $window = $(window); $window.on('scroll resize', check_view); $window.trigger('scroll'); function check_view(){ var windowHeight = $window.height(); var windowTopPosition = $window.scrollTop(); var windowBottomPosition = (windowHeight + windowTopPosition); //Configure variables to get elements height + height from top of page. $.each($animation_elements, function(){ var $element = $(this); var elementHeight = $element.outerHeight(); var elementTopPosition = $element.offset().top; var elementBottomPosition = (elementTopPosition + elementHeight); //Check to see if current container is within viewport. if ((elementTopPosition <= windowBottomPosition) && (elementBottomPosition >= windowTopPosition)){ setTimeout(function(){ $element.addClass('fadeIn'); $element.css({'opacity': 1}); if( 'false' == 'true'){ $('.' + 'logo').addClass('animation-direction'); } }, u75666_delay); } else if( 'playOnce' == 'loopRepeat' ){ $element.removeClass('fadeIn'); $element.css({'opacity': 0}); }; }); }; };