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

              
                .container
	.birds.front
		-	for(var x = 1; x <= 12; x++)
			div(class="bird b" + x)
				.body
				.wing1
					.wing2
						.wing3
	.birds.back
		-	for(var x = 1; x <= 12; x++)
			div(class="bird b" + x)
				.body
				.wing1
					.wing2
						.wing3
	.cloud.big
		-	for(var x = 0; x <= 8; x++)
			div(class="circle c" + x)
	.cloud.small
		-	for(var x = 0; x <= 8; x++)
			div(class="circle c" + x)
	.mountain
		.backdrop
		-	for(var x = 0; x <= 4; x++)
			div(class="zig zag" + x)
			.top
			.mid
			.bot
			.base
	.range
		-	for(var x = 1; x <= 7; x++)
			div(class="r" + x)
	-	for(var x = 1; x <= 8; x++)
		div(class="tree treeBack tree" + x)
			.top
			.mid
			.bot
			.base
	.tower
		.shadow
		.flagPole
		.roof1
		.roof2
		.wall
			- for(var x = 1; x <= 5; x++)
				div(class="w" + x)
		.legs
			.left
			.right
			.support1
				.criss
				.cross
				.flat
			.support2
				.criss
				.cross
				.flat
		.railing
			.top
			.bot1
			.bot2
			- for(var x = 1; x <= 9; x++)
				div(class="r" + x)
	-	for(var x = 1; x <= 5; x++)
		div(class="tree treeMid tree" + x)
			.top
			.mid
			.bot
			.base
	-	for(var x = 1; x <= 4; x++)
		div(class="tree treeFront tree" + x)
			.top
			.mid
			.bot
			.base
	
              
            
!

CSS

              
                $tree1: #2D1427;
$tree2: #5A0831;
$tree3: #CD4D45;
$range: #F46435;
$mountain1: #F59452;
$mountain2: #F47A45;
$wood: #370D09;
$pole: #791819;
$flag: #C63737;
$tower1: #76122C;
$tower2: #C93D3D;
$tower3: #821021;
$tower4: #F4633A;
$tower5: #4B1205;
$tower6: #C13C45;

.container {
	position: relative;
	width: 160px;
	height: 335px;
	background: #FAE0C8;
	border-radius: 100px;
	overflow: hidden;
}

.mountain {
	position: absolute;
	top: 0;
	opacity: 1;
	.backdrop {
		position: absolute;
		top: 80px;
		left: -180px;
		width: 0;
		height: 0;
		border-left: 260px solid transparent;
		border-right: 260px solid transparent;
		border-bottom: 200px solid $mountain1;
	}
	.zig {
		position: absolute;
		width: 0;
		height: 0;
		transform: rotate(217deg);
		&.zag1 {
			top: 83px;
			left: 70px;
			border-left: 10px solid transparent;
			border-right: 10px solid transparent;
			border-bottom: 30px solid $mountain2;	
		}
		&.zag2 {
			top: 94px;
			left: 70px;
			border-left: 20px solid transparent;
			border-right: 20px solid transparent;
			border-bottom: 60px solid $mountain2;	
		}
		&.zag3 {
			top: 115px;
			left: 84px;
			border-left: 30px solid transparent;
			border-right: 30px solid transparent;
			border-bottom: 80px solid $mountain2;	
		}
		&.zag4 {
			top: 137px;
			left: 100px;
			border-left: 40px solid transparent;
			border-right: 40px solid transparent;
			border-bottom: 100px solid $mountain2;	
		}
	}
}

.tree {
	opacity: 1;
	position: absolute;
	& > div {
		position: absolute;
	}
	&.treeFront {
		> div {
			border-bottom-color: $tree1;
		}
		&.tree1 { top: 200px; left: 0px; }
		&.tree2 {	top: 220px; left: 52px; }
		&.tree3 { top: 238px; left: 94px; }
		&.tree4 {	top: 224px;	left: 136px; }
	}
	&.treeMid {
		> div {
			border-bottom-color: $tree2;
		}
		&.tree1 { top: 225px; left: 27px; }
		&.tree2 { top: 232px; left: 67px; }
		&.tree3 { top: 225px; left: 86px; }
		&.tree4 { top: 223px; left: 106px; }
		&.tree5 { top: 215px; left: 127px; }
	}
	&.treeBack {
		> div {
			border-bottom-color: $tree3;
		}
		&.tree1 { top: 202px; left: -12px; }
		&.tree2 { top: 204px; left: 17px; }
		&.tree3 { top: 212px; left: 40px; }
		&.tree4 { top: 210px; left: 60px; }
		&.tree5 { top: 208px; left: 80px; }
		&.tree6 { top: 210px; left: 98px; }
		&.tree7 { top: 204px; left: 115px; }
		&.tree8 { top: 202px; left: 130px; }
	}
	.top {
		border-left: 17px solid transparent;
		border-right: 17px solid transparent;
		border-bottom: 45px solid #000;
	}
	.mid {
		top: 16px;
		left: -7px;
		border-left: 24px solid transparent;
		border-right: 24px solid transparent;
		border-bottom: 58px solid #000;
	}
	.bot {
		top: 30px;
		left: -12px;
		border-left: 29px solid transparent;
		border-right: 29px solid transparent;
		border-bottom: 68px solid #000;
	}
	.base {
		top: 44px;
		left: -16px;
		border-left: 33px solid transparent;
		border-right: 33px solid transparent;
		border-bottom: 75px solid blue;
	}
}

.range {
	position: absolute;
	top: 0;
	opacity: 1;
	> div {
		position: absolute;
		background: $range;
		width: 60px;
		height: 50px;
	}
	.r1 {
		top: 200px;
		left: -22px;
		width: 60px;
		height: 50px;
		transform: rotate(34deg);
	}
	.r2 {
		top: 198px;
		left: -20px;
		transform: rotate(-8deg);
	}
	.r3 {
		top: 205px;
		left: 24px;
		transform: rotate(25deg);
	}
	.r4 {
		top: 205px;
		left: 50px;
		transform: rotate(-28deg);
	}
	.r5 {
		top: 200px;
		left: 88px;
		transform: rotate(14deg);
	}
	.r6 {
		top: 200px;
		left: 100px;
		transform: rotate(-38deg);
	}
	.r7 {
		top: 199px;
		left: 122px;
		transform: rotate(30deg);
	}
}

.tower {
	position: absolute;
	width: 74px;
	margin-top: 108px;
	margin-left: calc(50% - 37px);
	opacity: 1;
	.shadow {
		position: absolute;
		z-index: 9999;
		top: 12px;
		width: 100%;
		height: 42px;
		background: #000;
		clip-path: polygon(50% 0, 100% 40%, 100% 45%, 87% 45%, 87% 90%, 100% 90%, 100% 100%, 60% 100%, 60% 31%, 50% 0);
		opacity: .4;
	}
	.flagPole {
		width: 2px;
		height: 12px;
		background: $pole;
		margin-left: 36px;
		&:after {
			content: '';
			width: 12px;
			height: 6px;
			background: $flag;
			position: absolute;
			display: block;
		}
	}
	.roof1 {
		border-left: 34px solid transparent;
		border-right: 34px solid transparent;
		border-bottom: 15px solid $tower1;
	}
	.roof2 {
		width: 100%;
		height: 3px;
		background: $tower2;
	}
	.wall {
		position: relative;
		width: 76%;
		height: 22px;
		background: $tower3;
		margin-left: 12%;
		padding-top: 4px;
		.w1, .w2, .w3, .w4, .w5 {
			position: absolute;
			width: 8px;
			height: 14px;
			background: $tower4;
		}
		.w1 {
			left: 4px;
		}
		.w2 {
			left: 14px;
		}
		.w3 {
			left: 24px;
		}
		.w4 {
			left: 34px;
		}
		.w5 {
			left: 44px;
		}
	}
	.legs {
		position: relative;
		.left,
		.right {
			position: absolute;
			width: 4px;
			height: 150px;
			background: $wood;
		}
		.left {
			transform: rotate(3deg);
			left: 12px;
		}
		.right {
			transform: rotate(-3deg);
			right: 12px;
		}
		.support1,
		.support2 {
			position: absolute;
			.criss,
			.cross {
				position: absolute;
				left: 35px;
				width: 4px;
				height: 64px;
				background: $wood;
			}
			.criss {
				transform: rotate(45deg);
			}
			.cross {
				transform: rotate(-45deg);
			}
			.flat {
				position: absolute;
				width: 46px;
				height: 4px;
				background: $wood;
				bottom: -55px;
				left: 14px;
			}
		}
		.support1 {
			top: -14px;
		}
		.support2 {
			top: 28px;
		}
	}
	.railing {
		position: relative;
		top: -16px;
		.r1, .r2, .r3, .r4, .r5, .r6, .r7, .r8, .r9 {
			position: absolute;
			width: 2px;
			height: 10px;
			background: $wood;
		}
		.r1 { left: 5px; }
		.r2 {	left: 12px;	}
		.r3 {	left: 20px;	}
		.r4 {	left: 28px;	}
		.r5 {	left: 36px;	}
		.r6 {	left: 44px;	}
		.r7 {	left: 52px;	}
		.r8 {	left: 60px;	}
		.r9 {	right: 5px;	}
		.top,
		.bot1,
		.bot2 {
			position: absolute;
		}
		.top {
			width: 100%;
			height: 2px;
			background: $tower5;
		}
		.bot1 {
			width: 100%;
			height: 4px;
			top: 10px;
			background: $tower6;
		}
		.bot2 {
			width: 80%;
			height: 2px;
			top: 14px;
			left: 8px;
			background: $tower5;
			opacity: 1;
		}
	}
}

.cloud {
	position: absolute;
	width: 162px;
	height: 55px;
	overflow: hidden;
	&.big {
		top: 10px;
		transform: scale(.8);
		animation: bigCloud 4s linear;
		animation-iteration-count: infinite;
		animation-direction: forwards;
	}
	&.small {
		top: 70px;
		transform: scale(.4);
		animation: smallCloud 4s linear;
		animation-iteration-count: infinite;
		animation-direction: forwards;
		animation-delay: 3s;
	}
	.circle {
		position: absolute;
		border-radius: 50%;
		background: #FFF;
	}
	.c1 {
		width: 32px;
		height: 32px;
		bottom: -15px;
	}
	.c2 {
		width: 35px;
		height: 35px;
		left: 20px;
		bottom: 0;
	}
	.c3 {
		width: 25px;
		height: 25px;
		left: 48px;
		bottom: 15px;
	}
	.c4 {
		width: 35px;
		height: 35px;
		left: 65px;
		bottom: 20px;
	}
	.c5 {
		width: 25px;
		height: 25px;
		left: 94px;
		bottom: 16px;
	}
	.c6 {
		width: 30px;
		height: 30px;
		left: 110px;
		bottom: -5px;
	}
	.c7 {
		width: 30px;
		height: 30px;
		left: 132px;
		bottom: -15px;
	}
	.c8 {
		width: 90px;
		height: 90px;
		left: 30px;
		bottom: -55px;
		background: #FFF;
	}
}

@keyframes bigCloud {
	0% {
		transform: translateX(-200px) scale(.8);
	}
	100% {
		transform: translateX(200px) scale(.8);
	}
}

@keyframes smallCloud {
	0% {
		transform: translateX(-200px) scale(.4);
	}
	100% {
		transform: translateX(200px) scale(.4);
	}
}

.birds {
	position: absolute;
	z-index: 9999;
	width: 100px;
	height: 100px;
	&.front {
		animation: flyFront 4s linear;
		animation-direction: forwards;
		animation-iteration-count: infinite;
		animation-delay: .5s;
		top: 200px;
		left: 200px;
	}
	&.back {
		animation: flyBack 4s linear;
		animation-direction: forwards;
		animation-iteration-count: infinite;
		animation-delay: .5s;
		// animation-delay: 3s;
		top: 50px;
		left: -425px;
	}
	.bird {
		position: absolute;
		transform: scale(0.15);
	}
	@for $i from 1 through 12 {
		$delay: random(2) - .5 + s;
		.b#{$i} {
			.wing1 {
				animation: flap .5s ease-in-out;
				animation-iteration-count: infinite;
				//animation-timing-function: ease;
				animation-direction: alternate;
				transform-origin: 0 0;
				//animation-delay: $delay;
				animation-duration: $delay;
			}
		}
	}
	.b1 { top: -30px;	}
	.b2 { top: -20px; left: -15px; }
	.b3 { left: 10px;	}
	.b4 {	top: 15px; left: 20px; }
	.b5 { top: 30px; left: -5px;	}
	.b6 { top: 45px; left: 5px;	}
	.b7 { top: -5px; left: -35px;	}
	.b8 { top: 10px; left: -25px; }
	.b9 { top: 25px; left: -50px; }
	.b10 { top: 40px; left: -40px; }
	.b11 { top: -10px; left: -75px;	}
	.b12 { top: 5px; left: -65px;	}
}
.body {
	clip-path: polygon(0 100%, 20% 20%, 40% 0, 100% 100%, 20% 80%);
	background: #000;
	width: 150px;
	height: 40px;
}

.wing1 {
	position: relative;
	left: 40px;
	top: -20px;
	width: 40px;
	height: 50px;
	background: #000;
	transform: skew(10deg);
	.wing2 {
		position: absolute;
		bottom: -25px;
		left: 13px;
		
		transform: rotate(-5deg);
	}
	.wing3 {
		width: 40px;
		height: 30px;
		background: #000;
		transform: skew(40deg);
	}
}

@keyframes flap {
	0% {
		transform: skew(10deg) rotateX(50deg);
	}
	100% {
		transform: skew(15deg) rotateX(120deg);
	}
}

@keyframes flyFront {
	0% {
		transform: translate3d(0, 0, 0) rotate(15deg);
	}
	100% {
		transform: translate3d(-600px, -150px, 0) rotate(15deg);
	}
}

@keyframes flyBack {
	0% {
		transform: translate3d(0, 0, 0) scale(.6) scaleX(-1) rotate(-15deg);
	}
	100% {
		transform: translate3d(600px, -50px, 0) scale(.6) scaleX(-1) rotate(15deg);
	}
}

// floof
html, body {
	overflow: hidden;
}
body {
	background: #E6FFFF;
	width: 100vw;
	height: 100vh;
	display: flex;
	align-items: center;
  justify-content: center;
}

              
            
!

JS

              
                // Inspired by an article called 100 days of design by Tiantian Xu
// https://uxdesign.cc/100-days-of-motion-design-463526af852f 
              
            
!
999px

Console