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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <div class="m-scene" id="main">
  <div class="m-header scene_element scene_element--fadein">
  1 Nullam cursus lacinia erat. Phasellus tempus. Phasellus accumsan cursus velit. Suspendisse enim turpis, dictum sed, iaculis a, condimentum nec, nisi.
<br>
  <br>
2Sed mollis, eros et ultrices tempus, mauris ipsum aliquam libero, non adipiscing dolor urna a orci. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Pellentesque egestas, neque sit amet convallis pulvinar, justo nulla eleifend augue, ac auctor orci leo non est. Praesent ac massa at ligula laoreet iaculis.
  </div>
  <div class="m-page scene_element scene_element--fadeinup">
    3 Nullam cursus lacinia erat. Phasellus tempus. Phasellus accumsan cursus velit. Suspendisse enim turpis, dictum sed, iaculis a, condimentum nec, nisi.
<br>
  <br>
4 Fusce risus nisl, viverra et, tempor et, pretium in, sapien. Donec posuere vulputate arcu. Fusce risus nisl, viverra et, tempor et, pretium in, sapien. Sed hendrerit.
<br>
  <br>
Vivamus quis mi. Praesent venenatis metus at tortor pulvinar varius. Vivamus aliquet elit ac nisl. Vestibulum suscipit nulla quis orci.
  </div>
</div>







<!-- Detail page -->
<div class="m-scene" id="main">
  <div class="m-aside scene_element scene_element--fadein">
   Nullam dictum felis eu pede mollis pretium. Vestibulum dapibus nunc ac augue. Morbi mollis tellus ac sapien.
  </div>
  <div class="m-right-panel m-page scene_element scene_element--fadeinright">
 Praesent ac massa at ligula laoreet iaculis. Sed libero. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo. Praesent vestibulum dapibus nibh. Etiam rhoncus.
  </div>
</div>
              
            
!

CSS

              
                #main{
  width:500px;
  height:500px;
  padding:1em;
  background-color:rgba(0,0,0,.5);
  transition: all 0.3s ease-in-out;
  margin:0 auto;
  color:#fff;
  margin:2em auto
}
#main:hover{
  box-shadow: 0 0 0 20px rgba(0,0,0,.5);
}















@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translate3d(0, 100%, 0);
  }

  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeInRight {
  0% {
    opacity: 0;
    transform: translate3d(100%, 0, 0);
  }

  100% {
    opacity: 1;
    transform: none;
  }
}

}


/*
 * CSS Page Transitions
 * Don't forget to add vendor prefixes!
 */
.m-scene {
  /** Basic styles for an animated element */
  /** An element that fades in */
  /** An element that fades in and slides up */
  /** An element that fades in and slides from the right */
}
.m-scene .scene_element {
  animation-duration: 1.25s;
  transition-timing-function: ease-in;
  animation-fill-mode: both;
}
.m-scene .scene_element--fadein {
  animation-name: fadeIn;
}
.m-scene .scene_element--fadeinup {
  animation-name: fadeInUp;
}
.m-scene .scene_element--fadeinright {
  animation-name: fadeInRight;
}
              
            
!

JS

              
                ;(function ($) {
  'use strict';
  var $body    = $('html, body'), // Define jQuery collection 
      content  = $('#main').smoothState({
        onafter : {
          duration: 500,
          render: function () {
            content.toggleAnimationClass('is-exiting');
            
            // Scroll user to the top
            $body.animate({ 'scrollTop': 0 });

          }
        }
      }).data('smoothState');
})(jQuery);
              
            
!
999px

Console