cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-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.

            
              <div class="frame">
	<div class="center">
		<div class="loader" onclick="void(0);">
			<div class="plane bottom"></div>
			<div class="plane left"></div>
			<div class="plane right"></div>
			<div class="plane back"></div>
			<div class="plane front"></div>
			<div class="plane top"></div>
			<div class="plane fill-top"></div>
		</div>
	</div>
</div>
            
          
!
            
              $size: 120px;
$colorN: rgba(0,0,0,.1);
$colorF: rgba(46,204,113,0.8);

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

.center {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%,-50%);
	perspective: 500px;
}

.loader {
	width: $size;
	height: $size;
	transform-style: preserve-3d;
	transform: rotateX(-25deg) rotateY(45deg);
	transition: all .5s ease-in-out;
	cursor: pointer;

	&:hover {
		transform: rotateX(-25deg) rotateY(45deg) translateY(-15px);
		
		.bottom {
			box-shadow: -22px -22px 30px 0 rgba(0,0,0,.4);
		}
		
	}

	.plane {
		position: absolute;
		width: $size;
		height: $size;
		top: 0;
		left: 0;
		background: $colorN;
	}

	.bottom {
		transform: rotateX(-90deg) translateZ($size/2);
		background: $colorF;
		box-shadow: -8px -8px 10px 0 rgba(0,0,0,.4);
		transition: all .5s ease-in-out;
	}

	.left {
		transform: rotateY(-90deg) translateZ($size/2);

		&:before {
			content: '';
			display: block;
			position: absolute;	
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			background: $colorF;
			transform-origin: 50% 100%;
			animation: fill 4s ease-in-out infinite alternate;
		}

	}

	.right {
		transform: rotateY(90deg) translateZ($size/2);

		&:before {
			content: '';
			display: block;
			position: absolute;	
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			background: $colorF;
			transform-origin: 50% 100%;
			animation: fill 4s ease-in-out infinite alternate;
		}
		
	}

	.back {
		transform: rotateY(180deg) translateZ($size/2);
		
		&:before {
			content: '';
			display: block;
			position: absolute;	
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			background: $colorF;
			transform-origin: 50% 100%;
			animation: fill 4s ease-in-out infinite alternate;
		}
		
	}

	.front {
		transform: rotateY(0deg) translateZ($size/2);
		
		&:before {
			content: '';
			display: block;
			position: absolute;	
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			background: $colorF;
			transform-origin: 50% 100%;
			animation: fill 4s ease-in-out infinite alternate;
		}
		
	}

	.top {
		transform: rotateX(90deg) translateZ($size/2);
		opacity: .5;
	}
	
	.fill-top {
		background: $colorF;
		animation: 
			fill-top 4s ease-in-out infinite alternate, 
	}

}


@keyframes fill {
	0%,25% {
		transform: scaleY(0);
	}
	75%, 100% {
		transform: scaleY(1);
	}
}

@keyframes color-bottom {
	0% {
		background: $colorN;
	}
	25%, 100% {
		background: $colorF;
	}
}

@keyframes color-top {
	0%,25% {
		background: $colorN;
	}
	75%, 100% {
		background: $colorF;
	}
}

@keyframes fill-top {
	0%,25% {
		transform: rotateX(90deg) translateZ($size / -2);
	}
	75%, 100% {
		transform: rotateX(90deg) translateZ(($size/2)-1);
	}
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console