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

              
                <div class="d-frame js-inertia-list js-moving-up">
						
  <ul class="d-list-moving">

    <li class="d-list-moving-item">

      <div class="d-list-inertia">

        <img class="d-list-item-photo" src="http://www.fillmurray.com/50/50" alt="Bill murray">
        <div class="d-list-item-content">
          <dl>
            <dt>Bill Murray</dt>
            <dd>Actor</dd>
          </dl>
        </div>

      </div>

    </li>

    <li class="d-list-moving-item">
      <div>

        <img class="d-list-item-photo" src="http://www.fillmurray.com/50/50" alt="Bill murray">
        <div class="d-list-item-content">
          <dl>
            <dt>Bill Murray</dt>
            <dd>Actor</dd>
          </dl>
        </div>

      </div>
    </li>
    <li class="d-list-moving-item">
      <div>

        <img class="d-list-item-photo" src="http://www.fillmurray.com/50/50" alt="Bill murray">
        <div class="d-list-item-content">
          <dl>
            <dt>Bill Murray</dt>
            <dd>Actor</dd>
          </dl>
        </div>

      </div>
    </li>
    <li class="d-list-moving-item">
      <div>

        <img class="d-list-item-photo" src="http://www.fillmurray.com/50/50" alt="Bill murray">
        <div class="d-list-item-content">
          <dl>
            <dt>Bill Murray</dt>
            <dd>Actor</dd>
          </dl>
        </div>

      </div>
    </li>

    <li class="d-list-moving-item">
      <div>
        <img class="d-list-item-photo" src="http://www.fillmurray.com/50/50" alt="Bill murray">
        <div class="d-list-item-content">
          <dl>
            <dt>Bill Murray</dt>
            <dd>Actor</dd>
          </dl>
        </div>

      </div>
    </li>

    <li class="d-list-moving-item">
      <div>
        <img class="d-list-item-photo" src="http://www.fillmurray.com/50/50" alt="Bill murray">
        <div class="d-list-item-content">

          <dl>
            <dt>Bill Murray</dt>
            <dd>Actor</dd>
          </dl>

        </div>

      </div>
    </li>


  </ul>
</div>
<nav class="d-navigation">
						
  <ul>
    <li>
      <a class="d-btn-primary js-btn-up" href="#list-moving-up">
        Play animation
      </a>
    </li>


  </ul>

</nav>
              
            
!

CSS

              
                .d-list-moving-item > div:after, .d-list-moving-item:after {
  content: " ";
  display: table;
  clear: both;
}

.d-list-moving {
  border: 1px solid #005c43;
  -webkit-transform: translateY(0);
  -ms-transform: translateY(0);
  transform: translateY(0);
  -webkit-transition: -webkit-transform 0.5s ease-in-out;
  transition: transform 0.5s ease-in-out;
  max-width: 30em;
  margin: 0 auto;
}

#list-moving-up:target .d-list-moving,
.js-moving-up .d-list-moving {
  -webkit-transform: translateY(-2em);
  -ms-transform: translateY(-2em);
  transform: translateY(-2em);
}

#list-moving-up:target .d-list-moving-item,
.js-moving-up .d-list-moving {
  -webkit-animation: motionBlurTextUp 0.7s 0.1s ease-in-out forwards;
  animation: motionBlurTextUp 0.7s 0.1s ease-in-out forwards;
}

#list-moving-up:target .d-list-moving-item > div,
.js-moving-up .d-list-moving-item > div {
  -webkit-animation: inertiaUp 0.7s 0.1s ease-in-out forwards;
  animation: inertiaUp 0.7s 0.1s ease-in-out forwards;
}

#list-moving-up:target .d-list-moving-item:after,
.js-moving-up .d-list-moving-item:after {
  -webkit-animation: bendy 1s forwards;
  animation: bendy 1s forwards;
}

#list-moving-up:target .d-list-moving-item:before,
.js-moving-up .d-list-moving-item:before {
  display: none;
}

#list-moving-down:target .d-list-moving,
.js-moving-down .d-list-moving {
  -webkit-transform: translateY(10em);
  -ms-transform: translateY(10em);
  transform: translateY(10em);
}

#list-moving-down:target .d-list-moving-item,
.js-moving-down .d-list-moving-item {
  -webkit-animation: motionBlurTextDown 0.7s 0.1s ease-in-out forwards;
  animation: motionBlurTextDown 0.7s 0.1s ease-in-out forwards;
}

#list-moving-down:target .d-list-item-inertia,
.js-moving-down .d-list-item-inertia {
  -webkit-animation: inertiaDown 0.7s 0.1s ease-in-out forwards;
  animation: inertiaDown 0.7s 0.1s ease-in-out forwards;
}

#list-moving-down:target .d-list-moving-item:before,
.js-moving-down .d-list-moving-item:before {
  -webkit-animation: bendy 1s forwards;
  animation: bendy 1s forwards;
  display: block;
  visibility: visible;
}

#list-moving-down:target .d-list-moving-item:after,
.js-moving-down .d-list-moving-item:after {
  display: none;
  visibility: hidden;
}

.d-list-moving-item > div {
  height: 4em;
}

.d-list-moving-item {
  background: #00b98d;
  display: block;
  list-style-type: none;
  padding: 0.5em 0 2em 0;
  position: relative;
  z-index: 2;
}

.d-list-moving-item:first-child:after {
  border: none;
}

.d-list-moving-item:before {
  display: none;
  bottom: 0;
  border-bottom: 1px solid #005c43;
}

.d-list-moving-item:before,
.d-list-moving-item:after {
  content: "";
  height: 7em;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.d-list-moving-item:after {
  border-top: 1px solid #005c43;
  bottom: 0;
}

.d-list-item-content {
  color: #fff;
  display: block;
  float: left;
  margin: 1em;
}

.d-list-item-content h1 {
  margin: 0;
  text-align: left;
}

.d-list-item-photo {
  margin: 1em 1em 1em 2em;
  float: left;
  display: block;
  border-radius: 50%;
}

@-webkit-keyframes motionBlurTextUp {
  0% {
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }

  50% {
    text-shadow: 0px 4px 4px white;
  }

  100% {
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
}

@keyframes motionBlurTextUp {
  0% {
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }

  50% {
    text-shadow: 0px 4px 4px white;
  }

  100% {
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
}
@-webkit-keyframes motionBlurTextDown {
  0% {
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }

  50% {
    text-shadow: 0px -4px 4px white;
  }

  100% {
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
}
@keyframes motionBlurTextDown {
  0% {
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }

  50% {
    text-shadow: 0px -4px 4px white;
  }

  100% {
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
}
@-webkit-keyframes bendy {
  0% {
    border-radius: 0%;
  }

  40% {
    border-radius: 50%;
  }

  100% {
    border-radius: 0%;
  }
}
@keyframes bendy {
  0% {
    border-radius: 0%;
  }

  40% {
    border-radius: 50%;
  }

  100% {
    border-radius: 0%;
  }
}
@-webkit-keyframes inertiaDown {
  0% {
    -webkit-transform: scaleY(1);
    transform: scaleY(1);
  }

  50% {
    -webkit-transform: scaleY(1.2) translateY(-1em);
    transform: scaleY(1.2) translateY(-1em);
  }

  100% {
    -webkit-transform: scaleY(1);
    transform: scaleY(1);
  }
}
@keyframes inertiaDown {
  0% {
    -webkit-transform: scaleY(1);
    transform: scaleY(1);
  }

  50% {
    -webkit-transform: scaleY(1.2) translateY(-1em);
    transform: scaleY(1.2) translateY(-1em);
  }

  100% {
    -webkit-transform: scaleY(1);
    transform: scaleY(1);
  }
}
@-webkit-keyframes inertiaUp {
  0% {
    -webkit-transform: scaleY(1);
    transform: scaleY(1);
  }

  50% {
    -webkit-transform: scaleY(1.2) translateY(1em);
    transform: scaleY(1.2) translateY(1em);
  }

  100% {
    -webkit-transform: scaleY(1);
    transform: scaleY(1);
  }
}
@keyframes inertiaUp {
  0% {
    -webkit-transform: scaleY(1);
    transform: scaleY(1);
  }

  50% {
    -webkit-transform: scaleY(1.2) translateY(1em);
    transform: scaleY(1.2) translateY(1em);
  }

  100% {
    -webkit-transform: scaleY(1);
    transform: scaleY(1);
  }
}

.d-frame {
  background: #333;
  border: 1px solid #ddd;
  clear: both;
  margin: 0 auto;
  max-width: 30em;
  max-height: 30em;
  overflow: hidden;
}

.d-frame ul {
  padding: 0;
  list-style: none;
}

.d-navigation li a {
text-decoration: none;
display: block;
padding: 1.25em 2em;
margin: 1em;
border-radius: 40px;
  display: table;
  margin: 0 auto;
}
.d-btn-primary {
background: #35b5ac;
border: 1px solid #247b75;
color: #fff;
-webkit-transition: background .4s ease-in-out;
transition: background .4s ease-in-out;
}

ul {
  list-style: none;
  padding: 0;
}

              
            
!

JS

              
                var d, 
	  inertiaList, 
	  btnPlay,
    movingUp,
	  movingDown,
	  swapClasses,
	  checkListState;



d = document;
movingUp = 'js-moving-up';
movingDown = 'js-moving-down';
inertiaList = d.querySelector('.js-inertia-list');
btnPlay = d.querySelector('.js-btn-up');

checkListState = function(e) {

	e.preventDefault();
	swapClasses(movingUp, movingDown);

};

swapClasses = function(class1, class2) {

  inertiaList.classList.toggle(class1);
  inertiaList.classList.toggle(class2);

}

btnPlay.addEventListener('click', checkListState);


              
            
!
999px

Console