cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <div class="ajax-loader">
	<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 300 111">
		
		<g transform="translate(20 0)">
			<path class="wheel" d="M220.61,0a55,55,0,1,0,55,55A55.05,55.05,0,0,0,220.61,0ZM213.3,96.26a42.07,42.07,0,0,0,4.46.56l-0.25,3.56a45.63,45.63,0,0,1-4.86-.6Zm-17.19-3a45.69,45.69,0,0,1-4-2.89l2.28-2.77A42.26,42.26,0,0,0,198,90.23ZM176.58,66.17a45.34,45.34,0,0,1-.93-4.8l3.51-.46a41.53,41.53,0,0,0,.87,4.36Zm5-26.15a41.67,41.67,0,0,0-1.39,4.25l-3.42-.88a45.24,45.24,0,0,1,1.52-4.67Zm-0.86,36.71a45.57,45.57,0,0,1-2.11-4.43L181.9,71a41.82,41.82,0,0,0,1.92,4Zm31.66-62.67A41.89,41.89,0,0,0,208,15.17l-1.15-3.4a45.34,45.34,0,0,1,4.77-1.23Zm10.42-.76c-0.71,0-1.4-.05-2.15-0.05s-1.54,0-2.32.05L218.1,9.7c0.85-.06,1.75-0.07,2.54-0.07s1.59,0,2.37.09Zm6.61-2.85a45.14,45.14,0,0,1,4.77,1.21l-1.11,3.44A41.5,41.5,0,0,0,228.74,14Zm20.45,9.81a45.75,45.75,0,0,1,3.59,3.36l-2.6,2.46A42.22,42.22,0,0,0,247.58,23Zm-6.38,69.83a41.88,41.88,0,0,0,3.62-2.63l2.28,2.73a45.93,45.93,0,0,1-4,2.9ZM224,100.34l-0.23-3.56a42.22,42.22,0,0,0,4.4-.56l0.7,3.5A45.54,45.54,0,0,1,224,100.34ZM194.64,71.89l14.83-6.63a8.1,8.1,0,0,1,10.23,5.19l0.08,0.27,2.13,15.22c-0.42,0-.85,0-1.27,0h-0.83A30.9,30.9,0,0,1,194.64,71.89Zm-1-48.8a42.18,42.18,0,0,0-3.25,3.06l-2.61-2.44a45.53,45.53,0,0,1,3.58-3.37Zm38,24.25A22.85,22.85,0,0,1,233,42.43l6.36-11.94A30.87,30.87,0,0,1,251.54,55v0c0,1-.07,2-0.16,3L236.9,54.92a7.25,7.25,0,0,1-5.35-7C231.55,47.74,231.56,47.54,231.58,47.34ZM224,55.06a3.39,3.39,0,1,1-3.39-3.39A3.39,3.39,0,0,1,224,55.06Zm-34.34,0a30.8,30.8,0,0,1,7.74-20.45l10.13,11.28a12.56,12.56,0,0,1,2,2.92,7.18,7.18,0,0,1,.61,3.05,8.57,8.57,0,0,1-.82,3.93,7,7,0,0,1-2.89,2.91l-14.78,7.19a30.86,30.86,0,0,1-2-10.82h0ZM227,70.14q0-.27,0-0.53a7,7,0,0,1,2.49-5.22,8.82,8.82,0,0,1,5.78-2.19l0.84,0.11c2.84,0.41,11.13,1.83,13.9,2.31a31,31,0,0,1-21.43,20.3Zm15.63-50.67a42.08,42.08,0,0,0-3.87-2.16l1.52-3.23a45.9,45.9,0,0,1,4.25,2.35ZM230.23,32.79l-2.5,4.27-0.82,1.4-0.1.16h0l-0.22.37a11.08,11.08,0,0,1-3.07,3.34,7.7,7.7,0,0,1-4.43,1.51h0a8.19,8.19,0,0,1-6.26-2.91l0,0,0,0L202.36,30.11a30.75,30.75,0,0,1,18.23-6h0a30.78,30.78,0,0,1,13,2.88ZM202.39,17.37a42.06,42.06,0,0,0-3.88,2.15l-1.91-3a45.78,45.78,0,0,1,4.27-2.37Zm49.07,66a42.37,42.37,0,0,0,2.83-3.47L257.19,82a45.78,45.78,0,0,1-3.12,3.79Zm-65-52.56a41.79,41.79,0,0,0-2.39,3.76L181,32.83a45.67,45.67,0,0,1,2.64-4.14ZM187.34,86a45.91,45.91,0,0,1-3.13-3.75l2.88-2.11a42.39,42.39,0,0,0,2.84,3.42Zm-0.48-6.16h0ZM234,94.68A41.67,41.67,0,0,0,238.21,93l1.52,3.19A45.16,45.16,0,0,1,235.16,98Zm23.49-66.11a45.7,45.7,0,0,1,2.65,4.14L257,34.48a42,42,0,0,0-2.39-3.78Zm1.86,42.19,3.32,1.31a45,45,0,0,1-2,4.41l-3.16-1.73A41.79,41.79,0,0,0,259.4,70.76ZM263,38.62a45.25,45.25,0,0,1,1.5,4.66l-3.47.9a41.65,41.65,0,0,0-1.39-4.25Zm-1.72,26.31a41.77,41.77,0,0,0,.82-4.39L265.64,61a45.68,45.68,0,0,1-.9,4.82Zm1.18-10.37a42.28,42.28,0,0,0-.29-4.45l3.54-.45a46,46,0,0,1,.32,4.9h-3.57Zm-83.63.29h-3.54a46,46,0,0,1,.3-5.07l3.51,0.44A42.57,42.57,0,0,0,178.81,54.85Zm27.55,43.31a45.27,45.27,0,0,1-4.58-1.77l1.51-3.24a41.74,41.74,0,0,0,4.17,1.61Z" />

			<g class="trails">
				<g>
					<rect class="trail trail-major" x="90.42" y="21.06" width="67.81" height="9" rx="5.5" ry="5.5" />
					<rect class="trail trail-minor" x="57.88" y="21.06" width="21.75" height="9" rx="5.5" ry="5.5" />
				</g>
				<g>
					<rect class="trail trail-major" x="63.23" y="77.21" width="94" height="9" rx="5.5" ry="5.5" />
					<rect class="trail trail-minor" x="18.23" y="77.21" width="37.45" height="9" rx="5.5" ry="5.5" />
				</g>
				<g>
					<rect class="trail trail-major" x="20.64" y="49.13" width="130.92" height="9" rx="5.5" ry="5.5" />
					<rect class="trail trail-minor" x="0" y="49.13" width="11" height="9" rx="5.5" ry="5.5" />
				</g>
			</g>
		</g>
	</svg>
</div>
            
          
!
            
              html, body{
	height: 100%;
}
body{
	display: flex;
	align-items: center;
	justify-content: center;
	background: #0067A5
}
.ajax-loader{
	position: relative;
	transition: 200ms ease-in-out;
	font-size: 500px;
	width: 1em;
	height: 0.5em;

	svg{
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		fill: #fff;
		overflow: visible;
	}

	.trails{

		g{
			.trail-minor,
			.trail-major{
				opacity:0;
			}
		}
	}
}
            
          
!
            
              var tween = new TimelineMax({repeat: -1});

	// Bob
var bob = new TimelineMax();
		bob.staggerTo('.wheel, .trails', 0.8, { y: -6, ease: Linear.easeNone }, 0.3 );
		bob.staggerTo('.wheel, .trails', 0.5, { y: 0, ease: Linear.easeNone }, 0.3 );
		bob.duration(1);
		bob.pause();

	// Spin
var spin = new TimelineMax();
		spin.to('.wheel', 3, { rotation: 360, transformOrigin:'50% 50%', ease: Linear.easeNone });

// Trails
var trails = new TimelineLite();
		trails.duration(0.5);

// Trails Major (long)
var trails_major = new TimelineMax();
$('.trails .trail-major').each(function(i){

	var trail_timeline = new TimelineLite();

	var original_x = parseInt($(this).attr('x'));
	var original_width = parseInt($(this).attr('width'));

	$(this).data('originalx', original_x);

	trail_timeline.set(this, { opacity: 0, attr:{ width: 0, x: (original_x + original_width) } } );
	trail_timeline.to(this, 0.35, { opacity: 1, attr:{ width: original_width, x: original_x }, ease: Linear.easeNone } );
	trail_timeline.to(this, 0.35, { opacity: 0, attr:{ width: 0, x: 0 }, ease: Linear.easeNone } );

	trails_major.add(trail_timeline, 0.4*i);
});
trails.add(trails_major, 0);

// Trails Minor (short)
var trails_minor = new TimelineMax();
$('.trails .trail-minor').each(function(i){

	var trail_timeline = new TimelineLite();

	var original_x = parseInt($(this).attr('x'));
	var start_xMajor = parseInt($(this).prev('.trail-major').attr('x'));
	var original_xMajor = parseInt($(this).prev('.trail-major').data('originalx'));
	var original_width = parseInt($(this).attr('width'));
	var original_widthMajor = parseInt($(this).prev('.trail-major').attr('width'));
	var gap = 10;

	trail_timeline.set(this, { opacity: 0, attr:{ width: 0, x: (start_xMajor - original_width - gap) } } );
	trail_timeline.to(this, 0.35, { opacity: 0.5, attr:{ width: original_width, x: (original_xMajor - original_width - gap) }, ease: Linear.easeNone } );
	trail_timeline.to(this, 0.35, { opacity: 0, attr:{ width: 0, x: (0 - gap) }, ease: Linear.easeNone } );

	trails_minor.add(trail_timeline, 0.4*i);
});
trails.add(trails_minor, 0);

// Master Timeline
tween.add(spin, 0);
tween.add(bob, 0);
tween.add(trails, 0);
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console