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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              <div class="frame">
  <div class="card active">
		<div class="number-bg"></div>
		<div class="number">1</div>
		<div class="text">
			<span class="headline">The couch</span>
			<p>If you want to grow, get outside<br/> your comfort zone.</p>
		</div>
		<div class="button">Ok</div>	
  </div>
	<div class="card">
		<div class="number-bg"></div>
		<div class="number">2</div>
		<div class="text">
			<span class="headline">Failing is learning</span>
			<p>Pick yourself up, dust yourself off,<br/> and start again.</p>
		</div>
		<div class="button">Ok</div>	
  </div>
	<div class="card">
		<div class="number-bg"></div>
		<div class="number">3</div>
		<div class="text">
			<span class="headline">Flowers and rainbows</span>
			<p>Always be yourself,<br/> unless you can be a unicorn.</p>
		</div>
		<div class="button">Ok</div>	
  </div>
</div>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Open+Sans:600,400);

.frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  height: 400px;
  margin-top: -200px;
  margin-left: -200px;
  border-radius: 2px;
  box-shadow: 1px 2px 10px 0px rgba(0,0,0,0.15);
	overflow: hidden;
  background: #C7D6E1;
  color: #fff;
	font-family: 'Open Sans', Helvetica, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.card {
  position: absolute;
	z-index: 0;
	width: 240px;
	height: 150px;
  top: 125px;
  left: 80px;
	background: #fff;
  box-shadow: 4px 8px 12px 0px rgba(0,0,0,0.1);
	border-radius: 3px;
	overflow: hidden;
	pointer-events: none;
	opacity: 0;
	transform: scale(0.5);
	
	&.active {
		pointer-events: all;
		z-index: 1;
		animation: fadeIn .6s ease-in-out both .5s;
	}
	
	&.inactive {
		z-index: 2;
		animation: fadeOut .5s ease-in-out both;
	}
	
	.number-bg {
		position: absolute;
		width: 60px;
		height: 60px;
		top: -31px;
		right: -31px;
		background: #8391A1;
		transform: rotate(45deg);
	}
	
	.number {
		position: absolute;
		top: 6px;
		right: 8px;
		font-size: 13px;
		line-height: 13px;
		font-weight: 600;
		color: #fff;
	}
	
	.text {
		text-align: center;
		padding: 20px 10px;
		
		.headline {
			display: block;
			font-size: 14px;
			line-height: 22px;
			font-weight: 600;
			color: #616E7D;
			margin-bottom: 8px;
		}
		
		p {
			font-size: 12px;
			line-height: 17px;
			color: #8391A1;
			margin: 0;
		}
		
	}
	
	.button {
		position: absolute;
		width: 100%;
		height: 40px;
		bottom: 0;
		left: 0;
		right: 0;
		background: #3CA7FB;
		cursor: pointer;
		text-align: center;
		text-transform: uppercase;
		line-height: 38px;
		font-size: 13px;
		transition: all .3s ease-in-out;
		
		&:hover {
			background: #2196F3;
		}
		
	}
	
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: scale(0.9);		
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes fadeOut {
	from {
		opacity: 1;
		transform: scale(1);	
	}
	to {
		opacity: 0;
		transform: scale(1.15);
	}
}

            
          
!
            
              var active = 1;
$('.button').bind('click', function() {
	$('.card:nth-child(' + active + ')').removeClass('active').addClass('inactive');
	if (active == 3) {
		active = 0;
	}
	active++;
	$('.card:nth-child(' + active + ')').removeClass('inactive').addClass('active');
});
            
          
!
999px
Loading ..................

Console