cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm 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. We'll also process your JavaScript with Babel.

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

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
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console