Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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

              
                <div class="duggee">
	<div class="ear ear--left"></div>
	<div class="ear ear--right"></div>
	<div class="face">
		<div class="eyes"></div>
		<div class="nose"></div>
		<div class="mouth"></div>
	</div>
	<div class="woggle"></div>
	<div class="neckerchief"></div>
	<div class="badge badge__1"></div>
	<div class="badge badge__2"></div>
	<div class="badge badge__3"></div>
	<div class="badge badge__4"></div>
	<div class="arm arm--left">
		<div class="paw"></div>
	</div>
	<div class="arm arm--right">
		<div class="paw"></div>
	</div>		
	<div class="leg leg--left">
		<div class="paw"></div>
	</div>
	<div class="leg leg--right">
		<div class="paw"></div>
	</div>	
</div>
<div class="cloud cloud--left"><div></div></div>
<div class="cloud cloud--right"><div></div></div>
              
            
!

CSS

              
                $sky: #B8EDFF;
$grass: #B9D368;

$black: #000000;
$white: #FFFFFF;

$fur--light: #934900;
$fur--med: #873b01;
$fur--dark: #783a07;

$neckerchief: #FFFF00;
$shirt: #D79F00;
$trousers: #A87001;

html {
	background: linear-gradient( to bottom,
		$sky 0%, $sky 47%,
		$grass 47%, $grass 100%
	) fixed;
	height: 100%;
}
body {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
}
.duggee {
	position: relative;
	width: 300px;
	height: 400px;
	background: linear-gradient( to bottom,
		$fur--light 0%, $fur--light 50%,
		$neckerchief 50%, $neckerchief 56%,
		$shirt 56%, $shirt 92%,
		$trousers 92%, $trousers 100%
	);
	border-radius: 80% 80% 150% 150% / 280% 280% 100% 100%;

	&:before {
		content: " ";
		width: 250px;
		height: 125px;
		border-radius: 125px 125px 0 0;
		background-color: $fur--light;
		position: absolute;
		top: -45px;
		left: 25px;
	}
}
.ear {
	position: absolute;
	top: 15%;
	width: 180px;
	height: 110px;
	z-index: -1;

	&--left {
		left: -70px;
		border-radius: 40% 0 0 40% / 50% 0 0 50%;
		transform: rotate( -35deg );
		background: linear-gradient( 165deg,
			$fur--light 0%,
			$fur--light 35%,
			$fur--med 50%,
			$fur--med 100%
		);
	}
	&--right {
		right: -70px;
		border-radius: 0 40% 40% 0 / 0 50% 50% 0;
		transform: rotate( 35deg );
		background: linear-gradient( -165deg,
			$fur--light 0%,
			$fur--light 35%,
			$fur--med 50%,
			$fur--med 100%
		);
	}
	&:before, &:after {
		content: " ";
		position: absolute;
	}
	&:before {
		background-color: $fur--light;
		width: 105px;
		height: 15px;
		top: -14px;
		right: 0;
	}
	&--right:before {
		left: 0;
	}
	&:after {
		background-color: $sky;
		border-radius: 50%;
		top: -85px;
		right: -15px;
		width: 220px;
		height: 85px;
	}
	&--right:after {
		left: -15px;
	}
}
.face {
	width: 120px;
	height: 80px;
	background-color: #CC6733;
	position: absolute;
	top: 20%;
	left: calc( 50% - 60px );
	border-radius: 100% 100% 140% 130% / 130% 130% 140% 130%;
}
.eyes {
	&:before, &:after {
		content: " ";
		position: absolute;
		top: -22px;
		width: 10px;
		height: 10px;
		background-color: $black;
		border-radius: 100%;
	}
	&:before {
		left: calc( 50% - 13px );
	}
	&:after {
		right: calc( 50% - 13px );
	}
}
.nose {
	background-color: $black;
	width: 40px;
	height: 32px;
	border-radius: 45% / 50%;
	position: absolute;
	top: -10px;
	left: calc( 50% - 20px );

}
.mouth {
	position: absolute;
	top: 30%;
	left: 25%;
	width: 18px;
	height: 12px;
	border-radius: 0 0 0 90% / 0 0 0 120%;
	border-color: #910726;
	border-style: solid;
	border-width: 0 0 4px 4px;

}
.woggle {
	width: 38px;
	height: 30px;
	background-color: #0265CB;
	border-radius: 15%;
	position: absolute;
	top: calc( 50% - 2px );
	left: calc( 50% - 19px );
}
.neckerchief {
	width: 26px;
	height: 85px;
	background-color: $neckerchief;
	position: absolute;
	top: 57%;
	left: calc( 50% - 13px );
	&:after {
		content: " ";
		position: absolute;
		top: 100%;
		width: 0;
		height: 0;
		border: 13px solid transparent;
		border-top-color: $neckerchief;
	}
}
.badge {
	position: absolute;

	&__1 {
		top: 60%;
		left: 23%;
		width: 0;
		height: 0;
		border: 20px solid transparent;
		border-top-color: $neckerchief;
		border-radius: 10% / 25%;
		&:after {
			content: " ";
			position: absolute;
			top: -16px;
			left: -10px;
			width: 0;
			height: 0;
			border: 10px solid transparent;
			border-top-color: #723301;
		}
	}
	&__2 {
		top: 59%;
		right: 24%;
		background-color: #FDCE01;
		width: 19px;
		height: 19px;
		border: 5px solid #EE6A00;
		border-radius: 50%;
	}
	&__3 {
		top: 68%;
		left: 25%;
		background-color: #A42C06;
		border: 5px solid #B7CADC;
		border-radius: 15%;
		width: 15px;
		height: 15px;
		transform: rotate( 45deg );
	}
	&__4 {
		top: 69%;
		right: 24%;
		background-color: #FB9893;
		width: 12px;
		height: 12px;
		border: 7px solid #9A3157;
		border-radius: 50%;
	}
}
.arm {
	position: absolute;
	top: 82%;
	color: $fur--med;

	&--left {
		left: 25px;
	}
	&--right {
		right: calc( 25px + 3em );
	}
}
.leg {
	position: absolute;
	top: 98%;
	width: 30px;
	height: 50px;
	background-color: $trousers;
	color: $fur--dark;

	&--left {
		left: calc( 50% - 60px );
		// Shadow
		&:after {
			content: " ";
			background-color: #3D0C16;
			width: 300px;
			height: 20px;
			border-radius: 50%;
			position: absolute;
			top: 101%;
			left: -130px;
			z-index: -1;
		}
	}
	&--right {
		right: calc( 50% - 60px );
	}
}
.paw {
	&, &:before, &:after {
		position: absolute;
		width: 1em;
		height: 1em;
		background-color: currentColor;
		border-radius: 0 0 0.4em 0.4em / 0 0 0.5em 0.5em;
	}
	&:before, &:after {
		content: " ";
	}
	&:before {
		left: 100%;
	}
	&:after {
		left: 200%;
	}
	.leg & {
		font-size: 10px;
		top: 100%;
	}
}
.cloud {
	width: 115px;
	height: 30px;
	background: $white;
	position: absolute;
	&--left {
		top: 25%;
		left: calc( 50% - 375px )
	}
	&--right {
		top: 23%;
		right: calc( 50% - 400px );
	}
	&:before, &:after,
	div:before, div:after {
		content: " ";
		position: absolute;
		bottom: 0;
		background-color: $white;
		border-radius: 50%;
	}
	&:before, &:after {
		width: 36px;
		height: 36px;
	}
	&:before {
		left: -18px;
	}
	&:after {
		right: -18px;
	}
	div:before {
		width: 70px;
		height: 70px;
	}
	div:after {
		width: 50px;
		height: 50px;
		bottom: 11px;
	}
	&--right div:before,
	&--left div:after {
		right: 8px;
	}
	&--left div:before,
	&--right div:after {
		left: 8px;
	}
}
              
            
!

JS

              
                /*

Hey Duggee!

---

Image sources:
- https://ichef.bbci.co.uk/childrens-responsive-ichef-live/r/720/1x/cbeebies/hey-duggee-1024-576.jpg
- https://www.studioaka.co.uk/studioaka_files/image/2a8e5aa1b6c7a17638e29dbdaa228232.jpg
*/
              
            
!
999px

Console