Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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

              
                <header>
  <h1>Typing Animation</h1>
  <p class="tagline" id="tagline">
    <span class="tagline-skill tagline-skill-paintings"><span class="tagline-skill_inner tagline-skill_inner-paintings" id="taglinePaintings">paintings</span></span>
    <span class="tagline-skill tagline-skill-webdesign"><span class="tagline-skill_inner tagline-skill_inner-webdesign" id="taglineWebdesign">webdesign</span></span>
    <span class="tagline-skill tagline-skill-animation"><span class="tagline-skill_inner tagline-skill_inner-animation" id="taglineAnimation">animation</span></span>
  </p>
</header> 
              
            
!

CSS

              
                .tagline,
.tagline-skill {
  height: 80px;
}

.tagline {
  font-family: monospace;
  overflow: hidden;
  background-color: #2a2a28;
  color: #fff;
}

.tagline-skill {
  position: relative;
  font-size: 1.5em;
  padding-top: .75em;
  animation: animatetotop 6s steps(3) infinite;
}

.tagline-skill_inner,
.tagline-skill-overlay {
  display: inline-block;
}

.tagline-skill_inner {
  position: relative;
  line-height: 1;
}

.tagline-skill-overlay {
  position: absolute;
  top:-1px;right:0;bottom:-2px;left:0;
  border-left: 1px solid #fff;
  background-color: #2a2a28;
}

.js .tagline-skill-overlay {
  animation: animatetoright 1s steps(10) infinite alternate;
}

@keyframes animatetoright {
  0% {
    left: 0;
    margin-right: auto;
  }
  100% {
    left: 100%;
    margin-left: .6em;
    margin-right: -.6em;
  }
}

@keyframes animatetotop {
  0% {
    top: 0;
  }
  100% {
    top: -240px;
  }
}


/* general layout */
* {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}

html {
  font-size: 16px;
}

html,
body {
  height: 100%;
  background: background;
}

body {
  font: 100%/1.5 sans-serif;
  min-height: 100%;
  box-sizing: border-box;
}

.wf-firasans-n4-active h1 {
 font-family: "Fira Sans", sans-serif;
}

header {
  text-align: center;
  padding: 1em;
} 

header h1,
.tagline,
.tagline-skill {
  width: 192px;
  display: block;
  font-weight: 400;
}

header h1 {
  font-size: 1.75em;
  height: 112px;
  padding: .5em;
  background-color: #f2de03;
}  

.wf-firamono-n4-active .tagline {
  font-family: "Fira Mono", monospace;
}
              
            
!

JS

              
                /* swap the `no-js` class-name on the root html-element with `js` */
var root = document.documentElement;

if ( 'querySelector' in document && 'addEventListener' in window && Array.prototype.forEach ) { 
 root.className = root.className.replace(/\bno-js\b/g, '') + ' js '; 
} 

/* insert overlay elements to be animated with CSS-animations */
function insertEl() {
"use strict";
  var tagline = document.getElementById('tagline');
  var tagline1 = document.getElementById('taglinePaintings');
  var tagline2 = document.getElementById('taglineWebdesign');
  var tagline3 = document.getElementById('taglineAnimation');
  var overlay1 = document.createElement('span');
  var overlay2 = document.createElement('span');
  var overlay3 = document.createElement('span');

  overlay1.setAttribute('class', 'tagline-skill-overlay tagline-skill-overlay-paintings');
  overlay2.setAttribute('class', 'tagline-skill-overlay tagline-skill-overlay-webdesign');
  overlay3.setAttribute('class', 'tagline-skill-overlay tagline-skill-overlay-animation');

  tagline1.insertBefore(overlay1, tagline1.firstChild);
  tagline2.insertBefore(overlay2, tagline2.firstChild);
  tagline3.insertBefore(overlay3, tagline3.firstChild);

};
insertEl();

/* Fira Sans and Fira Mono webfonts:
 * https://www.google.com/fonts#UsePlace:use/Collection:Fira+Sans
 * https://www.google.com/fonts#UsePlace:use/Collection:Fira+Mono
 */
 WebFontConfig = {
   google: { families: [ 'Fira+Mono::latin','Fira+Sans::latin'] }
 };
 (function() {
   var wf = document.createElement('script');
   wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
   wf.type = 'text/javascript';
   wf.async = 'true';
   var s = document.getElementsByTagName('script')[0];
   s.parentNode.insertBefore(wf, s);
 })();
              
            
!
999px

Console