Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!-- Just add the "wobble" class to any text element, and the name of a CSS animation -->
<!-- Fiddle with the @keyframes declarations and wobble span classes to create your own animations -->

<h1 class="wobble">Glorious.</h1>

<h1 class="wobble" data-animation="upscale">Decadent.</h1>

<h1 class="wobble" data-animation="spin">Luxurious.</h1>

<h1 class="wobble" data-animation="skew">Pilfered.</h1>

<h1 class="wobble" data-animation="squash">Voluptuous.</h1>

<h1 class="wobble" data-animation="leap">Excellent.</h1>

<h1 class="wobble" data-animation="fade">Tranquility.</h1>

<h1 class="wobble" data-animation="sheen">Pontificate.</h1>

<h1 class="wobble" data-animation="xspin">Defenestrated.</h1>

<h2 class="wobble" data-animation="fade">It also works for longer sentences, by the way.</h2>



              
            
!

CSS

              
                @keyframes jump
	50%
		-webkit-transform: translateY(-30%)
		transform: translateY(-30%)

@keyframes upscale
	50%
		-webkit-transform: scale(1.5)
		transform: scale(1.5)

@keyframes spin
	50%
		-webkit-transform: rotate(180deg)
		transform: rotate(180deg)

@keyframes squash
	50%
		-webkit-transform: scaleY(0)
		transform: scaleY(0)

@keyframes skew
	50%
		-webkit-transform: skew(-30deg)
		transform: skew(-30deg)

@keyframes leap
	50%
		-webkit-transform: translateY(-50%) rotate(-15deg)
		transform: translateY(-50%) rotate(-15deg)

@keyframes fade
	50%
		-webkit-transform: translateY(50%)
		transform: translateY(50%)
		opacity: 0

@keyframes sheen
	50%
		-webkit-transform: translateY(-10%)
		transform: translateY(-10%)
		color: #eee

@keyframes xspin
	50%
		-webkit-transform: scaleX(0)
		transform: scaleX(0)

body
	padding: 40px
	font-family: 'Baloo Thambi 2'
	color: #333

h1
	font-size: 50px
	font-weight: 800
	cursor: default
	margin-bottom: 30px
	float: left
	clear: left

h2
	float: left
	clear: left
	margin-bottom: 50px
	font-size: 25px

.wobble
	span
		display: inline-block
		pointer-events: none
	span.jump
		animation: jump 0.5s 1
	span.upscale
		animation: upscale 0.5s 1
	span.spin
		animation: spin 0.5s 1
	span.skew
		animation: skew 0.5s 1
	span.squash
		animation: squash 0.5s 1
		-webkit-transform-origin: bottom
		transform-origin: bottom
	span.leap
		animation: leap 0.7s 1
	span.fade
		animation: fade 0.5s 1
	span.sheen
		animation: sheen 0.3s 1
	span.xspin
		animation: xspin 0.5s 1

.info
	background: #f6f6f6
	padding: 30px
	margin-bottom: 50px
	border-radius: 4px
	box-shadow: 0 20px 50px -45px #333
	max-width: 600px

	p
		font-size: 18px
		line-height: 1.4

	p + p
		margin-top: 20px

	a
		color: coral
		text-decoration: none
              
            
!

JS

              
                var wobbleElements = document.querySelectorAll('.wobble');

wobbleElements.forEach(function(el){
	el.addEventListener('mouseover', function(){
		
		if(!el.classList.contains('animating') && !el.classList.contains('mouseover')){
		
			el.classList.add('animating','mouseover');
		
			var letters = el.innerText.split('');
			
			setTimeout(function(){ el.classList.remove('animating'); }, (letters.length + 1) * 50);
			
			var animationName = el.dataset.animation;
			if(!animationName){ animationName = "jump"; }
		
			el.innerText = '';
		
			letters.forEach(function(letter){
				if(letter == " "){
					letter = "&nbsp;";
				}
				el.innerHTML += '<span class="letter">'+letter+'</span>';
			});
			
			var letterElements = el.querySelectorAll('.letter');
			letterElements.forEach(function(letter, i){
				setTimeout(function(){
					letter.classList.add(animationName);
				}, 50 * i);
			});
			
		}
		
	});
	
	el.addEventListener('mouseout', function(){				
		el.classList.remove('mouseover');
	});
});
              
            
!
999px

Console