<div class="loader" id="loader">
	<span class="loader__cow" id="cow"></span>
</div>
body {
	background: url(https://engage-codepen.s3.amazonaws.com/2016/bar-block-cow/bg.jpg) center top;
}

.loader {
	opacity: 0;
	position: absolute;
	top: 0; right: 0; bottom: 0; left: 0;

	&__cow {
		background: url(https://engage-codepen.s3.amazonaws.com/2016/bar-block-cow/preloader.png) 0 0 no-repeat;
		position: fixed;
		top: 50%; left: 50%;
		transform: translate(-50%, -50%);
		width: 400px;
		height: 260px;
	}

	.loading-animation-complete & {
		display: none;
	}
}
View Compiled
var $loader = {
	root: $('#loader'),
	cow: $('#cow')
};

var loader = {
	animation: {
		inToView: .5,
		totalTime: 3.2,
		frames: {
			total: 70,
			width: 400,
			pauseAt: 60,
			pauseFor: 1
		}
	}
};

var phase1Time = loader.animation.totalTime * (loader.animation.frames.pauseAt / loader.animation.frames.total),
	phase2Time = loader.animation.totalTime * ((loader.animation.frames.total - loader.animation.frames.pauseAt) / loader.animation.frames.total);

var moo = function(){

	TweenLite
		.set($loader.cow, {
			backgroundPosition: '0px 0px'
		});

	TweenLite
		.fromTo($loader.root, loader.animation.inToView, {
			opacity: 0,
		},{
			opacity: 1,
			ease: Cubic.easeOut,
			repeat: 1,
			onComplete: function(){

				TweenLite
					.to($loader.cow, phase1Time, {
						backgroundPosition: '-' + (loader.animation.frames.width * loader.animation.frames.pauseAt) + 'px 0px',
						ease: SteppedEase.config( loader.animation.frames.pauseAt ),
						repeat: -1,
						onComplete: function(){

							TweenLite
								.to($loader.cow, phase2Time, {
									backgroundPosition: '-' + (loader.animation.frames.width * loader.animation.frames.total) + 'px 0px',
									ease: SteppedEase.config( loader.animation.frames.total - loader.animation.frames.pauseAt ),
									delay: loader.animation.frames.pauseFor,
									repeat: -1
								});

						}
					});

			}
		});

}

$loader.root
	.imagesLoaded({
		background: true
	}, function() {
		
		moo();

		setInterval(function(){
		
			moo();

		}, 5000);

	});
Run Pen

External CSS

  1. https://fonts.googleapis.com/css?family=Open+Sans:400,600,700

External JavaScript

  1. //cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js
  2. //cdnjs.cloudflare.com/ajax/libs/gsap/1.18.2/TweenLite.min.js
  3. //cdnjs.cloudflare.com/ajax/libs/gsap/1.18.2/plugins/CSSPlugin.min.js
  4. //cdnjs.cloudflare.com/ajax/libs/gsap/1.18.2/easing/EasePack.min.js
  5. //cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/4.1.0/imagesloaded.pkgd.min.js