Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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 id="filter-wrap">

  <div class="page-wrap">
      <ul class=" gallery-wrap list">

        <li class="gallery-item">
          <div class="gallery-link">
            <h2 class="gallery-name">Patrick Hill</h2>
            <div class="gallery-department">Digital</div>
              
              <!-- <img class="headshot" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/42053/hill-p.jpg" alt="Patrick Hill headshot" width="200" height="200"> -->

              <img class="headshot" src="http://placehold.it/200x200/999999/ffffff/&text=headshot" width="200" height="200">

              <div class="hidden person-info-wrap">
                <ul class="person-info">
                  <li class="filter-full_name">Patrick Hill</li>
                  <li>Senior Web Developer</li>
                  <li><a href="#">email@doeanderson.com</a></li>
                  <li class="filter-phone">ext. 9999</li>
                </ul>
              </div>

            <a class="page-link" href="#">http://people.doe1915.com/person/patrick-hill.html</a>
          </div>
        </li>
        
        <li class="gallery-item">
          <div class="gallery-link">
            <h2 class="gallery-name">Patrick Hill</h2>
            <div class="gallery-department">Digital</div>
              
              <!-- <img class="headshot" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/42053/hill-p.jpg" alt="Patrick Hill headshot" width="200" height="200"> -->

              <img class="headshot" src="http://placehold.it/200x200/999999/ffffff/&text=headshot" width="200" height="200">

              <div class="hidden person-info-wrap">
                <ul class="person-info">
                  <li class="filter-full_name">Patrick Hill</li>
                  <li>Senior Designer</li>
                  <li><a href="#">email@doeanderson.com</a></li>
                  <li class="filter-phone">ext. 9999</li>
                </ul>
              </div>

            <a class="page-link" href="#">http://people.doe1915.com/person/patrick-hill.html</a>
          </div>
        </li>
        
        <li class="gallery-item">
          <div class="gallery-link">
            <h2 class="gallery-name">Patrick Hill</h2>
            <div class="gallery-department">Digital</div>
              
              <!-- <img class="headshot" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/42053/hill-p.jpg" alt="Patrick Hill headshot" width="200" height="200"> -->

              <img class="headshot" src="http://placehold.it/200x200/999999/ffffff/&text=headshot" width="200" height="200">

              <div class="hidden person-info-wrap">
                <ul class="person-info">
                  <li class="filter-full_name">Patrick Hill</li>
                  <li>Senior Web Developer</li>
                  <li><a href="#">email@doeanderson.com</a></li>
                  <li class="filter-phone">ext. 9999</li>
                </ul>
              </div>

            <a class="page-link" href="#">http://people.doe1915.com/person/patrick-hill.html</a>
          </div>
        </li>

      </ul>
  </div><!-- /page-wrap -->

</div><!-- end of #filter-wrap -->

<div class="tag">
<a href="https://dribbble.com/shots/2593762-People-Directory">See this demo in context on Dribbble.</a>
</div>

<div class="lightbox-item hidden"></div>
<div class="lightbox-bg hidden"></div>
<div class="lightbox-img hidden"></div>




              
            
!

CSS

              
                @import "bourbon";

// ---------------------------
// variables
// ---------------------------
$border: #e7e7e7;
$green: #bbb900;
$purple: #590b70;
$light-grey: #474747;
$shadow-light: 0px 2px 10px rgba(0,0,0,.3);
$shadow: 0px 3px 15px rgba(0,0,0,.35);
$shadow-dark: 0px 3px 20px rgba(0,0,0,.5);
$shadow-darker: 0px 5px 20px 2px rgba(0,0,0,.9);
$link-color: $purple;

// font stacks
$font-sans: "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
$font-sans-thin: "Proxima N W01 Thin Reg", "HelveticaNeue-Light", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
$font-sans-light: "Proxima N W01 Light", "HelveticaNeue-Light", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
$font-sans-reg: "Proxima N W01 Reg", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
$font-sans-semi: "Proxima N W01 Smbd", "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, sans-serif;
$font-sans-feature: 'Clarendon LT W01 Light', Georgia, 'Times New Roman', Times, serif;
$font-serif-light: 'Clarendon LT W01 Light', Georgia, 'Times New Roman', Times, serif;
$font-serif-sc: 'ClarendonWideW01SC-Regu', Georgia, 'Times New Roman', Times, serif;

// breakpoints
$screen-xs: 700px;

$gray-base:    #000;
$gray-darker:  lighten($gray-base, 13.5%); // #222
$gray-dark:    lighten($gray-base, 20%);   // #333
$gray:         lighten($gray-base, 35%); // #555
$gray-light:   lighten($gray-base, 60%); // #777
$gray-lighter: #cbcbcb; // #eee

$font-family-sans-serif:  $font-sans-thin;
$font-family-serif:       $font-serif-sc;


// ---------------------------
// Theme CSS
// ---------------------------
body { 
  padding-top: 50px; 
  background-color: $gray-dark;
  overflow-x: hidden;
  font-family: $font-family-sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
a {
  color: $link-color;
  text-decoration: none;
}
.page-wrap {
  padding: 40px 0;
  @media (max-width: $screen-xs) {
  	padding: 60px 0 0;
	}
}
.gallery-wrap {
	list-style: none;
	padding: 0;
	position: relative;
	z-index: 10;
	text-align: center;
}
.gallery-item {
	text-align: center;
	margin: 40px;
	position: relative;
	display: inline-block;
	@media (max-width: $screen-xs) {
		margin: 20px;
	}
}
.gallery-link {
	display: block;
	text-align: center;
	@include transition(all .6s cubic-bezier(0.19, 1, 0.22, 1));
  cursor: pointer;
	img {
		box-shadow: $shadow-dark;
		position: relative;
    display: block;
		z-index: 10;
		width: 120px;
		height: auto;
		margin: 10px;
	}
	.gallery-name {
		font-size: 14px;
		color: $gray-light;
		margin: 0;
	}
	.gallery-department {
    color: $gray;
    font-weight: 900;
    font-size: 12px;
    line-height: 1;
    font-family: $font-family-serif;
	}
	.page-link {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: 10;
		text-indent: -9000px;
		overflow: hidden;
		background-color: white;
		background-color: rgba(255,255,255,0);
		-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
		cursor: pointer;
	}
	&:after {
		content:"";
		display: block;
		position: absolute;
		left: 0;
		top: 0;
		z-index: 0;
		width: 100%;
		height: 100%;
		background-color: $green;
		opacity: 0;
		box-shadow: none;
		@include transform(scale(.9));
		@include transition(all 2s cubic-bezier(0, 1, 0.22, 1));
	}
	

	@media (min-width: $screen-xs) {
		img { 
			width:auto; 
			margin: 0;
		}
		.gallery-name {
			position: absolute;
			bottom: 10px;
			left: -30px;
			z-index: 20;
			text-align: left;
			background-color: $gray-lighter;
			font-size: 12px;
			color: $gray-dark;
			padding: 10px 20px;
			@include transition(all 1.3s cubic-bezier(0.19, 1, 0.22, 1) 0s);
			@include transform(translateX(50%));
			opacity: 0;
		}
		.gallery-department {
	    position: absolute;
	    top: -25px;
	    right: 0;
	    z-index: 10;
	    text-transform: uppercase;
	    letter-spacing: .1em;
	    text-align: right;
	    font-family: $font-family-serif;
		}
		&:hover {
			@include transform(scale(1.1));
			&:after {
				@include transform(scale(1.2));
				opacity: 1;
				box-shadow: $shadow-dark;
			}
			.gallery-name {
				@include transform(translateX(0));
				opacity: 1;
			}
		}
	} // end min-width xs

	@media (max-width: $screen-xs) {

	} // end max-width xs
}
.lightbox-item {
	display: block;
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 1200;
	@include transform(translate(-50%,-50%));
	width: 90%;
	max-width: 800px;
	height: 90%;
	max-height: 500px;
	img {
		position: absolute;
    top: 50%;
    @include transform(translate(0%,-50%));
    box-shadow: $shadow-dark;
    z-index: 30;
	}
	h2 { 
    display:none; 
  }
  .person-page-title {
    font-size: 1.3em;
    margin-top: 0em;
    margin-bottom: 1em;
    display: block;
    color: $green;
  }
	.gallery-department {
    position: absolute;
    top: -30px;
    left: 0;
    z-index: 5;
    color: $gray-dark;
    text-transform: uppercase;
    font-size: 60px;
    line-height: .9;
    font-family: $font-family-serif;
	}
	.person-info-wrap {
		width: 100%;
		padding-left: 100px;
		display: block !important;
		position: absolute;
		top: 50%;
		left: 0px;
		@include transform(translateY(-50%));
		z-index: 5;
		box-sizing: border-box;
	}
	.person-info {
		padding: 60px 50px 60px 140px;
		margin: 0;
		box-shadow: $shadow;
		background-color: white;
		list-style: none;
		box-sizing: border-box;
		color: $gray-light;
		overflow: hidden;
		li {
			line-height: 1.8;
		}
		li.filter-full_name {
			border-top: 1px solid $gray-light;
			padding-top: 1.4em;
			text-transform: uppercase;
			letter-spacing: .1em;
			font-family: $font-family-sans-serif;
		}
		li:last-child {
			border-bottom: 1px solid $gray-light;
			padding-bottom: 1.5em;
		}
		.filter-common_name, .filter-first_name, .filter-last_name, .filter-department {
			display: none;
		}
	}
	.page-link {
    position: absolute;
    bottom: 0px;
    z-index: 50;
    right: 100px;
    background: #3C3C3C;
    padding: 10px 20px;
    color: #BBB900;
    box-shadow: $shadow;
    @include transform(translateY(50%));
	}
 @media (max-width: $screen-xs) {
 		text-align: center;
    img {
    	position: relative;
    	top: 0;
    	@include transform(none);
    }
    .person-info-wrap {
    	padding-left: 0px;
    	@include transform(none !important);
    }
    .person-info {
    	padding: 20px 60px;
    	border: none;
    }
    .person-info li {
    	line-height: 1.4
    }
    .page-link {
    	@include transform(none !important);
    	right: 0;
    	left: 0;
    }
    .gallery-department {
    	display: none;
    }
  }
}
.lightbox-img {
	position: absolute;
  z-index: 2000;
}
.lightbox-item-backdrop {
	display: block;
	height: 100%;
	position: absolute;
	top: 0;
	left: 50px;
	right: 50px;
	margin: auto;
	background-color: $green;
	z-index: 0;
	box-shadow: $shadow;
	@media (max-width: $screen-xs) {
		left: 20px;
		right:20px;
	}
}
.lightbox-bg {
	width: 100%;
	height: 100%;
	position: fixed;
	left: 0;
	top: 0;
	z-index: 100;
	background-color: rgba(0,0,0,.8);	
	cursor: pointer;
	z-index: 1100;
}
.lightbox-single {
  position: relative;
  top: 0;
  left: 0;
  @include transform(none);
  margin: 50px auto;
  padding: 50px 0;
  z-index: 20;
  img {opacity:1}
  .person-info-wrap {
  	position: relative;
  	@include transform(none);
  }
}
.back-link {
	text-align: center;
	a {
		display: inline-block;
		padding: 10px 20px;
		background: $green;
		box-shadow: $shadow;
		@include transition(all .3s ease);
		&:hover {
			//@include transform(translate(0,-2px));
			box-shadow: $shadow-darker;
			text-decoration: none;
			background-color: lighten($green,8%);
		}
	}
}
.gallery-item-filler {
	visibility: hidden;
	height: 0;
}

.footer {
  padding: 0 0 5em;
}

.dealer-panel-title {
  min-height: 34px;
}

.btn-default {
	color: white;
	border-color: rgba(0,0,0,0.2);
	background: rgba(0,0,0, 0.05);
	border-radius: 0px;
	&:hover {
		color: white;
		background: rgba(0,0,0, 0.1);
		border-color: rgba(0,0,0,0.2);
	}
}

.inverse {
  color: $light-grey;
}
.hidden {
  display: none !important;
}

.tag {
  text-align: center;
  a {
   color: #666; 
    @include transition(all .2s ease-out 0s);
    &:hover {
      color: $green;
    }
  }
}
              
            
!

JS

              
                (function ($, window, document, undefined) {
'use strict';

$(function () {


  // new TimelineMax({onComplete:myFunction, repeat:2, repeatDelay:1, yoyo:true});

  function animateImg(xPosSource, yPosSource, xPosDest, yPosDest) {
    var tl = new TimelineMax();  
    tl.fromTo(".lightbox-bg", .4, {scaleX:0}, {scaleX:1, transformOrigin:"right center", ease:Power4.easeInOut})
      .fromTo(".lightbox-img", .4, {display:'block', left:xPosSource, top:yPosSource, scale:1.1, opacity:0, z:0 }, { scale:1.3, opacity:1, z:0, ease:Power1.easeOut},"-=.3")
      .to(".lightbox-img", .5, {left:xPosDest, top:yPosDest, scale:1, z:0, ease:Power4.easeInOut})
      .fromTo(".lightbox-item .headshot", .3, {opacity:0}, {opacity:1})
      .to(".lightbox-img", 0, {display:'none'})
      .fromTo(".lightbox-item-backdrop", 1.8, {opacity: 0, x:-80, scaleX:0 }, {scaleX:1, x:0, opacity:1, transformOrigin: "left center", ease:Power4.easeOut},"-=.7")
      .fromTo(".lightbox-item .person-info-wrap", .8, {opacity:0, scale:0}, {opacity: 1, scale:1, transformOrigin: "left center", ease:Power4.easeOut},"-=1.5")
      .fromTo(".lightbox-item .gallery-department", .8, {opacity: 0, y:50, z:0}, {opacity: 1, y:0, z:0, ease:Power4.easeOut},"-=1.2")
      .from(".lightbox-item .page-link", 1, {opacity: 0, x:-80, ease:Power4.easeOut}, "-=1.3")
      ;
  }
  function setImg(xPosSource, yPosSource, xPosDest, yPosDest) {
    var tl = new TimelineMax();
    tl.set(".lightbox-bg", {scaleX:1, transformOrigin:"right center"})
      .set(".lightbox-item .headshot", {opacity:1})
      .set(".lightbox-item-backdrop", {scaleX:1, x:0, opacity:1, transformOrigin: "left center"})
      .set(".lightbox-item .person-info-wrap", {opacity: 1, scale:1, transformOrigin: "left center"})
      .set(".lightbox-item .gallery-department", {opacity: 1, y:0, z:0})
      ;
  }

  var viewportWidth = window.innerWidth;

  function openLightbox(obj) {
    $(".lightbox-bg, .lightbox-img, .lightbox-item").removeClass("hidden");
    
    var content = obj.contents().clone();
    $(".lightbox-item").append(content, "<div class='lightbox-item-backdrop'></div>");
    
    var sourceImg         = obj.children('.headshot');
    var sourceImgPos      = sourceImg.offset(); 
    var destinationImgPos = $(".lightbox-item .headshot").offset(); 
    var $imgAni           = sourceImg.clone().appendTo(".lightbox-img");
  
    if (viewportWidth <= 480) {
      setImg(sourceImgPos.left, sourceImgPos.top, destinationImgPos.left, destinationImgPos.top);
    } else {
      animateImg(sourceImgPos.left, sourceImgPos.top, destinationImgPos.left, destinationImgPos.top);
    }
  }

  function closeLightbox() {
    // tl1.clear;
    var tl2 = new TimelineMax({onComplete:function(){ 
      TweenMax.killAll(); 
      $(".lightbox-bg, .lightbox-item, .lightbox-img").addClass("hidden");
      $(".lightbox-bg, .lightbox-item, .lightbox-img").removeAttr( "style" );
      $(".lightbox-img, .lightbox-item").contents().remove();
    }})
    tl2.fromTo(".lightbox-item", .4, {opacity:1, scale:1, ease:Power4.easeInOut}, {opacity:0, scale:0, ease:Power4.easeInOut});
    
  } 


  var olderThanIe10 = $("html").hasClass("lt-ie10");

  if (!olderThanIe10) { 
    $(".gallery-link").click(function(event) {
      event.preventDefault();
      openLightbox( $(this) );
    });
  }
  
  $(".lightbox-bg").click(function(event) {
    closeLightbox();
  });



});
})(jQuery, window, document);
              
            
!
999px

Console