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.

Editor Settings

Code Indentation

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

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              <div id="example">
  <div class="example-row text-center">
    <h3>jQuery Viewport Checker + Animate CSS = </h3>
    <h1>jQuery Viewport Animate</h1>
    <h2>Please visit the <a href="http://viewportanimate.com" target="_blank">Website</a> for the source file and instructions.</h2>
    <img src="https://cdn.pixabay.com/photo/2016/03/31/18/34/arrow-1294465__340.png" alt="pixabay-arrow" width="150px" style="animation:pulse 1s infinite; margin-top:25px;">
  </div>
</div>
<div id="bottom">
  <div class="example-row text-center">
    <button id="back-to-top" class="btn btn btn-success" onclick="scrollToTop(1000)">Back to Top</button>
  </div>
</div>
            
          
!

CSS

            
              .example-row {
  width: 100%;
  padding:150px 0;
  margin:0;
}

h1 {font-size:72px;}

h3 {margin:auto; font-size:36px;}

.example-row:nth-child(even) {background-color: #eee;}

.hidden {visibility:hidden;}
.visible {visibility:visible !important;}
            
          
!

JS

            
              // Viewport Animate JS v1.0.0
// 2017-10-07
// jQuery Viewport Checker + Animate CSS
// The MIT License (MIT)
// Copyright (c) 2017 Alexander Burton

// BEGIN: Viewport Animate JS

// Define Animation Objects
  var animations = [
    {className: '.vpa-bounce', animationClass: 'bounce', hideFirst: false },
    {className: '.vpa-flash', animationClass: 'flash', hideFirst: false },
    {className: '.vpa-pulse', animationClass: 'pulse', hideFirst: false },
    {className: '.vpa-rubber-band', animationClass: 'rubberBand', hideFirst: false },
    {className: '.vpa-shake', animationClass: 'shake', hideFirst: false },
    {className: '.vpa-swing', animationClass: 'swing', hideFirst: false },
    {className: '.vpa-tada', animationClass: 'tada', hideFirst: false },
    {className: '.vpa-wobble', animationClass: 'wobble', hideFirst: false },
    {className: '.vpa-jello', animationClass: 'jello', hideFirst: false },
    {className: '.bounce-in', animationClass: 'bounceIn', hideFirst: true },
    {className: '.bounce-in-left', animationClass: 'bounceInLeft', hideFirst: true },
    {className: '.bounce-in-right', animationClass: 'bounceInRight', hideFirst: true },
    {className: '.bounce-in-down', animationClass: 'bounceInDown', hideFirst: true },
    {className: '.bounce-in-up', animationClass: 'bounceInUp', hideFirst: true },
    {className: '.bounce-out', animationClass: 'bounceOut', hideFirst: false },
    {className: '.bounce-out-left', animationClass: 'bounceOutLeft', hideFirst: false },
    {className: '.bounce-out-right', animationClass: 'bounceOutRight', hideFirst: false },
    {className: '.bounce-out-down', animationClass: 'bounceOutDown', hideFirst: false },
    {className: '.bounce-out-up', animationClass: 'bounceOutUp', hideFirst: false },
    {className: '.fade-in', animationClass: 'fadeIn', hideFirst: true },
    {className: '.fade-in-left', animationClass: 'fadeInLeft', hideFirst: true },
    {className: '.fade-in-right', animationClass: 'fadeInRight', hideFirst: true },
    {className: '.fade-in-up', animationClass: 'fadeInUp', hideFirst: true },
    {className: '.fade-in-down', animationClass: 'fadeInDown', hideFirst: true },
    {className: '.fade-in-left-big', animationClass: 'fadeInLeftBig', hideFirst: true },
    {className: '.fade-in-right-big', animationClass: 'fadeInRightBig', hideFirst: true },
    {className: '.fade-in-down-big', animationClass: 'fadeInDownBig', hideFirst: true },
    {className: '.fade-in-up-big', animationClass: 'fadeInUpBig', hideFirst: true },
    {className: '.fade-out', animationClass: 'fadeOut', hideFirst: false },
    {className: '.fade-out-left', animationClass: 'fadeOutLeft', hideFirst: false },
    {className: '.fade-out-right', animationClass: 'fadeOutRight', hideFirst: false },
    {className: '.fade-out-up', animationClass: 'fadeOutUp', hideFirst: false },
    {className: '.fade-out-down', animationClass: 'fadeOutDown', hideFirst: false },
    {className: '.fade-out-left-big', animationClass: 'fadeOutLeftBig', hideFirst: false },
    {className: '.fade-out-right-big', animationClass: 'fadeOutRightBig', hideFirst: false },
    {className: '.fade-out-down-big', animationClass: 'fadeOutDownBig', hideFirst: false },
    {className: '.fade-out-up-big', animationClass: 'fadeOutUpBig', hideFirst: false },
    {className: '.vpa-flip', animationClass: 'flip', hideFirst: false },
    {className: '.flip-in-x', animationClass: 'flipInX', hideFirst: true },
    {className: '.flip-in-y', animationClass: 'flipInY', hideFirst: true },
    {className: '.flip-out-x', animationClass: 'flipOutX', hideFirst: false },
    {className: '.flip-out-y', animationClass: 'flipOutY', hideFirst: false },
    {className: '.light-speed-in', animationClass: 'lightSpeedIn', hideFirst: true},
    {className: '.light-speed-out', animationClass: 'lightSpeedOut', hideFirst: false },
    {className: '.rotate-in', animationClass: 'rotateIn', hideFirst: true },
    {className: '.rotate-in-down-left', animationClass: 'rotateInDownLeft', hideFirst: true },
    {className: '.rotate-in-down-right', animationClass: 'rotateInDownRight', hideFirst: true },
    {className: '.rotate-in-up-left', animationClass: 'rotateInUpLeft', hideFirst: true },
    {className: '.rotate-in-up-right', animationClass: 'rotateInUpRight', hideFirst: true },
    {className: '.rotate-out', animationClass: 'rotateOut', hideFirst: false },
    {className: '.rotate-out-down-left', animationClass: 'rotateOutDownLeft', hideFirst: false },
    {className: '.rotate-out-down-right', animationClass: 'rotateOutDownRight', hideFirst: false },
    {className: '.rotate-out-up-left', animationClass: 'rotateOutUpLeft', hideFirst: false },
    {className: '.rotate-out-up-right', animationClass: 'rotateOutUpRight', hideFirst: false },
    {className: '.slide-in-left', animationClass: 'slideInLeft', hideFirst: true },
    {className: '.slide-in-right', animationClass: 'slideInRight', hideFirst: true },
    {className: '.slide-in-down', animationClass: 'slideInDown', hideFirst: true },
    {className: '.slide-in-up', animationClass: 'slideInUp', hideFirst: true },
    {className: '.slide-out-left', animationClass: 'slideOutLeft', hideFirst: false },
    {className: '.slide-out-right', animationClass: 'slideOutRight', hideFirst: false },
    {className: '.slide-out-down', animationClass: 'slideOutDown', hideFirst: false },
    {className: '.slide-out-up', animationClass: 'slideOutUp', hideFirst: false },
    {className: '.zoom-in', animationClass: 'zoomIn', hideFirst: true },
    {className: '.zoom-in-left', animationClass: 'zoomInLeft', hideFirst: true },
    {className: '.zoom-in-right', animationClass: 'zoomInRight', hideFirst: true },
    {className: '.zoom-in-down', animationClass: 'zoomInDown', hideFirst: true },
    {className: '.zoom-in-up', animationClass: 'zoomInUp', hideFirst: true },
    {className: '.zoom-out', animationClass: 'zoomOut', hideFirst: false },
    {className: '.zoom-out-left', animationClass: 'zoomOutLeft', hideFirst: false },
    {className: '.zoom-out-right', animationClass: 'zoomOutRight', hideFirst: false },
    {className: '.zoom-out-down', animationClass: 'zoomOutDown', hideFirst: false },
    {className: '.zoom-out-up', animationClass: 'zoomOutUp', hideFirst: false },
    {className: '.vpa-hinge', animationClass: 'hinge', hideFirst: false },
    {className: '.roll-in', animationClass: 'rollIn', hideFirst: true },
    {className: '.roll-out', animationClass: 'rollOut', hideFirst: false },
    {className: '.jack-in-the-box', animationClass: 'jackInTheBox', hideFirst: true }
  ];

// END: Viewport Animate JS

// BEGIN: JS Function to build Markup for Sample Below

  // Example JS Looping through Template
  animations.forEach(function(v) {
    var classSet = v.className.replace(".", "");
    var template = "<div class=\"row example-row\">"
                      +"<h3 class=\""+classSet+"\">"+v.animationClass+"</h3>";
                   + "</div>";
    $('#example').append(template);
  });
$('#example').append("<div class=\"row example-row\"><h3>The End!!!</h3></div>");
  
  // BEGIN jQUERY VIEWPORT CHECKER + ANIMATE JS Tasks
  
  // Define the Viewport Checker Animate Function
  function viewportAnimate(animations) {
    console.log(animations.length);
    $.each(animations, function(i, v) {
      console.log(v.className+": "+i);
      // Define Hider Class
      var hideChecker = v.hideFirst;
      var hidden;
      // If Hider = True then Set Hidden Class
      if(hideChecker == true) {hidden = "hidden";} else {hidden = "";}
      // Set jQuery Viewport Checker Based on Animation Child Object Config Settings
      $(v.className).addClass(hidden).viewportChecker({
        classToAdd: 'animated visible '+v.animationClass,
        offset: 200
      });
    }); // end for loop
  } // end Viewport Checker Animate Function

  // Execute the Viewport Checker Animate Function
  viewportAnimate(animations);

function scrollToTop(scrollDuration) {
    var scrollStep = -window.scrollY / (scrollDuration / 15),
        scrollInterval = setInterval(function(){
        if ( window.scrollY != 0 ) {
            window.scrollBy( 0, scrollStep );
        }
        else clearInterval(scrollInterval); 
    },15);
}
            
          
!
999px

Console