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

              
                <div id="container-fluid">
  <div class="row come-in">
    <h1 class="text-center">Responsive Bootstrap Card-UI with Animation</h1>
    
    <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
      <div class="panel panel-primary">
        <div class="panel-heading">Jules Verne - Around the World in 80 Days</div>
        <div class="panel-body">
          <p>"Sir," said Mr. Fogg to the captain, "three passengers have disappeared."</p>

          <p>"Dead?" asked the captain.</p>

          <p>"Dead or prisoners; that is the uncertainty which must be solved.  Do you propose to pursue the Sioux?"</p>

          <p>"That's a serious thing to do, sir," returned the captain.  "These Indians may retreat beyond the Arkansas, and I cannot leave the fort unprotected."</p>

          <p>"The lives of three men are in question, sir," said Phileas Fogg.</p>
        </div>
      </div>
      <div class="panel panel-default fadeInDown">
        <div class="panel-body">
          <p>"Doubtless; but can I risk the lives of fifty men to save three?"</p>

          <p>"I don't know whether you can, sir; but you ought to do so."</p>

          <p>"Nobody here," returned the other, "has a right to teach me my duty."</p>

          <p>"Very well," said Mr. Fogg, coldly.  "I will go alone."</p>

          <p>"You, sir!" cried Fix, coming up; "you go alone in pursuit of the Indians?"</p>
        </div>
      </div>
    </div>
    
    <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
      <div class="panel panel-info">
        <div class="panel-heading">H.G. Wells - The War of the Worlds</div>
        <div class="panel-body">
          <p>By midnight the blazing trees along the slopes of Richmond Park and the glare of Kingston Hill threw their light upon a network of black smoke, blotting out the whole valley of the Thames and extending as far as the eye could reach.  And through this two Martians slowly waded, and turned their hissing steam jets this way and that.</p>

          <p>They were sparing of the Heat-Ray that night, either because they had but a limited supply of material for its production or because they did not wish to destroy the country but only to crush and overawe the opposition they had aroused.  In the latter aim they certainly succeeded.  Sunday night was the end of the organised opposition to their movements.  After that no body of men would stand against them, so hopeless was the enterprise.  Even the crews of the torpedo-boats and destroyers that had brought their quick-firers up the Thames refused to stop, mutinied, and went down again.  The only offensive operation men ventured upon after that night was the preparation of mines and pitfalls, and even in that their energies were frantic and spasmodic.</p>

          <p>One has to imagine, as well as one may, the fate of those batteries towards Esher, waiting so tensely in the twilight.  Survivors there were none.  One may picture the orderly expectation, the officers alert and watchful, the gunners ready, the ammunition piled to hand, the limber gunners with their horses and waggons, the groups of civilian spectators standing as near as they were permitted, the evening stillness, the ambulances and hospital tents with the burned and wounded from Weybridge; then the dull resonance of the shots the Martians fired, and the clumsy projectile whirling over the trees and houses and smashing amid the neighbouring fields.</p>

          <p>One may picture, too, the sudden shifting of the attention, the swiftly spreading coils and bellyings of that blackness advancing headlong, towering heavenward, turning the twilight to a palpable darkness, a strange and horrible antagonist of vapour striding upon its victims, men and horses near it seen dimly, running, shrieking, falling headlong, shouts of dismay, the guns suddenly abandoned, men choking and writhing on the ground, and the swift broadening-out of the opaque cone of smoke.  And then night and extinction--nothing but a silent mass of impenetrable vapour hiding its dead.</p>

          <p>Before dawn the black vapour was pouring through the streets of Richmond, and the disintegrating organism of government was, with a last expiring effort, rousing the population of London to the necessity of flight.</p>
        </div>
      </div>      
      
      <div class="panel panel-default">
        <div class="panel-body">
          <p>Before dawn the black vapour was pouring through the streets of Richmond, and the disintegrating organism of government was, with a last expiring effort, rousing the population of London to the necessity of flight.</p>

          <p>So you understand the roaring wave of fear that swept through the greatest city in the world just as Monday was dawning--the stream of flight rising swiftly to a torrent, lashing in a foaming tumult round the railway stations, banked up into a horrible struggle about the shipping in the Thames, and hurrying by every available channel northward and eastward.  By ten o'clock the police organisation, and by midday even the railway organisations, were losing coherency, losing shape and efficiency, guttering, softening, running at last in that swift liquefaction of the social body.</p>

          <p>All the railway lines north of the Thames and the South-Eastern people at Cannon Street had been warned by midnight on Sunday, and trains were being filled.  People were fighting savagely for standing-room in the carriages even at two o'clock.  By three, people were being trampled and crushed even in Bishopsgate Street, a couple of hundred yards or more from Liverpool Street station; revolvers were fired, people stabbed, and the policemen who had been sent to direct the traffic, exhausted and infuriated, were breaking the heads of the people they were called out to protect.</p>

          <p>And as the day advanced and the engine drivers and stokers refused to return to London, the pressure of the flight drove the people in an ever-thickening multitude away from the stations and along the northward-running roads.  By midday a Martian had been seen at Barnes, and a cloud of slowly sinking black vapour drove along the Thames and across the flats of Lambeth, cutting off all escape over the bridges in its sluggish advance.  Another bank drove over Ealing, and surrounded a little island of survivors on Castle Hill, alive, but unable to escape.</p>

          <p></p>

          <p>So he got out of the fury of the panic, and, skirting the Edgware Road, reached Edgware about seven, fasting and wearied, but well ahead of the crowd.  Along the road people were standing in the roadway, curious, wondering.  He was passed by a number of cyclists, some horsemen, and two motor cars.  A mile from Edgware the rim of the wheel broke, and the machine became unridable.  He left it by the roadside and trudged through the village.  There were shops half opened in the main street of the place, and people crowded on the pavement and in the doorways and windows, staring astonished at this extraordinary procession of fugitives that was beginning.  He succeeded in getting some food at an inn.</p>
        </div>
      </div>      
    </div>
    
    <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
      <div class="panel panel-warning">
        <div class="panel-heading">L. Frank Baum - The Wizard of Oz</div>
        <div class="panel-body">
          <p>"Don't speak of it, I beg of you," replied the Woodman.  "I have no heart, you know, so I am careful to help all those who may need a friend, even if it happens to be only a mouse."</p>

          <p>"Only a mouse!" cried the little animal, indignantly.  "Why, I am a Queen--the Queen of all the Field Mice!"</p>

          <p>"Oh, indeed," said the Woodman, making a bow.</p>

          <p>"Therefore you have done a great deed, as well as a brave one, in saving my life," added the Queen.</p>

          <p>At that moment several mice were seen running up as fast as their little legs could carry them, and when they saw their Queen they exclaimed:</p>
        </div>
      </div> 
      
      <div class="panel panel-default">
        <div class="panel-body">
          <p>"Oh, your Majesty, we thought you would be killed!  How did you manage to escape the great Wildcat?"  They all bowed so low to the little Queen that they almost stood upon their heads.</p>

          <p>"This funny tin man," she answered, "killed the Wildcat and saved my life.  So hereafter you must all serve him, and obey his slightest wish."</p>

          <p>"We will!" cried all the mice, in a shrill chorus.  And then they scampered in all directions, for Toto had awakened from his sleep, and seeing all these mice around him he gave one bark of delight and jumped right into the middle of the group.  Toto had always loved to chase mice when he lived in Kansas, and he saw no harm in it.</p>

          <p>But the Tin Woodman caught the dog in his arms and held him tight, while he called to the mice, "Come back!  Come back!  Toto shall not hurt you."</p>

          <p>At this the Queen of the Mice stuck her head out from underneath a clump of grass and asked, in a timid voice, "Are you sure he will not bite us?"</p>
        </div>
      </div> 
    </div>
  </div>
</div>
              
            
!

CSS

              
                body {
  padding: 50px;
  line-height: 150%;
}

/* Add Styles for your cards here */

/* ------ */

/* Animation SCSS */
.come-in {
  -webkit-transform: translateY(150px);
      -ms-transform: translateY(150px);
          transform: translateY(150px);
  -webkit-animation: come-in 0.8s ease forwards;
          animation: come-in 0.8s ease forwards;
}

.come-in:nth-child(odd) {
  -webkit-animation-duration: 0.6s;
          animation-duration: 0.6s;
}

.already-visible {
  -webkit-transform: translateY(0);
      -ms-transform: translateY(0);
          transform: translateY(0);
  -webkit-animation: none;
          animation: none;
}

@-webkit-keyframes come-in {
  to {
    -webkit-transform: translateY(0);
            transform: translateY(0);
  }
}

@keyframes come-in {
  to {
    -webkit-transform: translateY(0);
            transform: translateY(0);
  }
}
              
            
!

JS

              
                (function($) {

  /**
   * Copyright 2012, Digital Fusion
   * Licensed under the MIT license.
   * http://teamdf.com/jquery-plugins/license/
   *
   * @author Sam Sehnert
   * @desc A small plugin that checks whether elements are within
   *     the user visible viewport of a web browser.
   *     only accounts for vertical position, not horizontal.
   */

  $.fn.visible = function(partial) {
    
      var $t            = $(this),
          $w            = $(window),
          viewTop       = $w.scrollTop(),
          viewBottom    = viewTop + $w.height(),
          _top          = $t.offset().top,
          _bottom       = _top + $t.height(),
          compareTop    = partial === true ? _bottom : _top,
          compareBottom = partial === true ? _top : _bottom;
    
    return ((compareBottom <= viewBottom) && (compareTop >= viewTop));

  };
    
})(jQuery);

var win = $(window);

var allMods = $(".panel");

allMods.each(function(i, el) {
  var el = $(el);
  if (el.visible(true)) {
    el.addClass("already-visible"); 
  } 
});

win.scroll(function(event) {
  
  allMods.each(function(i, el) {
    var el = $(el);
    if (el.visible(true)) {
      el.addClass("come-in"); 
    } 
  });
  
});
              
            
!
999px

Console