.container
	.cube
		.side.back.black 
			i.fab.fa-codepen.icon
		.side.left.grey
			i.fab.fa-codepen.icon
		.side.front.grey
			i.fab.fa-codepen.icon
		.side.right.grey
			i.fab.fa-codepen.icon
		.side.top.grey
			i.fab.fa-codepen.icon
		.side.bottom.grey
			i.fab.fa-codepen.icon
.container
	.cube
		.side.back.twitter 
			i.fab.fa-twitter.icon
		.side.left.grey
			i.fab.fa-twitter.icon
		.side.front.grey
			i.fab.fa-twitter.icon
		.side.right.grey
			i.fab.fa-twitter.icon
		.side.top.grey
			i.fab.fa-twitter.icon
		.side.bottom.grey
			i.fab.fa-twitter.icon
View Compiled


body,html{
	height: 100%;
}

body {
	font-family: "Lato", sans-serif;
	color: #111;
	display: flex;
	flex-direction: row;
	align-items: center;
	align-content: center;
	justify-content: center;
	background-color: #ECECEC;
}

.container {
	width: 224px;
	//margin: auto;
	//perspective for cube
	perspective: 1000px;
	//border: 2px solid black;
}

.cube {
	margin: auto;
	position:relative;
	width: 200px;
	height: 200px;
	transform-style: preserve-3d;
	transition: transform 2s ease;
	//animation: rotate 1s backwards;
	&:hover{
		transform: rotateX(180deg) rotateY(720deg);
		// animation: rotate 1s ease-in;
		// animation-direction: alternate;
	}
}

.side{
	position: absolute;
	width: 200px;
	height: 200px;
	//background-color: rgba(186,31,51,0.3);
	//background-color: white;
	//border: 3px solid rgb(186,31,51);
	
	text-transform: uppercase;
	text-align: center;
	& h1{
		vertical-align: middle;
		line-height: 400px;
		color:white;
	}
	&.back{
		transform: translateZ(-100px) rotateX(180deg);
	}
	&.left{
		transform: translateX(-100px) rotateY(-90deg);
	}
	&.right{
		transform: translateX(100px) rotateY(90deg);
	}
	&.front{
		transform: translateZ(100px) 
	}
	&.top{
		transform: translateY(-100x) rotateX(90deg);
	}
	&.bottom{
		transform: translateY(100px) rotateX(90deg);
	}
	.icon{
	margin: 30% auto;
	vertical-align: middle;
	font-size: 84px;
	}
	&.grey{
		color: #777;
		background-color: white;
	}
	&.black{
		color: white;
		background-color: #111;
	}
	&.twitter{
		color: white;
		background-color:  #0084b4;
	}
}


View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.