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

Packages

Add Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import or require. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

            
              <figure class="card-flip fancy-hover">
  <div class="card-flip__flipper">
    <!-- FRONT SIDE -->
    <figure class="card-flip__content card-flip__content--front">
      <img class="fancy-hover__image" src="https://unsplash.it/300/450?image=953">
      <div class="fancy-hover__fancy"></div>
      <div class="fancy-hover__element fancy-hover__element--title">
        <p class="fancy-hover__text">Title</p>
      </div>
      <div class="fancy-hover__element fancy-hover__element--subtitle">
        <p class="fancy-hover__text">Description<br>(click me)</p>
      </div>
    </figure>
    <!-- BACK SIDE -->
    <figure class="card-flip__content card-flip__content--back">
      <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
    </figure>
  </div>
</figure>
            
          
!
            
              * {
  box-sizing: border-box;
  user-select: none;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(#111, #1a1a1a);
}

/* ELEMENT */

.card-flip {
  margin: 20px auto;
  cursor: pointer;
  perspective: 1000px;
  width: 300px;
  height: 450px;
}

.card-flip__flipper {
  transition: .3s ease;
  transform-style: preserve-3d;
  position: relative;
}

.card-flip__content {
  width: 100%;
  backface-visibility: hidden;
  position: absolute;
  overflow: hidden;
}

.fancy-hover__image {
  display: block;
  width: 100%;
  transition: filter .15s linear .15s;
}

.fancy-hover__fancy {
  position: absolute;
  top: 0;
  background-color: rgba(55,66,78,0);
  width: 100%;
  height: 100%;
  transition: background .15s linear .15s
}

.fancy-hover__fancy:after {
  content: '';
  background: white;
  height: 1px;
  position: absolute;
  top: 50%;
  left: 50%;
  right: 50%;
  transition: left .15s ease-in-out, right .15s ease-in-out;
}

.fancy-hover__text {
  width: 100%;
  text-align: center;
  color: white;
}

.fancy-hover__element {
  width: 100%;
  position: absolute;
  padding: 16px;
}

.fancy-hover__element--title {
  background: rgba(0,0,0,.5);
  bottom: 0;
  font-size: 20px;
  font-weight: 100;
  text-transform: uppercase;
  font-family: sans-serif;
  transition: bottom .15s ease-in-out .15s, background .15s linear .15s;
}

.fancy-hover__element--subtitle {
  top: 100%;
  font-family: sans-serif;
  transition: top .15s ease-out;
}

.fancy-hover:hover .fancy-hover__image {
  filter: blur(2px);
  transition-delay: 0s;
}

.fancy-hover:hover .fancy-hover__fancy {
  background: rgba(0,0,0,.5);
  transition-delay: 0s;
}

.fancy-hover:hover .fancy-hover__fancy:after {
  left: 20%;
  right: 20%;
  transition-delay: .15s;
}

.fancy-hover:hover .fancy-hover__element--title {
  bottom: 50%;
  background: rgba(0,0,0,0);
  transition-delay: 0s;
}

.fancy-hover:hover .fancy-hover__element--subtitle {
  top: 50%;
  transition: top .15s ease-in .15s;
}

.card-flip__content--front {
  transform: rotateY(0deg);
  z-index: 2;
}

.card-flip__content--back {
  background: rgb(44,44,44);
  font-family: sans-serif;
  color: white;
  text-align: center;
  padding: 16px;
  height: 450px;
  transform: rotateY(180deg);
}

.card-flip.clicked .card-flip__flipper {
  transform: rotateY(180deg);
}
            
          
!
            
              $(document).ready(function() {
  var classClicked = 'clicked';
  $('.card-flip').click(function() {
    if($(this).hasClass(classClicked)) {
      $(this).removeClass(classClicked);
    }
    else {
      $(this).addClass(classClicked);
    }
  }).mouseleave(function() {
    $(this).removeClass(classClicked);
  });
})
            
          
!
999px

Console