cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <aside id="sidebar85524835107" class="flipper flipped"><div class="pic" onclick="flip(85524835107);"><img src="https://66.media.tumblr.com/f788c5a0e106a1470cd647931202becf/tumblr_n52vvesBjp1r5568mo2_250.jpg" alt="Jan. 23, 1975: A program to calm tensions in the Bedford-Stuyvesant neighborhood of Brooklyn involved block-by-block visits to residents’ homes by police officers for “a few minutes of friendly talk.” The project seemed to bode well for the neighborhood, which roiled with racial tension: “Most of the policemen are white,” The Times reported, “and most of the residents black and they say the visits have brought some startling revelations. ‘You find out these people are the same as other people,’ said Detective Joseph Cunningham.” Photo: Barton Silverman/The New York Times " width="130"></div><div class="pic" onclick="flip(85524835107);"><img src="https://66.media.tumblr.com/e4cccc2ee0f0d893d6ab65bb50d2b8b5/tumblr_n52vvesBjp1r5568mo1_1280.jpg" alt="Jan. 23, 1975: A program to calm tensions in the Bedford-Stuyvesant neighborhood of Brooklyn involved block-by-block visits to residents’ homes by police officers for “a few minutes of friendly talk.” The project seemed to bode well for the neighborhood, which roiled with racial tension: “Most of the policemen are white,” The Times reported, “and most of the residents black and they say the visits have brought some startling revelations. ‘You find out these people are the same as other people,’ said Detective Joseph Cunningham.” Photo: Barton Silverman/The New York Times " width="130"></div></aside>
            
          
!
            
              aside {
        width: 130px;
        margin: 0 auto;
}
.flipper {position: relative;}
      aside.flipper {
        z-index: 1000;
        -webkit-perspective: 1000;
        -moz-perspective: 1000;
        perspective: 1000;
      }
      .flipper .pic {
        -webkit-transform-style: preserve-3d;
        -moz-transform-style: preserve-3d;
        transform-style: preserve-3d;
        -webkit-transition: 1.15s;
        -moz-transition: 1.15s;
        transition: 1.15s;
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        backface-visibility: hidden;
      }
      .flipper.init .pic:last-child {
        -webkit-transition: 0s;
        -moz-transition: 0s;
        transition: 0s;
      }
      .flipper.flipped .pic:first-child,
      .flipper.unflipped .pic:last-child {
        opacity: 0;
      }
      .centerpiece.flipper .pic {
        text-align: center;
        -webkit-transition: 1.5s;
        width: 800px;
      }
      .centerpiece.flipper .pic img {
        max-width: 800px;
      }
      .flipper .pic:last-child, .flipper .pic.lastChild {
        position: absolute;
        top: 0;
      }
      aside.flipper.flipped .pic:first-child {
        -webkit-transform: rotateY(180deg);
        -moz-transform: rotateY(180deg);
        transform: rotateY(180deg);
      }
      aside.flipper.unflipped .pic:last-child {
        -webkit-transform: rotateY(-180deg);
        -moz-transform: rotateY(-180deg);
        transform: rotateY(-180deg);
      }
      .flipper.flipped .pic:last-child {
        opacity: 1.0;
      }
      .flipper .pic:hover {
        cursor: pointer;
      }
      aside.flipper .pic:before,
      aside.flipper .pic:hover:before {
        content: '';
        display: block;
        position: absolute;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0);
      }
      aside.flipper .pic:hover:before {
        background: rgba(0,0,0,0.6);
        z-index:19;
      }
      aside.flipper .pic:hover:after {
        content: '';
        position: absolute;
        top: 40%;
        left: 20%;
        width: 50%;
        text-align: center;
        padding: 1px 5%;
        font: bold 11px/20px Arial, sans-serif;
        color: #FFF;
        -webkit-font-smoothing: antialiased;
        background: #2e2e2e;
        border-radius: 12px;-moz-border-radius: 12px;
        z-index: 20;
      }
      aside.flipper.unflipped .pic:hover:after {
        content: 'See Front';
      }
      aside.flipper.flipped .pic:hover:after {
        content: 'See Back';
      }
      .flipping .pic:before, .flipping .pic:after {
        display: none!important;
      }
      aside.flipper.unflipped .pic:hover {
        z-index: -1;
      }


#rerun-button { display:none; }
            
          
!
            
              function fixHeights(node) {
      var newHeights = $('div'+node).find(':first-child img').outerHeight();
      $('div'+node).find(':last-child img').css({maxHeight:newHeights});
    }

function flip(postId) {
      var flipCP = '#centerpiece'+postId;
      
      fixHeights(flipCP);
      
      $(flipCP).toggleClass('unflipped').toggleClass('flipped');
      $(flipCP).removeClass('init');
      var flipAside = '#sidebar'+postId;
        $(flipAside).addClass('flipping');
        $(flipAside).siblings('.flipper').addClass('flipping');
        $(flipAside).toggleClass('unflipped').toggleClass('flipped');
        setTimeout( function() {
          $(flipAside).removeClass('flipping');
          $(flipAside).siblings('.flipper').removeClass('flipping');
        }, 500);
    }
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console