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

              
                <h1>Animation created with Spirit</h1>
<p><a href="https://spiritapp.io/" target="_blank">https://spiritapp.io/</a></p>

<svg data-spirit-id="message-icon" width="86" height="76" xmlns="http://www.w3.org/2000/svg">
	<g fill="none" fill-rule="evenodd">
	  <path d="M8 0a8 8 0 0 0-8 8v40a8 8 0 0 0 8 8h6.8L13 73.8a2 2 0 0 0 3.3 1.6L35.8 56H45v3a6 6 0 0 0 6 6h15l10.6 10.4a2 2 0 0 0 3.4-1.8L78.4 65H80a6 6 0 0 0 6-6V40a6 6 0 0 0-6-6h-6V8a8 8 0 0 0-8-8H8z"
		 fill="#000" />
	  <path d="M8 4h58a4 4 0 0 1 4 4v40a4 4 0 0 1-4 4H35a2 2 0 0 0-1.4.6l-16.1 16L19 54.2a2 2 0 0 0-2-2.2H8a4 4 0 0 1-4-4V8a4 4 0 0 1 4-4z"
		 fill="#FFF" />
	  <path d="M15 13a2 2 0 1 0 0 4h44a2 2 0 1 0 0-4H15z" fill="#000" />
	  <path d="M15 26a2 2 0 1 0 0 4h44a2 2 0 1 0 0-4H15z" fill="#000" />
	  <path d="M74 38h6a2 2 0 0 1 2 2v19c0 1.2-.8 2-2 2h-4a2 2 0 0 0-2 2.3l1 4.9-6.8-6.6a2 2 0 0 0-1.4-.6H51a2 2 0 0 1-2-2v-3h17a8 8 0 0 0 8-8V38z"
		 fill="#FFF" />
	  <path d="M15 39a2 2 0 1 0 0 4h44a2 2 0 1 0 0-4H15z" fill="#000" />
	</g>
</svg>

<button onclick="replay()">Replay Animation</button>
              
            
!

CSS

              
                $color-alpha: #651FFF;

@import url('https://fonts.googleapis.com/css?family=Fira+Sans');

body {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: calc(100vh - 4rem);
	padding: 2rem 0;
	font-family: 'Fira Sans', sans-serif;
}

h1, p {
	margin-bottom: 0;
}

a {
	color: $color-alpha;
}

svg {
	margin: 4rem 0;
}

button {
	padding: 0.5rem 1rem;
	border: 0 none;
	border-radius: 0.125rem;
	background-color: $color-alpha;
	color: white;
	cursor: pointer;
	font-family: inherit;
	transition: background-color 175ms, transform 175ms;
	will-change: background-color, transform;
	
	&:hover {
		background-color: lighten($color-alpha, 10%);
	}
	
	&:active {
		transform: scale(1.05);
	}
	
}
              
            
!

JS

              
                spirit.setup().then(() => { // load GSAP from CDN
	
	spirit.load('https://s3-us-west-2.amazonaws.com/s.cdpn.io/174479/messageicon.json').then(groups => { // load animation data
		groups.at(0).construct().play() // construct first group and play it
	})

});

function replay() {
	spirit.groups.at(0).construct().play();
}
              
            
!
999px

Console