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.

            
              .box
	.head
		.face
			.eye.eye_l
			.eye.eye_r
			.bot.bot_l
			.bot.bot_r
		.ear.ear_l
		.ear.ear_r
		.mouth
	.toy
		.holder.holder_t
		- for (i = 0; i < 8; i++)
			.ension
		.holder.holder_b
		.circle
            
          
!
            
              $bg: #ECD39A;
$red: #7E0103;
$yellow: #E47C14;
$eye: #eee;
$head_w: 110px;
$head_h: 90px;

body {
	display: flex;
	justify-content: center;
	align-items: center;
	height: 100vh;
	background: $bg;
}

.box {
	position: relative;
	width: 110px;
	height: 250px;
}

.head {
	position: relative;
	position: absolute;
	top: 0;
	width: $head_w;
	height: $head_h;
	background: $red;
	animation: jump_head 2s linear alternate infinite;
	
	@keyframes jump_head {
		100% {
			top: 22px;
		}
	}

	&::before,
	&::after {
		content: "";
		position: absolute;
		border-left: $head_w / 4 solid transparent;
		border-right: $head_w / 4 solid transparent;
		height: 0;
		width: $head_w / 2;
	}
	
	&::before {
		bottom: -27px;
		border-top: $head_w / 4 solid $red;
		border-left: $head_w / 3 solid transparent;
		border-right: $head_w / 3 solid transparent;
		height: 0;
		width: $head_w / 3;
	}
	
	&::after {
		top: -27px;
		border-bottom: $head_w / 4 solid $red;
	}
}

.face {
	position: relative;
	top: 0px;
	margin: auto;
	width: 60%;
	height: 88px;
	background: $yellow;
	border-radius: 0 0 30px 30px / 0 0 50px 50px;
	z-index: 1;
	
	&::before,
	&::after {
		content: "";
		position: absolute;
		top: -16px;
    width: 21px;
    height: 51px;
		background: $yellow;
	}
	
	&::before {
		left: 0px;
		transform: skew(37deg) rotate(58deg);
	}
	
	&::after {
		right: 0px;
		transform: skew(-37deg) rotate(-58deg);
	}
	
	.eye {
		position: absolute;
		top: 28px;
		width: 15px;
		height: 8px;
		background: $eye;
		z-index: 1;
		animation: eye_blur 2s linear alternate infinite;
		
		@keyframes eye_blur {
			100% {
				box-shadow:
					inset 0 0 20px 0 $bg,
					0 0 20px 5px $bg;
			}
		}
		
		&_l {
			left: 5px;
			transform: rotate(35deg);
			border-radius: 0 0 100px 150px;
		}
		
		&_r {
			right: 5px;
			transform: rotate(-35deg);
			border-radius: 0 0 150px 100px;
		}
	}
	
	.bot_l {
		position: absolute;
		bottom: 4px;
    left: -4px;
    width: 32px;
    height: 51px;
		background: $yellow;
		transform: rotate(-43deg);
		
		&::before {
			content: "";
			position: absolute;
			top: -15px;
			left: 2.5px;
			width: 0;
			height: 15px;
			background: $yellow;
			border-top: 5px solid $red;
			border-left: 14px solid transparent;
			border-right: 23px solid transparent;
			transform: rotate(-40deg);
		}
	}
	
	.bot_r {
		position: absolute;
		bottom: 4px;
		right: -4px;
		width: 32px;
		height: 51px;
		background: $yellow;
		transform: rotate(43deg);

		&::before {
			content: "";
			position: absolute;
			top: -15px;
			right: 2.5px;
			width: 0;
			height: 15px;
			background: $yellow;
			border-top: 5px solid $red;
			border-left: 14px solid transparent;
			border-right: 23px solid transparent;
			transform: rotate(40deg);
		}
	}
}

.ear {
	position: absolute;
	top: 36px;
	width: 90px;
	height: 15px;
	background: $red;
	
	&_l {
		left: -40px;
		transform: skew(40deg) rotate(-45deg);
	}

	&_r {
		right: -40px;
		transform: skew(-40deg) rotate(45deg);
	}
}

.mouth {
	position: relative;
	top: 5px;
	width: 26px;
	height: 0;
	border-bottom: 5px solid $yellow;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	margin: auto;
	
	&::before,
	&::after {
		content: "";
		position: absolute;
		width: 7px;
		height: 0;
		border-bottom: 5px solid $yellow;
		border-left: 2px solid transparent;
		border-right: 2px solid transparent;
	}
	
	&::before {
		left: -10px;
		transform: rotate(-145deg);
	}
	
	&::after {
		right: -10px;
		transform: rotate(145deg);
	}
}

.toy {
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	top: 127px;
	width: 40px;
	height: 100px;
	margin: auto;
	
	.ension {
		position: relative;
		top: 0;
		width: 2px;
		height: 10px;
		background: $red;
		margin-bottom: -2px;
		animation: jump 2s linear alternate infinite;
		
		@keyframes jump {
			100% {
				top: 21px;
				margin-bottom: -5px;
			}
		}
		
		&:nth-child(even) {
			transform: rotate(45deg);
		}
		
		&:nth-child(odd) {
			transform: rotate(-45deg);
		}
	}
	
	.holder {
		position: absolute;
		width: 10px;
		background: $red;
		z-index: 2;
		
		&_t {
			top: -10px;
			height: 12px;
			animation: holder 2s linear alternate infinite;
		}
		
		@keyframes holder {
			100% {
				top: 11px;
			}
		}

		&_b {
			bottom: 14px;
			height: 22px;
		}
	}
}

.circle {
	position: absolute;
	bottom: -13px;
	width: 50px;
	height: 30px;
	background: darken($red, 5%);
	border: {
		bottom: 10px solid $red;
		left: 12px solid $red;
		right: 12px solid $red;
		radius: 45%;
	}
	z-index: 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