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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              .frame
	.slices onclick="void(0);"
		-for i in (1..8)
			div class="slice slice-#{i}"
		.text
			h1 Slice 
			h2 transition
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Open+Sans:700);

.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.3);
	overflow: hidden;
	background: #333;
	color: #fff;
	font-family: 'Open Sans', Helvetica, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.text {
	position: absolute;
	width: 100%;
	text-align: center;
	top: 145px;
}
h1 {
	font-size: 60px;
	line-height: 60px;
	text-transform: uppercase;
	font-weight: 700;
	margin: 0;
	transition: all 1s ease-in-out;
	transform: translateX(0);
	text-shadow: 0 0 10px rgba(0,0,0,0.4);
}
h2 {
	@extend h1;
	font-size: 40px;
	line-height: 40px;
}

.slices {
	position: absolute;
	width: 400px;
	height: 400px;
	background: url('http://100dayscss.com/codepen/slice-image-1.jpg') center center no-repeat;
	background-size: 400px 400px;
	cursor: pointer;

	&:hover {
		h1 {
			transform: translateX(-40px);
		} 
		h2 {
			transform: translateX(40px);
		}
		.slice {
			transform: translateY(0);	
			opacity: 1;
		}
	}

	.slice {
		position: relative;
		z-index: 2;
		float: left;
		box-sizing: border-box;
		width: 50px;
		height: 400px;
		background: url('http://100dayscss.com/codepen/slice-image-2.jpg') center center no-repeat;
		background-size: 400px 400px;
		transition: all 1s ease-in-out;
	}

	@for $i from 1 through 8 {
		$nullBase: $i - 1;
		.slice-#{$i} {
			background-position: ($nullBase * -50)+px 0;
			transform: translateY(-40px);	
			opacity: 0;
		}
	}

	@for $i from 1 through 4 {
		.slice-#{$i * 2} {
			transform: translateY(40px);
		}
	}

}

            
          
!
999px
Loading ..................

Console