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.

            
              %ul
	- 2.times do
		%li
			.icon.pre-enter
				%div
					- 3.times do
						%div
            
          
!
            
              $teal: #07F7BF;
$green: #B4ED50;
$magenta: #C96DD8;
$violet: #3023AE;
$yellow: #f4d063;
$orange: #fc9d6b;
$grey: #333;

$padding: 12px;
$easeOutQuint: cubic-bezier(0.230, 1.000, 0.320, 1.000);

* { box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: rgba(0,0,0,0); }
*:focus { outline: none!important; }
body, html { height: 100vh; }
body {
	display: flex;
	align-items: center;
	align-content: center;
	justify-content: center;
	perspective: 1000px;
	margin: 0;
	background: $grey;
	color: white;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

.icon {
	position: relative;
	width: 144px;
	height: 144px;
	border-radius: 23px;
	background: $green;
	background: linear-gradient(135deg, rgba($green, 1) 0%, rgba($teal, 1) 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='$green', endColorstr='$teal',GradientType=1 );
	perspective: 1000;
	overflow: hidden;
	box-shadow: 0px 0px 20px rgba(darken($grey, 10%), .5);
	transform-origin: center center;
	> div {
		position: relative;
		width: 100%;
		height: 100%;
		transform-origin: center center;
		transform: rotate(180deg);
		&.hover {
			animation: hoverStart 500ms linear forwards, hover 1000ms linear 500ms infinite alternate;
		}
		> div {
			position: absolute;
			top: calc(50% - 32px);
			left: calc(50% - 32px);
			width: 72px;
			height: 72px;
			border-radius: 11px;
			transform-origin: left center center;
			mix-blend-mode: screen;
			box-shadow: 0px 0px 10px rgba(darken($teal, 50%), 0.1);
			&:nth-child(1) {
				background: rgba(white, 0.5);
				transform: rotateX(15deg) rotateY(-50deg) translateZ(-30px) scale(0.8);
			}
			&:nth-child(2) {
				background: rgba(white, 0.75);
				transform: rotateX(15deg) rotateY(-30deg) translateX(5px) scale(0.9);
			}
			&:nth-child(3) {
				background: rgba(white, 0.95);
				transform: rotateX(15deg) rotateY(-15deg) translateZ(45px);
			}
		}
	}
	&.pre-enter {
		transform: scale(0) rotate(-90deg);
		> div {
			> div {
				&:nth-child(1) {
					transform: rotateY(-90deg) scale(0.8);
				}
				&:nth-child(2) {
					transform: rotateY(-90deg) scale(0.9);
				}
				&:nth-child(3) {
					transform: rotateY(-90deg);
				}
			}
		}
	}
	&.on-enter {
		animation: iconEnter 1000ms linear forwards;
		> div {
			> div {
				transition: all 1000ms $easeOutQuint;
				&:nth-child(1) {
					transition-delay: 750ms;
					transform: rotateX(15deg) rotateY(-50deg) translateZ(-30px) scale(0.8);
				}
				&:nth-child(2) {
					transition-delay: 800ms;
					transform: rotateX(15deg) rotateY(-30deg) translateX(5px) scale(0.9);
				}
				&:nth-child(3) {
					transition-delay: 850ms;
					transform: rotateX(15deg) rotateY(-15deg) translateZ(45px);
				}
			}
		}
	}
}

ul {
	display: flex;
	padding: $padding;
	li {
		padding: $padding;
		&:nth-child(2) {
			.icon {
				background: $magenta;
				background: linear-gradient(135deg, rgba($magenta, 1) 0%, rgba($violet, 1) 100%);
				filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='$magenta', endColorstr='$violet',GradientType=1 );
				> div {
					&.hover {
						animation: hoverStart 500ms linear 250ms forwards, hover 1000ms linear 750ms infinite alternate;
					}
				}
				&.on-enter {
					animation-delay: 250ms;
					> div {
						> div {
							&:nth-child(1) {
								transition-delay: 1000ms;
							}
							&:nth-child(2) {
								transition-delay: 1050ms;
							}
							&:nth-child(3) {
								transition-delay: 1100ms;
							}
						}
					}
				}
			}
		}
	}
}

/* https://goo.gl/zKM03n */
@keyframes iconEnter { 
	0% { transform: matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	4.7% { transform: matrix3d(0.206, -0.4, 0, 0, 0.4, 0.206, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	6.31% { transform: matrix3d(0.346, -0.503, 0, 0, 0.503, 0.346, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	9.41% { transform: matrix3d(0.64, -0.609, 0, 0, 0.609, 0.64, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	12.51% { transform: matrix3d(0.891, -0.603, 0, 0, 0.603, 0.891, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	14.11% { transform: matrix3d(0.988, -0.571, 0, 0, 0.571, 0.988, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	18.72% { transform: matrix3d(1.133, -0.43, 0, 0, 0.43, 1.133, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	18.82% { transform: matrix3d(1.135, -0.426, 0, 0, 0.426, 1.135, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	24.32% { transform: matrix3d(1.12, -0.262, 0, 0, 0.262, 1.12, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	25.03% { transform: matrix3d(1.111, -0.245, 0, 0, 0.245, 1.111, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	29.93% { transform: matrix3d(1.037, -0.15, 0, 0, 0.15, 1.037, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	35.54% { transform: matrix3d(0.976, -0.088, 0, 0, 0.088, 0.976, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	37.54% { transform: matrix3d(0.965, -0.073, 0, 0, 0.073, 0.965, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	41.04% { transform: matrix3d(0.959, -0.053, 0, 0, 0.053, 0.959, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	50.05% { transform: matrix3d(0.984, -0.024, 0, 0, 0.024, 0.984, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	52.15% { transform: matrix3d(0.991, -0.02, 0, 0, 0.02, 0.991, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	63.26% { transform: matrix3d(1.007, -0.007, 0, 0, 0.007, 1.007, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	75.08% { transform: matrix3d(1.001, -0.002, 0, 0, 0.002, 1.001, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	85.49% { transform: matrix3d(0.999, -0.001, 0, 0, 0.001, 0.999, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	100% { transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } 
}

/* https://goo.gl/0Pz1ux */
@keyframes iconEnter-cc { 
	0% { transform: matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	4.7% { transform: matrix3d(0.206, 0.4, 0, 0, -0.4, 0.206, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	6.31% { transform: matrix3d(0.346, 0.503, 0, 0, -0.503, 0.346, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	9.41% { transform: matrix3d(0.64, 0.609, 0, 0, -0.609, 0.64, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	12.51% { transform: matrix3d(0.891, 0.603, 0, 0, -0.603, 0.891, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	14.11% { transform: matrix3d(0.988, 0.571, 0, 0, -0.571, 0.988, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	18.72% { transform: matrix3d(1.133, 0.43, 0, 0, -0.43, 1.133, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	18.82% { transform: matrix3d(1.135, 0.426, 0, 0, -0.426, 1.135, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	24.32% { transform: matrix3d(1.12, 0.262, 0, 0, -0.262, 1.12, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	25.03% { transform: matrix3d(1.111, 0.245, 0, 0, -0.245, 1.111, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	29.93% { transform: matrix3d(1.037, 0.15, 0, 0, -0.15, 1.037, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	35.54% { transform: matrix3d(0.976, 0.088, 0, 0, -0.088, 0.976, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	37.54% { transform: matrix3d(0.965, 0.073, 0, 0, -0.073, 0.965, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	41.04% { transform: matrix3d(0.959, 0.053, 0, 0, -0.053, 0.959, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	50.05% { transform: matrix3d(0.984, 0.024, 0, 0, -0.024, 0.984, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	52.15% { transform: matrix3d(0.991, 0.02, 0, 0, -0.02, 0.991, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	63.26% { transform: matrix3d(1.007, 0.007, 0, 0, -0.007, 1.007, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	75.08% { transform: matrix3d(1.001, 0.002, 0, 0, -0.002, 1.001, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	85.49% { transform: matrix3d(0.999, 0.001, 0, 0, -0.001, 0.999, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
	100% { transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } 
}

@keyframes hoverStart {
	0% {
		transform: rotate(180deg) translateY(0);
	}
	100% {
		transform: rotate(180deg) translateY(3px);
	}
}

@keyframes hover {
	0% {
		transform: rotate(180deg) translateY(3px);
	}
	100% {
		transform: rotate(180deg) translateY(3px);
	}
}
            
          
!
            
              // on enter
$(".icon").addClass("pre-enter");
setTimeout(function(){
	$(".icon").addClass("on-enter");
}, 500);
setTimeout(function(){
	$(".icon").removeClass("pre-enter on-enter");
	$(".icon > div").addClass("hover");
}, 3000);
            
          
!
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