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 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

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

              
                <html>
  <head>
    <link href="//fonts.googleapis.com/css?family=Roboto:100,300,400,700|Roboto+Slab:300,700" rel="stylesheet" type="text/css">
  </head>
  <body>
    <h2>
      <span>Give</span>
        <strong id="spinner-show">
          <em class="current">an old couch</em>
            <div class="next">
              <em></em>
            </div>
        </strong>
          <span>Generously</span>
          <ul id="spinner">
            <li>an old couch</li>
            <li>your time</li>
            <li>a helping hand</li>
            <li>accounting help</li>
            <li>outgrown clothes</li>
            <li>a cup of sugar</li>
            <li>mentorship</li>
            <li>coffee cups</li>
            <li>seasonal items</li>
            <li>expertise</li>
            <li>unused toys</li>
            <li>help with a car</li>
            <li>tutoring aid</li>
            <li>food items</li>
            <li>moving boxes</li>
            <li>dusty frames</li>
            <li>knowledge</li>
            <li>aged luggage</li>
            <li>old glasses</li>
            <li>a raspberry pi</li>
            <li>tech support</li>
          </ul>
    </h2>
  </body>
</html>
    
              
            
!

CSS

              
                *, *:before, *:after {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}

body {
  background-color: #2c3e50;
  text-align: center;
}

h2 {
  text-align: center;
  letter-spacing: 1px;
  display: inline-block;
  font-weight: 100;
  text-transform: uppercase;
  font-family: 'Roboto', sans-serif;
  color: #7f8c8d;
  font-size: 30px;
}

#spinner-show {
  font-size: 30px;
  font-weight: 300;
  font-family: 'Roboto Slab', serif;
  color: #16a085;
  display: inline-block;
  text-transform: uppercase;
  -webkit-transition: width 0.6s ease-out;
  -moz-transition: width 0.6s ease-out;
  -o-transition: width 0.6s ease-out;
  -ms-transition: width 0.6s ease-out;
  transition: width 0.6s ease-out;
  position: relative;
}

#spinner-show em {
  font-style: normal;
}
#spinner-show .current {
  -webkit-transform: translateY(0px);
  -moz-transform: translateY(0px);
  -o-transform: translateY(0px);
  -ms-transform: translateY(0px);
  transform: translateY(0px);
  -webkit-transform-origin: 0 0;
  -moz-transform-origin: 0 0;
  -o-transform-origin: 0 0;
  -ms-transform-origin: 0 0;
  transform-origin: 0 0;
  white-space: nowrap;
}
#spinner-show .next {
  position: absolute;
  pointer-events: none;
  top: 0;
  left: 50%;
  width: 500px;
  margin-left: -250px;
  -webkit-transform: translateY(15px);
  -moz-transform: translateY(15px);
  -o-transform: translateY(15px);
  -ms-transform: translateY(15px);
  transform: translateY(15px);
  -webkit-transform-origin: 0 100%;
  -moz-transform-origin: 0 100%;
  -o-transform-origin: 0 100%;
  -ms-transform-origin: 0 100%;
  transform-origin: 0 100%;
  opacity: 0;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  filter: alpha(opacity=0);
  white-space: nowrap;
}
#spinner-show.swap .current {
  opacity: 0;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  filter: alpha(opacity=0);
  -webkit-transform: translateY(0px);
  -moz-transform: translateY(0px);
  -o-transform: translateY(0px);
  -ms-transform: translateY(0px);
  transform: translateY(0px);
  -webkit-transition: 0.5s ease-out;
  -moz-transition: 0.5s ease-out;
  -o-transition: 0.5s ease-out;
  -ms-transition: 0.5s ease-out;
  transition: 0.5s ease-out;
}
#spinner-show.swap .next {
  opacity: 1;
  -ms-filter: none;
  filter: none;
  -webkit-transform: translateY(0px);
  -moz-transform: translateY(0px);
  -o-transform: translateY(0px);
  -ms-transform: translateY(0px);
  transform: translateY(0px);
  -webkit-transition: 0.5s ease-out;
  -moz-transition: 0.5s ease-out;
  -o-transition: 0.5s ease-out;
  -ms-transition: 0.5s ease-out;
  transition: 0.5s ease-out;
}
#spinner {
  display: none;
  position relative
  list-style none
  text-transform uppercase
  font-size 30px
  width 286px
  display inline-block
  font-size 30px
  text-align center
  font-weight 300
  font-family roboto
  color #fff
  padding 0
  margin 0
  li
    text-align center
    position absolute
    top 0
    width 100%
    &.a
      transform translateY(0px)
      transform-origin 0 0
    &.b
      transform translateY(15px)
      transform-origin 0 100%
      opacity 0
  li
    opacity 0
    &:first-child
      opacity 1
  &.swap li
    &.a
      opacity 0
      transform translateY(0px)
      transition 0.5s ease-out
    &.b
      opacity 1
      transform translateY(0px)
      transition 0.5s ease-out
}
              
            
!

JS

              
                $(function() {
  function spinner($element) {
    var words = [];

    var list = $('li', $element);
    list.each(function() {
      words.push($(this).text());    
    });
    list.remove();

    var $ss = $('#spinner-show');

    var i = 0, i_next = 1;

    $('.next em', $ss).text(words[i_next]);
    $ss.width($('.current').width());

    setInterval(function() {
      $ss.addClass('swap');
      i = i_next;
      i_next++;
      if(i_next >= words.length) i_next = 0;
      $ss.width($('.next em').width());
      setTimeout(function() {
        $('.next em', $ss).text(words[i_next]);
        $('.current', $ss).text(words[i]);
        $ss.removeClass('swap');
      console.log('swap!');
      }, 600);
    }, 3800);
  }

  if($('#spinner').length) {
    spinner($('#spinner'));
  }
});

              
            
!
999px

Console