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

              
                <main class="body">
<h1 class="h1">Draw in CSS: Making Shapes <br/>Nani version CSS <br/> #learnInPublic</h1>

<div class="nani">
	<div class="face skinColor">
		<div class="hair">
			<div class="curl"></div>
			<div class="curl"></div>
			<div class="curl"></div>
			<div class="curl"></div>
			<div class="curl"></div>
			<div class="curl"></div>
			<div class="curl"></div>
			<div class="curl"></div>
			<div class="curl"></div>
			<div class="curl"></div>
		</div>
		<div class="smile"></div>
		<div class="glasses"></div>
	</div>
 <div class="neck skinColor"></div>
<div class="bodyDaniela"></div>
</div>
</main>
              
            
!

CSS

              
                .body {
	height: 100vh;
	width: 100%;
	display: flex;
	flex-direction: column;
	justify-content: space-evenly;

	// source https://leaverou.github.io/css3patterns/#bricks
	background-color: #a5a4a4;
	background-image: linear-gradient(335deg, #b00 23px, transparent 23px),
		linear-gradient(155deg, #920808 23px, transparent 23px),
		linear-gradient(335deg, #b00 23px, transparent 23px),
		linear-gradient(155deg, #9c1414 23px, transparent 23px);

	background-size: 58px 58px;
	background-position: 0px 2px, 4px 35px, 29px 31px, 34px 6px;
}

.h1 {
	color: #383838;
	background: white;
	display: inline;
	text-align: center;
	margin: 0 auto 40px auto;
	border: 10px solid #91143c;
	padding: 10px 15px 15px 15px;
	box-shadow: -5px -2px 10px rgba(0, 0, 0, 0.6);
}

$skinColor: #cd8060;
.skinColor {
	background-color: $skinColor;
}

.nani {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: middle;
	margin-top: 40px;
}

.neck {
	width: 30px;
	height: 20px;
	margin-top: -25px;
	z-index: 1000000;
	position: relative;
}

.bodyDaniela {
	border-left: 60px solid transparent;
	border-right: 60px solid transparent;
	border-top: 90px solid $skinColor;
}

$headSize: 90px;
$curlSize: 40px;
$hairSize: $headSize + 17px;

@mixin on-circle($item-count, $circle-size, $item-size) {
	position: relative;
	width: $circle-size + 10;
	height: $circle-size;
	padding: 0;
	border-radius: 50%;

	> * {
		display: block;
		position: absolute;
		top: 50%;
		left: 50%;
		width: $item-size + 10;
		height: $item-size - 3;
		border-radius: 45%;
		margin: -(($item-size / 2) +3);

		$itemsRotate: $item-count - 1;
		$angle: -(200 / $itemsRotate);
		$rot: 0;

		@for $i from 1 through $itemsRotate {
			&:nth-of-type(#{$i}) {
				transform: rotate($rot * 1deg)
					translate($circle-size / 1.7)
					rotate($rot * -1deg);
			}

			$rot: $rot + $angle;
		}

		&:nth-of-type(#{$item-count}) {
			transform: rotate($rot * 1deg) translate($circle-size / 1.7)
				rotate($rot * -1deg);
		}

		&:last-of-type {
			transform: rotate($rot * 1deg) translate($circle-size / 1.65)
				rotate($rot * -1deg);
		}
	}
}

.face {
	width: $headSize;
	height: $headSize + 10;
	border-radius: 50%;
	margin-bottom: 15px;
	box-shadow: inset 2px 7px black, inset -1px 5px black;
	position: relative;
	//center the hair
	display: flex;
	align-items: center;
	justify-content: center;

	&:before,
	&:after {
		content: "";
		background-color: transparent;
		border: 2px solid gold;
		width: 106px;
		height: 40px;
		border-radius: 50%;
	}

	&:before {
		transform: translate(-12px, 33px);
	}

	&:after {
		transform: translate(20px, 32px);
		z-index: 0;
	}
}

.smile {
	display: inline-block;
	margin: 0 1em 1em 0;
	background-color: white;
	border-bottom-left-radius: 50%;
	border-bottom-right-radius: 50%;
	width: 36px;
	height: 14px;
	position: absolute;
	top: 60%;
	left: 50%;
	transform: translate(-50%, 50%);
	z-index: 10;

	&:before {
		content: "";
		width: 55px;
		height: 6px;
		top: 0;
		left: 0;
		position: absolute;
		background-color: $skinColor;
		border-bottom-left-radius: 50%;
		border-bottom-right-radius: 50%;
	}
}

.glasses {
	width: 36px;
	height: 25px;
	position: absolute;
	top: 16px;
	left: 53%;
	transform: translate(-50%, 50%);
	z-index: 10;

	&:before,
	&:after {
		content: "";
		width: 30px;
		height: 30px;
		border: 2px solid #121252;
		background-color: #c6d8da;
		border-radius: 4px;
		top: 0;
		position: absolute;
	}

	&:before {
		left: -17px;
	}
	&:after {
		right: -18px;
	}
}

.hair {
	transform: rotate(12deg);
	z-index: 1;

	@include on-circle(
		$item-count: 10,
		$circle-size: $hairSize,
		$item-size: $curlSize
	);
}

.curl {
	background-color: black;
}

/* mixin from: https://css-tricks.com/snippets/sass/placing-items-circle/ */

              
            
!

JS

              
                
              
            
!
999px

Console