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

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

              
                <!-- 
Hover or Click in each element to see flip and bounceInLeft Effects.
Best view in full preview.
 -->

<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Responsive List</title>
	<link href='https://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
</head>
<body>

<div class="responsive">
<ul class="content">

	<!-- 1 -->
	<li>
		<div class="card-front">
			<h2><b>What is Lorem ipsum?</b></h2>
			<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis condimentum.</p>
		</div>
		<div class="card-back">
      <h2><b>Click here</b></h2>
		</div>

		<!-- Content -->
		<div class="all-content">
			<h1>What is Lorem ipsum?</h1>
		</div>
	</li>

	<li>
		<div class="card-front">
			<h2><b>Contrary to popular belief</b></h2>
			<p>Aenean imperdiet odio id dictum elementum. Donec vitae.</p>
		</div>
		<div class="card-back">
			<h2><b>Click here</b></h2>
		</div>

		<!-- Content -->
		<div class="all-content">
			<h1>Contrary to popular belief</h1>
		</div>
	</li>

	<li>
		<div class="card-front">
			<h2><b>In vulputate sem a arcu semper</b></h2>
			<p>Donec ac ipsum quis arcu sagittis placerat. Etiam augue felis.</p>
		</div>
		<div class="card-back">
			<h2><b>Click here</b></h2>
		</div>

		<!-- Content -->
		<div class="all-content">
			<h1>In vulputate sem a arcu semper</h1>
		</div>
	</li>


	<!-- 2 -->
	<li>
		<div class="card-front">
			<h2><b>Etiam quis sapien interdum</b></h2>
			<p>Praesent sodales et tellus eu euismod. Suspendisse lobortis.</p>
		</div>
		<div class="card-back">
			<h2><b>Click here</b></h2>
		</div>

		<!-- Content -->
		<div class="all-content">
			<h1>Etiam quis sapien interdum</h1>
		</div>
	</li>

	<li>
		<div class="card-front">
			<h2><b>Vivamus metus massa</b></h2>
			<p> Phasellus vel nulla bibendum dolor pellentesque lacinia</p>
		</div>
		<div class="card-back">
			<h2><b>Click here</b></h2>
		</div>

		<!-- Content -->
		<div class="all-content">
			<h1>Vivamus metus massa</h1>
		</div>
	</li>
	<li>
		<div class="card-front">
			<h2><b>Integer consequat vitae turpis</b></h2>
			<p>  Nam id pretium arcu, at vestibulum mauris. Curabitur.</p>
		</div>
		<div class="card-back">
			<h2><b>Click here</b></h2>
		</div>

		<!-- Content -->
		<div class="all-content">
			<h1>Integer consequat vitae</h1>
		</div>
	</li>


	<!-- 3 -->
	<li>
		<div class="card-front">
			<h2><b>Duis tellus dui vehicula</b></h2>
			<p>Morbi ac scelerisque magna, at tincidunt est vivamus</p>
		</div>
		<div class="card-back">
			<h2><b>Click here</b></h2>
		</div>
		
		<!-- Content -->
		<div class="all-content">
			<h1>Duis tellus dui vehicula</h1>
		</div>
	</li>

	<li>
		<div class="card-front">
			<h2><b>Ligula nulla tempus sem</b></h2>
			<p>In iaculis purus sit amet auctor mollis, lorem ipsum dolor sit</p>
		</div>
		<div class="card-back">
			<h2><b>Click here</b></h2>
		</div>

		<!-- Content -->
		<div class="all-content">
			<h1>Ligula nulla tempus sem</h1>
		</div>
	</li>

	<li>
		<div class="card-front">
			<h2><b>Class aptent taciti sociosqu</b></h2>
			<p>Cultrices posuere cubilia Curae; Quisque consectetur tortor</p>
		</div>
		<div class="card-back">
			<h2><b>Click here</b></h2>
		</div>

		<!-- Content -->
		<div class="all-content">
			<h1>Class aptent taciti sociosqu</h1>
		</div>
	</li>

</ul>
</div>

</body>
</html>
              
            
!

CSS

              
                @import "compass/css3";

@import "compass/reset";

$default-transition-duration: 400ms;
$perspective: 1000;

body, html {
	height:100%;
}

body {
	background: #212121;
	color: #fff;
	font-family: 'Oswald', sans-serif;
}

/**
*
* Responsive list
*
**/
.responsive {
	width: 100%;
	height: 100%;
}

.content {
float: left;
width: 100%;
height: 100%;


	img { width: 100%;
		  height: 101%; }

	li { float: left;
		 border-bottom: 1px solid #2c2c2c;
		 border-left: 1px solid #2c2c2c;
		 width: 33.2%;
		 height: 33%;
		 position: relative;
			
			&:hover {
				cursor: pointer;
				.card-front { 
					@include transform(rotateX(50deg));
					@include transform3d(perspective($perspective) rotateX(50deg)); 
				}
				.card-back { 
					z-index: 950;
					@include transform(rotateX(0deg));
					@include transform3d(perspective($perspective) rotateX(0deg)); 
				}
			}

			/* Colors Hover */

			&:nth-child(1) .card-back,
			&:nth-child(9) .card-back { background: #6b6b6b; }

			&:nth-child(2) .card-back{ background: #22cfda; }

			&:nth-child(3) .card-back{ background: #162b53; }

			&:nth-child(4) .card-back{ background: #ee2ca3; }

			&:nth-child(5) .card-back{ background: #d0ce06; }

			&:nth-child(6) .card-back{ background: #7381a8; }

			&:nth-child(7) .card-back{ background: #da222b; }

			&:nth-child(8) .card-back{ background: #f07938; }


			&:first-child, &:last-child  {
				background-color: #151515;
			}

		}

	.card-front,
	.card-back  { text-align: right;
				  @include backface-visibility(hidden);
			      @include single-transition(transform);
			      display: block;
			      height: 100%;
			      position: absolute;
			      width: 100%;  }

	.card-front {
    	@include transform3d(perspective($perspective) rotateX(0));
    	z-index: 900; }

    .card-back {
    	@include rotateX(-180deg);
     	z-index: 800; }


	h2 { font-size: 28px;
		 float:right;
		 width: 100%;
		 margin-bottom: 10px;
		 text-transform: uppercase;
		 margin-right: 20px;
		 margin-top: 20px;

			b { float: right;
			    width : 55%; }
		}

	p   { line-height: 1.3em;
		  color: #3d3d3d;
		  width: 90%;
		  float: right;
		  margin-right: 20px; }
}

.close {
	cursor: pointer;
	position: absolute;
	right: 0;
	top: 0;
	background: #fff;
	color: #111;
	text-decoration: none;
	font-size: 20px;
	padding:10px 20px;
}

.active{
width: 100% !important;
height: 100% !important;

	.all-content {
		position: absolute;
		left: 10px;
		top: 20px;

		h1 { font-size: 80px;
			 width: 50%; }
	}
}


@media (min-width: 440px) and (max-width: 750px){

	.content {
		h2 {
			font-size: 22px;
		}
		
		p {
			font-size: 13px;
		}
		
		li {
			width: 33.1%;
		}
	}

}

@media (max-width: 439px){

	.content {
		h2 {
			font-size: 15px;
		}
		
		p {
			font-size: 13px;
		}
		
		li {
			width: 33%;
		}
	}	

}

@media (max-height: 450px){

	.content {
		h2 {
			font-size: 22px;

			b { width: 100%; }
		}
		
		li {
			width: 33%;
		}
	}	

}


/**
*
* Animate.css
* From : https://daneden.me/animate/
*
**/

.animated{-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:1s;-moz-animation-duration:1s;-ms-animation-duration:1s;-o-animation-duration:1s;animation-duration:1s;}.animated.hinge{-webkit-animation-duration:2s;-moz-animation-duration:2s;-ms-animation-duration:2s;-o-animation-duration:2s;animation-duration:2s;}@-webkit-keyframes bounceIn {
    0% {
        opacity: 0;
        -webkit-transform: scale(.3);
    }   50% {
        opacity: 1;
        -webkit-transform: scale(1.05);
    }
    
    70% {
        -webkit-transform: scale(.9);
    }
    
    100% {
        -webkit-transform: scale(1);
    }
}

@-moz-keyframes bounceIn {
    0% {
        opacity: 0;
        -moz-transform: scale(.3);
    }
    
    50% {
        opacity: 1;
        -moz-transform: scale(1.05);
    }
    
    70% {
        -moz-transform: scale(.9);
    }
    
    100% {
        -moz-transform: scale(1);
    }
}

@-o-keyframes bounceIn {
    0% {
        opacity: 0;
        -o-transform: scale(.3);
    }
    
    50% {
        opacity: 1;
        -o-transform: scale(1.05);
    }
    
    70% {
        -o-transform: scale(.9);
    }
    
    100% {
        -o-transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(.3);
    }
    
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    
    70% {
        transform: scale(.9);
    }
    
    100% {
        transform: scale(1);
    }
}

.bounceIn {
    -webkit-animation-name: bounceIn;
    -moz-animation-name: bounceIn;
    -o-animation-name: bounceIn;
    animation-name: bounceIn;
}
@-webkit-keyframes bounceInUp {
    0% {
        opacity: 0;
        -webkit-transform: translateY(2000px);
    }
    
    60% {
        opacity: 1;
        -webkit-transform: translateY(-30px);
    }
    
    80% {
        -webkit-transform: translateY(10px);
    }
    
    100% {
        -webkit-transform: translateY(0);
    }
}
@-moz-keyframes bounceInUp {
    0% {
        opacity: 0;
        -moz-transform: translateY(2000px);
    }
    
    60% {
        opacity: 1;
        -moz-transform: translateY(-30px);
    }
    
    80% {
        -moz-transform: translateY(10px);
    }
    
    100% {
        -moz-transform: translateY(0);
    }
}

@-o-keyframes bounceInUp {
    0% {
        opacity: 0;
        -o-transform: translateY(2000px);
    }
    
    60% {
        opacity: 1;
        -o-transform: translateY(-30px);
    }
    
    80% {
        -o-transform: translateY(10px);
    }
    
    100% {
        -o-transform: translateY(0);
    }
}

@keyframes bounceInUp {
    0% {
        opacity: 0;
        transform: translateY(2000px);
    }
    
    60% {
        opacity: 1;
        transform: translateY(-30px);
    }
    
    80% {
        transform: translateY(10px);
    }
    
    100% {
        transform: translateY(0);
    }
}

.bounceInUp {
    -webkit-animation-name: bounceInUp;
    -moz-animation-name: bounceInUp;
    -o-animation-name: bounceInUp;
    animation-name: bounceInUp;
}
@-webkit-keyframes bounceInDown {
    0% {
        opacity: 0;
        -webkit-transform: translateY(-2000px);
    }
    
    60% {
        opacity: 1;
        -webkit-transform: translateY(30px);
    }
    
    80% {
        -webkit-transform: translateY(-10px);
    }
    
    100% {
        -webkit-transform: translateY(0);
    }
}

@-moz-keyframes bounceInDown {
    0% {
        opacity: 0;
        -moz-transform: translateY(-2000px);
    }
    
    60% {
        opacity: 1;
        -moz-transform: translateY(30px);
    }
    
    80% {
        -moz-transform: translateY(-10px);
    }
    
    100% {
        -moz-transform: translateY(0);
    }
}

@-o-keyframes bounceInDown {
    0% {
        opacity: 0;
        -o-transform: translateY(-2000px);
    }
    
    60% {
        opacity: 1;
        -o-transform: translateY(30px);
    }
    
    80% {
        -o-transform: translateY(-10px);
    }
    
    100% {
        -o-transform: translateY(0);
    }
}

@keyframes bounceInDown {
    0% {
        opacity: 0;
        transform: translateY(-2000px);
    }
    
    60% {
        opacity: 1;
        transform: translateY(30px);
    }
    
    80% {
        transform: translateY(-10px);
    }
    
    100% {
        transform: translateY(0);
    }
}

.bounceInDown {
    -webkit-animation-name: bounceInDown;
    -moz-animation-name: bounceInDown;
    -o-animation-name: bounceInDown;
    animation-name: bounceInDown;
}
@-webkit-keyframes bounceInLeft {
    0% {
        opacity: 0;
        -webkit-transform: translateX(-2000px);
    }
    
    60% {
        opacity: 1;
        -webkit-transform: translateX(30px);
    }
    
    80% {
        -webkit-transform: translateX(-10px);
    }
    
    100% {
        -webkit-transform: translateX(0);
    }
}

@-moz-keyframes bounceInLeft {
    0% {
        opacity: 0;
        -moz-transform: translateX(-2000px);
    }
    
    60% {
        opacity: 1;
        -moz-transform: translateX(30px);
    }
    
    80% {
        -moz-transform: translateX(-10px);
    }
    
    100% {
        -moz-transform: translateX(0);
    }
}

@-o-keyframes bounceInLeft {
    0% {
        opacity: 0;
        -o-transform: translateX(-2000px);
    }
    
    60% {
        opacity: 1;
        -o-transform: translateX(30px);
    }
    
    80% {
        -o-transform: translateX(-10px);
    }
    
    100% {
        -o-transform: translateX(0);
    }
}

@keyframes bounceInLeft {
    0% {
        opacity: 0;
        transform: translateX(-2000px);
    }
    
    60% {
        opacity: 1;
        transform: translateX(30px);
    }
    
    80% {
        transform: translateX(-10px);
    }
    
    100% {
        transform: translateX(0);
    }
}

.bounceInLeft {
    -webkit-animation-name: bounceInLeft;
    -moz-animation-name: bounceInLeft;
    -o-animation-name: bounceInLeft;
    animation-name: bounceInLeft;
}
@-webkit-keyframes bounceInRight {
    0% {
        opacity: 0;
        -webkit-transform: translateX(2000px);
    }
    
    60% {
        opacity: 1;
        -webkit-transform: translateX(-30px);
    }
    
    80% {
        -webkit-transform: translateX(10px);
    }
    
    100% {
        -webkit-transform: translateX(0);
    }
}

@-moz-keyframes bounceInRight {
    0% {
        opacity: 0;
        -moz-transform: translateX(2000px);
    }
    
    60% {
        opacity: 1;
        -moz-transform: translateX(-30px);
    }
    
    80% {
        -moz-transform: translateX(10px);
    }
    
    100% {
        -moz-transform: translateX(0);
    }
}

@-o-keyframes bounceInRight {
    0% {
        opacity: 0;
        -o-transform: translateX(2000px);
    }
    
    60% {
        opacity: 1;
        -o-transform: translateX(-30px);
    }
    
    80% {
        -o-transform: translateX(10px);
    }
    
    100% {
        -o-transform: translateX(0);
    }
}

@keyframes bounceInRight {
    0% {
        opacity: 0;
        transform: translateX(2000px);
    }
    
    60% {
        opacity: 1;
        transform: translateX(-30px);
    }
    
    80% {
        transform: translateX(10px);
    }
    
    100% {
        transform: translateX(0);
    }
}

.bounceInRight {
    -webkit-animation-name: bounceInRight;
    -moz-animation-name: bounceInRight;
    -o-animation-name: bounceInRight;
    animation-name: bounceInRight;
}
@-webkit-keyframes rotateIn {
    0% {
        -webkit-transform-origin: center center;
        -webkit-transform: rotate(-200deg);
        opacity: 0;
    }
    
    100% {
        -webkit-transform-origin: center center;
        -webkit-transform: rotate(0);
        opacity: 1;
    }
}
@-moz-keyframes rotateIn {
    0% {
        -moz-transform-origin: center center;
        -moz-transform: rotate(-200deg);
        opacity: 0;
    }
    
    100% {
        -moz-transform-origin: center center;
        -moz-transform: rotate(0);
        opacity: 1;
    }
}
@-o-keyframes rotateIn {
    0% {
        -o-transform-origin: center center;
        -o-transform: rotate(-200deg);
        opacity: 0;
    }
    
    100% {
        -o-transform-origin: center center;
        -o-transform: rotate(0);
        opacity: 1;
    }
}
@keyframes rotateIn {
    0% {
        transform-origin: center center;
        transform: rotate(-200deg);
        opacity: 0;
    }
    
    100% {
        transform-origin: center center;
        transform: rotate(0);
        opacity: 1;
    }
}

.rotateIn {
    -webkit-animation-name: rotateIn;
    -moz-animation-name: rotateIn;
    -o-animation-name: rotateIn;
    animation-name: rotateIn;
}
@-webkit-keyframes rotateInUpLeft {
    0% {
        -webkit-transform-origin: left bottom;
        -webkit-transform: rotate(90deg);
        opacity: 0;
    }
    
    100% {
        -webkit-transform-origin: left bottom;
        -webkit-transform: rotate(0);
        opacity: 1;
    }
}

@-moz-keyframes rotateInUpLeft {
    0% {
        -moz-transform-origin: left bottom;
        -moz-transform: rotate(90deg);
        opacity: 0;
    }
    
    100% {
        -moz-transform-origin: left bottom;
        -moz-transform: rotate(0);
        opacity: 1;
    }
}

@-o-keyframes rotateInUpLeft {
    0% {
        -o-transform-origin: left bottom;
        -o-transform: rotate(90deg);
        opacity: 0;
    }
    
    100% {
        -o-transform-origin: left bottom;
        -o-transform: rotate(0);
        opacity: 1;
    }
}

@keyframes rotateInUpLeft {
    0% {
        transform-origin: left bottom;
        transform: rotate(90deg);
        opacity: 0;
    }
    
    100% {
        transform-origin: left bottom;
        transform: rotate(0);
        opacity: 1;
    }
}

.rotateInUpLeft {
    -webkit-animation-name: rotateInUpLeft;
    -moz-animation-name: rotateInUpLeft;
    -o-animation-name: rotateInUpLeft;
    animation-name: rotateInUpLeft;
}
@-webkit-keyframes rotateInDownLeft {
    0% {
        -webkit-transform-origin: left bottom;
        -webkit-transform: rotate(-90deg);
        opacity: 0;
    }
    
    100% {
        -webkit-transform-origin: left bottom;
        -webkit-transform: rotate(0);
        opacity: 1;
    }
}

@-moz-keyframes rotateInDownLeft {
    0% {
        -moz-transform-origin: left bottom;
        -moz-transform: rotate(-90deg);
        opacity: 0;
    }
    
    100% {
        -moz-transform-origin: left bottom;
        -moz-transform: rotate(0);
        opacity: 1;
    }
}

@-o-keyframes rotateInDownLeft {
    0% {
        -o-transform-origin: left bottom;
        -o-transform: rotate(-90deg);
        opacity: 0;
    }
    
    100% {
        -o-transform-origin: left bottom;
        -o-transform: rotate(0);
        opacity: 1;
    }
}

@keyframes rotateInDownLeft {
    0% {
        transform-origin: left bottom;
        transform: rotate(-90deg);
        opacity: 0;
    }
    
    100% {
        transform-origin: left bottom;
        transform: rotate(0);
        opacity: 1;
    }
}

.rotateInDownLeft {
    -webkit-animation-name: rotateInDownLeft;
    -moz-animation-name: rotateInDownLeft;
    -o-animation-name: rotateInDownLeft;
    animation-name: rotateInDownLeft;
}
@-webkit-keyframes rotateInUpRight {
    0% {
        -webkit-transform-origin: right bottom;
        -webkit-transform: rotate(-90deg);
        opacity: 0;
    }
    
    100% {
        -webkit-transform-origin: right bottom;
        -webkit-transform: rotate(0);
        opacity: 1;
    }
}

@-moz-keyframes rotateInUpRight {
    0% {
        -moz-transform-origin: right bottom;
        -moz-transform: rotate(-90deg);
        opacity: 0;
    }
    
    100% {
        -moz-transform-origin: right bottom;
        -moz-transform: rotate(0);
        opacity: 1;
    }
}

@-o-keyframes rotateInUpRight {
    0% {
        -o-transform-origin: right bottom;
        -o-transform: rotate(-90deg);
        opacity: 0;
    }
    
    100% {
        -o-transform-origin: right bottom;
        -o-transform: rotate(0);
        opacity: 1;
    }
}

@keyframes rotateInUpRight {
    0% {
        transform-origin: right bottom;
        transform: rotate(-90deg);
        opacity: 0;
    }
    
    100% {
        transform-origin: right bottom;
        transform: rotate(0);
        opacity: 1;
    }
}

.rotateInUpRight {
    -webkit-animation-name: rotateInUpRight;
    -moz-animation-name: rotateInUpRight;
    -o-animation-name: rotateInUpRight;
    animation-name: rotateInUpRight;
}
@-webkit-keyframes rotateInDownRight {
    0% {
        -webkit-transform-origin: right bottom;
        -webkit-transform: rotate(90deg);
        opacity: 0;
    }
    
    100% {
        -webkit-transform-origin: right bottom;
        -webkit-transform: rotate(0);
        opacity: 1;
    }
}

@-moz-keyframes rotateInDownRight {
    0% {
        -moz-transform-origin: right bottom;
        -moz-transform: rotate(90deg);
        opacity: 0;
    }
    
    100% {
        -moz-transform-origin: right bottom;
        -moz-transform: rotate(0);
        opacity: 1;
    }
}

@-o-keyframes rotateInDownRight {
    0% {
        -o-transform-origin: right bottom;
        -o-transform: rotate(90deg);
        opacity: 0;
    }
    
    100% {
        -o-transform-origin: right bottom;
        -o-transform: rotate(0);
        opacity: 1;
    }
}

@keyframes rotateInDownRight {
    0% {
        transform-origin: right bottom;
        transform: rotate(90deg);
        opacity: 0;
    }
    
    100% {
        transform-origin: right bottom;
        transform: rotate(0);
        opacity: 1;
    }
}

.rotateInDownRight {
    -webkit-animation-name: rotateInDownRight;
    -moz-animation-name: rotateInDownRight;
    -o-animation-name: rotateInDownRight;
    animation-name: rotateInDownRight;
}
/* End animate.css*/
              
            
!

JS

              
                var bgColor;
var effect = 'animated bounceInLeft'; /* bounceIn, bounceInUp, bounceInDown, bounceInLeft,
										 bounceInRight, rotateIn, rotateInUpLeft, rotateInDownLeft,
										 rotateInUpRight, rotateInDownRight  */

$('.all-content').hide();

$('.content li').click(function(){
	$('.card-front, .card-back').hide();
	$('.content li').removeClass('active').hide().css('border','none');
	$(this).addClass('active').show();
	bgColor = $('.active .card-back').css('background-color');
	$('.content').css('background-color',bgColor);
	$('.close, .all-content').show();
	$('.responsive').append('<span class="close">close</span>').addClass(effect);
});


$('.responsive').on('click', '.close', function(){

	$('.close').remove();
	bgColor = $('.active .card-front').css('background-color');
	$('.responsive').removeClass(effect);
	$('.all-content').hide();
	$('.content li').removeClass('active').show().css({ 'border-bottom':'1px solid #2c2c2c',
													    'border-left':'1px solid #2c2c2c' });
	$('.card-front, .card-back').show();
	$('.content').css('background-color',bgColor);
});
              
            
!
999px

Console