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

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

              
                <div id="photo-gallery">

		<div class="project">
			<div class="frame">
				<div class="frame-inside">
					<div class="border-frame style1"></div>
					<div class="container-image"><img src="http://pixel-salad.com/website/photo_gallery/img/landscape1.jpg"></div>
				</div>
			</div>
			<div class="details">
				<div class="title">Some plants</div>
				<div class="subtitle">This is a subtitle</div>
			</div>
			<div class="expand">
				<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec magna purus, bibendum maximus elit at, luctus ultricies purus. Vestibulum vitae nisl mi. Sed nec purus orci.</p>
				<p>Nam risus orci, efficitur in pellentesque aliquet, efficitur eget orci. Pellentesque suscipit tellus a massa auctor laoreet. Quisque rutrum faucibus leo, a mattis tellus posuere a. Donec vel suscipit magna, sagittis scelerisque orci.</p>
				<p class="extra-infos">2009 - India</p>
			</div>
		</div>

		<div class="project">
			<div class="frame">
				<div class="frame-inside">
					<div class="border-frame style2"></div>
					<div class="container-image"><img src="http://pixel-salad.com/website/photo_gallery/img/portrait1.jpg"></div>
				</div>
			</div>
			<div class="details">
				<div class="title">Starry night</div>
				<div class="subtitle">This is a subtitle</div>
			</div>
			<div class="expand">
				<p>Pellentesque commodo elementum ullamcorper. Nullam ut finibus massa, eu accumsan leo. Duis eget scelerisque urna, ac molestie lorem. Sed quis egestas mauris. Etiam porta est tellus, non vehicula elit consequat at.</p>
				<p>Phasellus quis varius est. Curabitur viverra nisi quis malesuada luctus. Sed imperdiet elementum tellus, ut scelerisque est sodales ac. Ut commodo placerat nisl, eget hendrerit dolor.</p>
				<p class="extra-infos">2012 - Croatia</p>
			</div>

		</div>

		<div class="project">
			<div class="frame">
				<div class="frame-inside">
					<div class="border-frame style3"></div>
					<div class="container-image"><img src="http://pixel-salad.com/website/photo_gallery/img/landscape2.jpg"></div>
					
				</div>
			</div>
			<div class="details">
				<div class="title">aww yisss pollen</div>
				<div class="subtitle">This is a subtitle</div>
			</div>
			<div class="expand">
				<p>Sed feugiat in augue eu cursus. Integer euismod porta mi ac suscipit. Fusce eleifend ultricies nibh id vestibulum.</p>
				<p>Vestibulum elementum cursus nisi sit amet blandit. Praesent convallis, quam eu ultricies bibendum, augue nisl lacinia lacus, sit amet euismod dui nisi eget purus. Nulla ut nisl volutpat, laoreet diam interdum, lacinia felis. Curabitur accumsan ultrices magna</p>
				<p class="extra-infos">2013 - California</p>
			</div>
		</div>

		<div class="project">
			<div class="frame">
					<div class="frame-inside">
						<div class="border-frame style4"></div>
					<div class="container-image"><img src="http://pixel-salad.com/website/photo_gallery/img/portrait2.jpg"></div>
					</div>
			</div>
			<div class="details">
				<div class="title">Flower essence</div>
				<div class="subtitle">This is a subtitle</div>
			</div>
			<div class="expand">
				<p>nec imperdiet ipsum luctus vel. Cras neque quam, posuere sed suscipit pharetra, ultricies sed sem. Sed mattis tristique condimentum. Mauris a orci nec sem pretium porttitor. Nam viverra mi nec mauris molestie accumsan.</p>
				<p class="extra-infos">2014 - France</p>
			</div>
		</div>

		<div class="project">
			<div class="frame">
					<div class="frame-inside">
						<div class="border-frame style5"></div>
					<div class="container-image"><img src="http://pixel-salad.com/website/photo_gallery/img/landscape3.jpg"></div>
					</div>
			</div>
			<div class="details">
				<div class="title">No time to explain, jump in!</div>
				<div class="subtitle">This is a subtitle</div>
			</div>
			<div class="expand">
				<p>In hac habitasse platea dictumst. Proin viverra enim nulla, id auctor leo vehicula quis. Nam hendrerit quam et ultricies vehicula. Donec sed risus ligula. Curabitur ac metus odio. Cras vehicula tempor elit nec venenatis. Donec euismod fringilla aliquet. Cras non lacus velit.</p>
				<p class="extra-infos">2015 - UK</p>
			</div>
		</div>

		<div class="project">
			<div class="frame">
					<div class="frame-inside">
						<div class="border-frame style6"></div>
					<div class="container-image"><img src="http://pixel-salad.com/website/photo_gallery/img/portrait3.jpg"></div>
					</div>
			</div>
			<div class="details">
				<div class="title">Quiet place</div>
				<div class="subtitle">This is a subtitle</div>
			</div>
			<div class="expand">
				<p>Suspendisse molestie, dolor at maximus sagittis, magna diam convallis nunc, sit amet iaculis ipsum arcu a nisi. Vestibulum pellentesque in lorem non hendrerit. Mauris in vestibulum orci. Sed tellus neque, cursus a eros nec, tempor sodales ligula.</p>
				<p class="extra-infos">2016 - Sweden</p>
			</div>
		</div>

</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Open+Sans|Open+Sans+Condensed:700');

@media (max-height:500px) {
	#photo-gallery{
		padding: 30px 100px 80px 30px;
	}
	.frame-inside{
		padding: 35px;
	}
}
@media (min-height:501px) {
	#photo-gallery{
		padding: 100px;
	}
	.frame-inside{
		padding: 60px;
	}
}
body{
	margin: 0;
	padding: 0;
	color: #333;
	font-family: 'Open Sans', sans-serif;
  	text-rendering: optimizeLegibility;
	overflow-y: hidden;
	background: url("http://pixel-salad.com/website/photo_gallery/img/white-wall.jpg");
	background-repeat: repeat;
}
body::after{
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
	background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,0.15));
}
#photo-gallery{
	position: relative;
	white-space: nowrap;
	height: 100vh;
	width: 100%;
	box-sizing: border-box;
}
.project{
	position: relative;
	display: inline-block;
	margin: 0;
	padding: 0;
	vertical-align: middle;
	height: 100%;
	width: auto;
    width: initial;
	min-height: 200px;
	max-height: 600px;
	margin-right:100px;
	box-shadow: 
		inset 1px 1px 3px rgba(0,0,0,.3),
		1px 1px 2px rgba(0,0,0,.2),
		40px 35px 70px -10px rgba(0,0,0,.5),
		-20px -20px 100px -10px rgba(255,255,255,.8);

	transition: all .3s ease-in-out;
	-webkit-transition: all .3s ease-in-out;
	-moz-transition: all .3s ease-in-out;
	cursor: pointer;
}
.frame{
	position: relative;
	height: 100%;
	width: auto;
    width: initial;
	margin: 0;
	overflow: hidden;
}
.frame::after{
	/* HIGHLIGHT ON TOP OF FRAME */
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	margin: 0;
	padding: 0;
	height: 100%;
	width: 100%;
	box-shadow: inset 0px 3px 0px rgba(255,255,255,0.5);
}
.frame-inside{
	position: relative;
	height: 100%;
	width: auto;
	margin: 0;
	background-color: #fff;
	box-sizing: border-box;
	transition: all .3s ease-in-out;
	-webkit-transition: all .3s ease-in-out;
	-moz-transition: all .3s ease-in-out;

	-webkit-transform-origin: center center;
	-moz-transform-origin: center center;
	-o-transform-origin: center center;
	transform-origin: center center;
}
.container-image{
	position: relative;
	height: 100%;
	width: auto;
	width: initial;
}
.container-image img{
	position: relative;
	height: 100%;
	width: auto;
}
.border-frame{
	position: absolute;
	margin: 0;
	padding: 0;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	box-shadow: inset 0px 10px 30px rgba(0,0,0,0.3);
	overflow: hidden;
}
.border-frame::after{
	/* GLASS REFLECTION */
	content: '';
	position: absolute;
	margin: 0;
	padding: 0;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(rgba(255,255,255,0.2), rgba(255,255,255,0));
	-webkit-transform: translateX(50%) skewX(-20deg);
	-moz-transform: translateX(50%) skewX(-20deg);
	-o-transform: translateX(50%) skewX(-20deg);
	transform: translateX(50%) skewX(-20deg);
	transition: opacity .3s ease-in-out;
	-webkit-transition: opacity .3s ease-in-out;
	-moz-transition: opacity .3s ease-in-out;
}

.details{
	position: relative;
	margin: 0;
	padding: 0;
	top: 20px;
	opacity: 0;

	transition: all .3s ease-in-out;
	-webkit-transition: all .3s ease-in-out;
	-moz-transition: all .3s ease-in-out;
	pointer-events: none;
}
.details .title{
	font-family: 'Open Sans Condensed', sans-serif;
	text-transform: uppercase;
	font-size: 20px;
	color: #333;
}
.details .subtitle{
	font-size: 15px;
	color: #333;
}

.expand{
	position: absolute;
	font-size: 15px;
	color: #333;
	right: -425px;
	top: 0;
	width: 400px;
	height: 100%;
	white-space: normal;
	text-align: justify;
	transition: all .3s ease-in-out;
	-webkit-transition: all .3s ease-in-out;
	-moz-transition: all .3s ease-in-out;
	pointer-events: none;
	display: none;
	opacity: 0;
}
.expand p{
	margin-top: 20px;
}
.expand .extra-infos{
	font-family: 'Open Sans Condensed', sans-serif;
	text-transform: uppercase;
	text-align: right;
	font-size: 14px;
}

.frame:hover  .frame-inside{
	-webkit-transform: scale(2.2);
	-moz-transform: scale(2.2);
	-o--transform: scale(2.2);
	transform: scale(2.2);
}

.active:hover::after{
	opacity: 0.5;
}
.frame:hover .border-frame::after{
	opacity: 0;
}

.active{
	margin-right: 500px; 
}
.active::after{
	content: 'x';
	position: absolute;
	font-size: 50px;
	text-align: center;
	color: #fff;
	top: 0;
	left: 0;
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	background-color: #000;
	opacity: 0;

	display:flex;
	align-items: center;
	justify-content: center;
	transition: opacity .3s ease-in-out;
	-webkit-transition: opacity .3s ease-in-out;
	-moz-transition: opacity .3s ease-in-out;
}
.active .details, .active .expand{
	display: block;
	opacity: 1;
}
.active .border-frame::after{
	opacity: 0;
}

/* FRAME CUSTOMIZATION */
.style1{
	border: solid 20px #333;
}
.style2{
	border: solid 10px #fff;
}
.style3{
	border: solid 15px #a52f2f;
}
.style4{
	border: solid 25px #eee;
}
.style5{
	border: solid 8px #222;
}
.style6{
	border: solid 35px #ffffff;
}
              
            
!

JS

              
                $(function(){

	var i = 0;
	var myResizeTimer = null;

	function scrollHorizontally(e) {
	    e = window.event || e;
	    var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
	    document.documentElement.scrollLeft -= (delta*40);
	    document.body.scrollLeft -= (delta*40);
	    e.preventDefault();
	}
	if (window.addEventListener) {
	    // IE9, Chrome, Safari, Opera
	    window.addEventListener("mousewheel", scrollHorizontally, false);
	    // Firefox
	    window.addEventListener("DOMMouseScroll", scrollHorizontally, false);
	} else {
	    // IE 6/7/8
	    window.attachEvent("onmousewheel", scrollHorizontally);
	}

	$(".project").click(function(){

		var otherActive = null;

		//FIND OTHER ACTIVE ELEMENT AND DESACTIVATE IT
		if( $(".active").length>0 ) otherActive = $(".active");
		var tempMargin = 0;
		if( (otherActive != null)&&(otherActive.index() !== $(this).index()) ){
			if((otherActive.index() < $(this).index())) tempMargin = 450;
			$(otherActive).toggleClass("active");
		}
		//ACTIVATE NEW ELEMENT
		if( $(this).hasClass("active") ==false ){
			var targetPosition = $(this).position().left - 40 - tempMargin;
			$(window).scrollTo(targetPosition, 500, {axis:'x'});
		}
		$(this).toggleClass("active");
	})

	window.onresize = function(){
		if(myResizeTimer != null) clearTimeout(myResizeTimer);
    	myResizeTimer = setTimeout(function(){
    		window.history.go(0);
    	}, 100);
	}

});
              
            
!
999px

Console