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

              
                <figure class="rift">
  <img src="http://ecx.images-amazon.com/images/I/517HpPUIsxL.jpg" alt="Era Vulgaris">
  <figcaption class="caption">Era Vulgaris</figcaption>
</figure>

<figure class="rift">
  <img src="http://ecx.images-amazon.com/images/I/413WE38pDRL.jpg" alt="Like Clockwork">
  <figcaption class="caption">Like Clockwork</figcaption>
</figure>

<figure class="rift">
  <img src="http://ecx.images-amazon.com/images/I/71Uj7GcOkZL._SL1500_.jpg" alt="Rated R">
  <figcaption class="caption">Rated R</figcaption>
</figure>

<figure class="rift">
  <img src="http://ecx.images-amazon.com/images/I/51MSV6KQM5L.jpg" alt="Lullabies to Paralyze">
  <figcaption class="caption">Lullabies to Paralyze</figcaption>
</figure>
              
            
!

CSS

              
                /* Base plugin styles */

.rift { 
  width: 300px; /* Define width */
  height: 300px; /* Define height */
  position: relative; 
  overflow: hidden;
  backface-visibility: hidden;
}

.rift img { 
  width: 100%; 
  height: auto; 
  -webkit-filter: blur(5px);
	filter: blur(5px);
}

.rift .caption { 
  position: absolute; 
  top: 50%;
  width: 100%;
  height: 60px; /* Define caption height */
  line-height: 60px; /* Define matched line-height */ 
  margin: -30px 0 0 0; /* Half caption height */
  text-align: center; 
  z-index: 0;
}

.rift span[class*="span"] {
  display: block;
  width: 100%;
  height: 50%;
  overflow: hidden;
  position: absolute;
  left: 0;
  z-index: 1;
  transform: translate3d(0,0,0); /* Acceleration FTW */
  transition: transform .25s; /* Define anim. speed */
}

.rift span.top-span { top: 0; }
.rift span.btm-span { bottom: 0; }

.rift:hover span.top-span { 
  transform: translate(0,-30px); /* Half caption height */
}

.rift:hover > span.btm-span { 
  transform: translate(0,30px); /* Half caption height */
}

/* Non-plugin styles */

body { 
  text-align: center;
  background: #CCC; 
}

.rift { 
  display: inline-block;
  cursor: pointer;
  margin: 20px 0 0 20px; 
}

.rift .caption { 
  color: #FFF;
  background: rgba(0, 0, 0, .75);
}
              
            
!

JS

              
                /**
 * Rift v1.0.0
 * An itsy bitsy image-splitting jQuery plugin
 * 
 * Licensed under the MIT license.
 * Copyright 2013 Kyle Foster @hkfoster
 */
;(function ( $, window, document, undefined ) {

  $.fn.rift = function () {

    return this.each(function () {
      
      // Vurribles
      var element = $(this),
          elemImg = element.find('img'),
          imgSrc  = elemImg.attr('src');
  
      // We be chainin'  
      element
        .prepend('<span class="top-span"></span>')
        .append('<span class="btm-span"></span>')
        .find('span.top-span')
        .css('background', 'url(' + imgSrc + ') no-repeat center top')
        .css('background-size', '100%')
        .parent()
        .find('span.btm-span')
        .css('background', 'url(' + imgSrc + ') no-repeat center bottom')
        .css('background-size', '100%');
    });
  };
})( jQuery, window, document );

$('.rift').rift();
              
            
!
999px

Console