Pen Settings

HTML

CSS

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.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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.

+ add another resource

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                		<h2>Hover over each face to see the original image</h2>

		<div class="wrapper">

			<div class="mike mike--1">

				<div class="mike__ear mike__ear--left"></div>
				<div class="mike__ear mike__ear--right"></div>

				<div class="mike__eye">
					<div class="mike__iris">
						<div class="mike__iris-reflection"></div>
						<div class="mike__pupil"></div>
					</div>
				</div>

				<div class="mike__mouth"></div>
			</div>
			<div class="mike mike--2">

				<div class="mike__ear mike__ear--left"></div>
				<div class="mike__ear mike__ear--right"></div>

				<div class="mike__eye">
					<div class="mike__iris">
						<div class="mike__iris-reflection"></div>
						<div class="mike__pupil"></div>
					</div>
				</div>

				<div class="mike__mouth"></div>
			</div>
			<div class="mike mike--3">

				<div class="mike__ear mike__ear--left"></div>
				<div class="mike__ear mike__ear--right"></div>

				<div class="mike__eye">
					<div class="mike__eye-lid"></div>

					<div class="mike__iris">
						<div class="mike__iris-reflection"></div>
						<div class="mike__pupil"></div>
					</div>
				</div>

				<div class="mike__mouth"></div>
			</div>
			<div class="mike mike--4">

				<div class="mike__ear mike__ear--left"></div>
				<div class="mike__ear mike__ear--right"></div>

				<div class="mike__eye">
					<div class="mike__iris">
						<div class="mike__iris-reflection"></div>
						<div class="mike__pupil"></div>
					</div>
				</div>

				<div class="mike__bow"></div>
			</div>
			<div class="mike mike--5">

				<div class="mike__ear mike__ear--left"></div>
				<div class="mike__ear mike__ear--right"></div>

				<div class="mike__eye">
					<div class="mike__eye-lid"></div>

					<div class="mike__iris">
						<div class="mike__iris-reflection"></div>
						<div class="mike__pupil"></div>
					</div>
				</div>

				<div class="mike__mouth">&#126</div>
			</div>
			<div class="mike mike--6">

				<div class="mike__ear mike__ear--left"></div>
				<div class="mike__ear mike__ear--right"></div>

				<div class="mike__eye">
					<div class="mike__iris">
						<div class="mike__iris-reflection"></div>
						<div class="mike__pupil"></div>
					</div>
				</div>

				<div class="mike__mouth"></div>
			</div>
			<div class="mike mike--7">

				<div class="mike__ear mike__ear--left"></div>
				<div class="mike__ear mike__ear--right"></div>

				<div class="mike__mustache">
					<div>
						<div class="mike__mustache--left"></div>
					</div>
					<div>
						<div class="mike__mustache--right"></div>
					</div>
				</div>

				<div class="mike__eye">
					<div class="mike__eye-lid"></div>

					<div class="mike__iris">
						<div class="mike__iris-reflection"></div>
						<div class="mike__pupil"></div>
					</div>
				</div>
			</div>
			<div class="mike mike--8">

				<div class="mike__ear mike__ear--left"></div>
				<div class="mike__ear mike__ear--right"></div>

				<div class="mike__mouth">
					<div class="mike__mouth-middle"></div>
				</div>

				<div class="mike__eye">
					<div class="mike__iris">
						<div class="mike__iris-reflection"></div>
						<div class="mike__pupil"></div>
					</div>
				</div>
			</div>
			<div class="mike mike--9">

				<div class="mike__ear mike__ear--left"></div>
				<div class="mike__ear mike__ear--right"></div>

				<div class="mike__eye">
					<div class="mike__iris">
						<div class="mike__iris-reflection"></div>
						<div class="mike__pupil"></div>
					</div>
				</div>

				<div class="mike__mouth">
					<div class="mike__tongue"></div>
				</div>
			</div>

		</div>
              
            
!

CSS

              
                /* VARIABLES */
$green: #8fc531;
$alt-green: #81b32c;
$dark-green: #106635;
$fusia: #eb1b8b;

body {
	background-color: #000;
	margin: 0;
	padding: 0;
}

h2 {
	color: #fff;
	font-family: arial;
	margin-top: 20px;
	text-align: center;
}

.wrapper {
	background-color: #000;
	box-sizing: border-box;
	height: 480px;
	padding: 63px 45px 60px 50px;
	position: relative;
	margin: 0 auto;
	width: 480px;

	&:before {
		background-size: contain;
		background: url('https://bleucellar.com/wp-content/uploads/2017/11/mike-faces-mod.jpg') no-repeat center center;
		content: ' ';
		display: block;
		height: 480px;
		left: 0;
		position: absolute;
		top: 0;
		width: 480px;
	}

}

.mike {
	opacity: 0.6;
	background-color: $green;
	border-radius: 100%;
	display: inline-block;
	height: 101px;
	margin: 0 11px 19px;
	position: relative;
	width: 101px;
	transition: all 0.5s ease;

	&:hover {
		opacity: 0;
	}

	&__eye,
	&__iris,
	&__pupil {
		border-radius: 100%;
		left: 50%;
		position: absolute;
		top: 50%;
		transform: translate( -50%, -50% );
	}

	&__ear {
		border-bottom: 15px solid $green;
		border-left: 5px solid transparent;
		border-right: 6px solid transparent;
		height: 0;
		left: 5px;
		position: absolute;
		top: 6px;
		transform: rotate( -37deg );
		width: 1px;

		&--right {
			left: unset;
			right: 5px;
			transform: rotate( 26deg );
		}
	}

	&__eye {
		background-color: #fff;
		border-radius: 100%;
		height: 58px;
		overflow: hidden;
		top: 31%;
		transform: translate( -50%, -28% );
		width: 58px;

		&-lid {
			border-radius: 50%;
			box-shadow: inset 0 22px 0 0 $alt-green;
			height: 65px;
			left: -5px;
			position: absolute;
			top: 0px;
			width: 69px;
			z-index: 9999;
		}
	}

	&__iris {
		background-color: $dark-green;
		height: 27px;
		width: 27px;

		&-reflection {
			background-color: #fff;
			border-radius: 100%;
			height: 5px;
			position: absolute;
			right: 3px;
			top: 3px;
			width: 5px;
		}
	}

	&__pupil {
		background-color: #000;
		height: 14px;
		width: 14px;
	}

	&__mouth {
		background-color: #000;
		border-radius: 100%;
		bottom: 15%;
		height: 10px;
		left: 50%;
		position: absolute;
		transform: translate( -50%, 0 );
		width: 40%;
	}

	&__bow {
		bottom: 1px;
		height: 21px;
		left: 50%;
		overflow: hidden;
		position: absolute;
		transform: translateX( -50% );
		width: 21px;

		&:before,
		&:after {
			background-color: $fusia;
			border-radius: 5px;
			content: '';
			height: 8px;
			position: absolute;
			top: 25%;
			width: 100%;
		}

		&:before {
			transform: rotate(36deg);
		}

		&:after {
			transform: rotate(-36deg);
		}

	}

	&__mustache {
		bottom: 8px;
		margin-left: 22px;
		position: absolute;
		overflow: hidden;

		& > div {
			float: left;
			position: relative;

			&:last-child {
				margin-left: -5px;
			}
		}

		&--left,
		&--right {
			background-color: #000;
			background: linear-gradient( 20deg, #000 55%, rgba(0,0,0,0) 55%, rgba(0,0,0,0) 55% );
			border-radius: 50%;
			display: block;
			height: 31px;
			width: 31px;

			&:before {
				background-color: $green;
				border-radius: 0 0 150% 80%;
				content: '';
				height: 13px;
				margin-left: -1px;
				position: absolute;
				top: 20%;
				transform: rotate(-15deg) translate(1px, 0);
				width: 25px;
			}

			&:after {
				background-color: #000;
				border-radius: 100%;
				content: '';
				display: block;
				height: 12px;
				position: absolute;
				right: 1px;
				top: 14px;
				width: 12px;
			}

		}

		&--right {
			background: linear-gradient( -10deg, #000 55%, rgba(0,0,0,0) 55%, rgba(0,0,0,0) 55% );

			&:before {
				border-radius: 0 0 80% 150%;
				height: 13px;
				margin-left: 0;
				margin-right: 1px;
				right: 0;
				top: 20%;
				transform: rotate(15deg) translate(1px, 0);
				width: 25px;
			}

			&:after {
				left: 1px;
			}

		}

	}

	&__tongue {
		background-color: $fusia;
		border-radius: 4px 4px 12px 12px / 4px 4px 17px 17px;
		height: 25px;
		left: 50%;
		position: absolute;
		top: 1px;
		transform: translate( -50%, 0 );
		width: 20px;
	}

	// Alternate eyes
	&--2 &__eye {
		top: 23%;
	}

	&--5 &__eye,
	&--6 &__eye,
	&--9 &__eye {
		top: 31%;
	}

	&--8 &__eye {
		top: 25%;
	}

	&--3 &__iris-reflection {
		right: 2px;
		top: 6px;
	}

	&--5 &__iris-reflection {
		right: 1px;
		top: 9px;
	}

	&--7 &__iris-reflection {
		right: 2px;
		top: 7px;
	}

	// Alternate eye-lid
	&--5 &__eye-lid {
		background-color: $alt-green;
		border-radius: 50%;
		box-shadow: none;
		left: -100%;
		top: -67%;
		width: 300%;
	}

	&--7 &__eye-lid {
		border-radius: 50%;
		box-shadow: inset 0 22px 0 0 $alt-green;
	}

	// Alternate Mouths
	&--1 &__mouth {
		background: none;
		border-bottom: 7px solid #000;
		bottom: 12px;
		height: 30px;
		width: 63%;
	}

	&--2 &__mouth {
		background-color: #000;
		border-radius: 0 0 26px 26px;
		bottom: 5%;
		height: 30px;
		overflow: hidden;
		width: 48%;

		&:after {
			background: $green;
			border-radius: 70%;
			content: '';
			height: 10px;
			left: 0;
			position: absolute;
			top: -7px;
			width: 100%;
		}
	}

	&--3 &__mouth {
		background: none;
		border-top: 5px solid #000;
		bottom: -6px;
		height: 25px;
		width: 42px;
	}

	&--5 &__mouth {
		background: transparent;
		bottom: 5px;
		font-size: 30px;
		font-weight: 800;
		height: auto;
		text-align: center;
		width: auto;

		transform: translate(-50%,0) scale( 3, 1.8 );
	}

	&--6 &__mouth {
		bottom: 3%;
		height: 18px;
		width: 12px;
	}

	&--8 &__mouth {
		bottom: 8%;
		border-radius: 30% / 60%;
		height: 20px;
		width: 45%;

		&:before,
		&:after {
			background-color: $green;
			border-radius: 100% / 50% 50% 150% 150%;
			content: '';
			height: 12px;
			left: 50%;
			position: absolute;
			top: -31%;
			transform: translate( -50%, 0 );
			width: 32px;
		}

		&:after {
			bottom: -31%;
			border-radius: 100% / 150% 150% 50% 50%;
			top: auto;
		}

		&-middle {
			width: 100%;

			&:before,
			&:after {
				content: '';
				position: absolute;
				top: 0px;
				left: 0;
				height: 20px;
				width: 12px;
				border-radius: 50%;
				background-color: #000;
			}

			&:after {
				left: auto;
				right: 0;
			}
		}

	}

	&--9 &__mouth {
		bottom: 8%;
		width: 36%;
	}

}

              
            
!

JS

              
                
              
            
!
999px

Console