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

              
                <div class="scene-container">
<div class="scene">
	<div class="skybox">
		<div class="cloud"></div>
		<div class="cloud two"></div>
		<div class="cloud three"></div>
		<div class="cloud four"></div>
		<div class="cloud five"></div>
		<div class="cloud six"></div>
		<div class="cloud seven"></div>
		<div class="cloud eight"></div>
	</div>
	<div class="background">
	</div>
	<div class="background two">
	</div>
	<div class="background three">
	</div>
	<div class="foreground">
		<div class="cactus">
		</div>
		<div class="cactus two">
		</div>
		<div class="cactus three">
		</div>
		<div class="station-container">
			<div class="station-base">
			</div>
			<div class="station">
				<div class="garage">
					<div class="windows">
					</div>
				</div>
				<div class="windows">
				</div>
				<div class="windows two">
				</div>
				<div class="door">
				</div>
				<div class="roof">
				</div>
				<div class="roof-underside">
				</div>
				<div class="column">
				</div>
				<div class="column two">
				</div>
			</div>
		</div>
		<div class="road">
		</div>
	</div>
</div>
</div>

              
            
!

CSS

              
                //desert color palette
$timberwolf: #d9d4ce;
$wafer: #ddcbbf;
$coldturkey: #c7b7b7;
$rodeodust: #c8a995;
$graychateau: #9ea5ad;
$ghost: #c9c9d6;
$aquaisland: #a3c7dd;
$goldenrod: #fcd667;
$fire: #ab3400;
$aliceblue: #f0f8ff;
$cactus: #5c755e;

$sky: $aquaisland;
$cloud: $aliceblue;
$background: $coldturkey;
$foreground: $wafer;
$road: $graychateau;

$gray: #ccc;

@mixin texture-dot {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23f0f8ff' fill-opacity='0.5' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
}

@mixin mountain {
	clip-path: polygon(
		0% 59%,
		4% 55%,
		7% 55%,
		10% 56%,
		13% 53%,
		15% 53%,
		18% 52%,
		22% 50%,
		27% 46%,
		29% 44%,
		32% 43%,
		36% 43%,
		38% 43%,
		40% 45%,
		42% 46%,
		45% 42%,
		46% 41%,
		48% 42%,
		52% 40%,
		56% 40%,
		59% 41%,
		63% 41%,
		65% 42%,
		68% 41%,
		69% 41%,
		75% 44%,
		80% 47%,
		84% 49%,
		87% 50%,
		89% 50%,
		91% 52%,
		94% 52%,
		96% 54%,
		100% 56%,
		100% 58%,
		100% 100%,
		0% 100%
	);
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	font-size: 100%;
}

.scene-container {
	background-color: lighten($sky, 8);
	display: flex;
	justify-content: center;
	align-items: center;
	overflow-x: hidden;
	width: 100vw;
	min-height: 100vh;
	padding: 1rem;
}

.scene {
	background-color: transparent;
	width: 1000px;
	height: 540px;
	flex-shrink: 0;
	overflow: hidden;
	position: relative;
}

.skybox {
	@include texture-dot;
	width: 100%;
	height: 100%;
	z-index: 5;
}

$animation-time: 140s;

.cloud {
	animation: animateclouds $animation-time infinite linear;
	background-color: $cloud;
	border-radius: 40px;
	border-left: 3px solid darken($cloud, 3);
	border-bottom: 3px solid darken($cloud, 3);
	box-shadow: -1px 3px 2px 0px rgba(0, 0, 0, 0.075);
	width: 200px;
	height: 60px;
	position: absolute;
	top: 100px;
	left: -250px;

	&::before {
		background: $cloud;
		border-radius: 50%;
		border-left: 3px solid darken($cloud, 3);
		content: "";
		display: block;
		width: 100px;
		height: 100px;
		position: absolute;
		top: -45px;
		left: 70px;
		z-index: 2;
	}

	&::after {
		background: $cloud;
		border-left: 3px solid darken($cloud, 3);
		border-radius: 50%;
		content: "";
		display: block;
		width: 60px;
		height: 60px;
		position: absolute;
		top: -20px;
		left: 30px;
	}

	&.two {
		animation-delay: -($animation-time / 5);
		top: 250px;
		transform: scale(1.5);
	}

	&.three {
		animation-delay: -($animation-time / 4);
		top: 0px;
		transform: scale(0.5);
	}

	&.four {
		animation-delay: ($animation-time / 3);
		top: 175px;
	}

	&.five {
		animation-delay: -($animation-time / 2);
	}

	&.six {
		animation-delay: ($animation-time / 1.5);
		top: 50px;
		transform: scale(0.75);
	}

	&.seven {
		animation-delay: -($animation-time / 1.25);
		top: 125px;
		transform: scale(1.1);
	}

	&.eight {
		animation-delay: ($animation-time / 1.1);
		top: 175px;
		transform: scale(0.8);
	}
}

@keyframes animateclouds {
	100% {
		transform: translateX(1500px);
	}
}

.background {
	@include mountain;
	background-color: $background;
	bottom: 0;
	position: absolute;
	height: 100%;
	width: 100%;
	z-index: 10;

	&.two {
		transform: translate(25rem, 2rem);
		z-index: 9;

		&::before {
			background-color: $background;
		}
	}

	&.three {
		transform: translate(-30rem, 2rem);
		z-index: 9;

		&::before {
			background-color: $background;
		}
	}

	&::before {
		@include mountain;
		content: "";
		background-color: darken($background, 8);
		bottom: 0;
		position: absolute;
		height: 100%;
		width: 100%;
		transform: translateY(0.25rem);
		z-index: -1;
	}
}

.foreground {
	background-color: $foreground;
	border-top: 4px solid darken($foreground, 5);
	bottom: 0;
	position: absolute;
	height: 40%;
	width: 100%;
	z-index: 20;
}

.cactus {
	background: lighten($cactus,15%);
	border-top-right-radius: 5px;
	border-top-left-radius: 5px;
	width: 8px;
	height: 15px;
	position: absolute;
	left: 200px;
	top: -10px;
	
	&::before {
		background: lighten($cactus, 12%);
		content: '';
		display: block;
		border-top-right-radius: 5px;
		border-top-left-radius: 5px;
		width: 8px;
		height: 10px;
		position: relative;
		top: 30px;
		left: -60px;
		transform: scale(1.25);
	}

	&::after {
		background: lighten($cactus, 10%);
		content: '';
		display: block;
		border-top-right-radius: 5px;
		border-top-left-radius: 5px;
		width: 8px;
		height: 12px;
		position: relative;
		top: 35px;
		right: -60px;
		transform: scale(1.35);
	}
	
	&.two {
		left: 800px;
		top: 5px;
		transform: scale(1.1);
	}
	
	&.three {
		left: 50px;
		top: 40px;
		transform: scale(1.25);
	}
}

.station-container {
	width: 400px;
	height: 216px;
	left: 0;
	right: 0;
	top: -120px;
	margin: 0 auto;
	position: absolute;
}

.station-base {
	background: $road;
	border: 0.1rem solid darken($road, 10);
	border-radius: 2px;
	bottom: -10px;
	height: 40px;
	left: -10%;
	width: 120%;
	position: absolute;
	transform: perspective(0.5rem) rotateX(3deg);
	z-index: 31;

	&::after {
		background-color: $road;
		border: 0.1rem solid darken($road, 10);
		border-bottom: 0;
		border-top: 0;
		bottom: -19px;
		content: "";
		display: block;
		width: 120px;
		height: 19px;
		position: absolute;
		right: 20px;
	}
}

.station {
	background-color: lighten($gray, 1);
	border-left: 1px solid darken($gray, 5);
	border-right: 1px solid darken($gray, 5);
	width: 100%;
	height: 108px;
	position: absolute;
	top: 40%;
	z-index: 35;

	&::before {
		background-color: $fire;
		content: "";
		display: block;
		width: 100%;
		height: 12px;
		position: absolute;
		top: 4px;
	}
}

.windows {
	background-color: darken($road, 10);
	border: 2px solid $road;
	bottom: 25px;
	left: 10px;
	width: 100px;
	height: 40px;
	position: absolute;

	&.two {
		left: 190px;
	}
}

.door {
	background-color: darken($road, 10);
	border: 2px solid $road;
	bottom: 0;
	left: 120px;
	width: 60px;
	height: 60px;
	position: absolute;

	&::before {
		content: "";
		background-color: $road;
		display: block;
		height: 100%;
		width: 3px;
		position: absolute;
		left: 49%;
	}
}

.roof {
	background: $gray;
	width: 320px;
	height: 20px;
	position: absolute;
	left: -10px;
	top: -15px;

	&::before {
		background-color: $fire;
		content: "";
		display: block;
		width: 100%;
		height: 12px;
		position: absolute;
		top: 4px;
	}
}

.roof-underside {
	background: darken($gray, 10);
	top: 5px;
	content: "";
	width: 300px;
	height: 15px;
	position: absolute;
	transform: perspective(1rem) rotateX(-7deg);
}

.column {
	background-color: lighten($road, 10);
	border-bottom: 4px solid darken($road, 4);
	border-top: 4px solid lighten($road, 1);
	bottom: -20%;
	left: 60px;
	position: absolute;
	width: 10px;
	height: 116px;

	&.two {
		left: 230px;
	}

	&::before {
		background-color: darken($gray, 25);
		border-bottom: 3px solid darken($gray, 30);
		border-top: 15px solid darken($gray, 28);
		bottom: -4px;
		left: -25px;
		content: "";
		display: block;
		width: 20px;
		height: 25px;
		position: absolute;
	}

	&::after {
		background-color: darken($gray, 25);
		border-bottom: 3px solid darken($gray, 30);
		border-top: 15px solid darken($gray, 28);
		bottom: -4px;
		right: -25px;
		content: "";
		display: block;
		width: 20px;
		height: 25px;
		position: absolute;
	}
}

.garage {
	background-color: lighten($gray, 5);
	border: 2px solid darken($road, 2);
	box-shadow: 0px 1px 2px 1px rgba(darken($road, 40), 0.5) inset;
	width: 80px;
	height: 75px;
	position: absolute;
	right: 10px;
	bottom: 0;

	&::before {
		background: rgba($road, 0.5);
		content: "";
		display: block;
		width: 100%;
		height: 1px;
		position: absolute;
		top: 50%;
	}

	&::after {
		background: darken($foreground, 15);
		content: "";
		display: block;
		width: 10px;
		height: 2px;
		position: absolute;
		top: 90%;
		left: 0;
		right: 0;
		margin: 0 auto;
	}

	.windows {
		background-color: darken($road, 10);
		border: 2px solid $road;
		width: 80%;
		height: 18px;
		position: absolute;
		top: 12px;
		left: 0;
		right: 0;
		margin: 0 auto;

		&::before {
			background-color: $road;
			content: "";
			display: inline-block;
			margin-left: 30%;
			width: 1px;
			height: 100%;
		}

		&::after {
			background-color: $road;
			content: "";
			display: inline-block;
			margin-left: 30%;
			width: 1px;
			height: 100%;
		}
	}
}

.road {
	background-color: $road;
	border-top: 0.5rem solid darken($road, 10);
	bottom: 0;
	position: absolute;
	height: 40%;
	width: 100%;
	z-index: 30;

	&::before {
		background: repeating-linear-gradient(
			to right,
			$road,
			$road 9rem,
			$goldenrod 9rem,
			$goldenrod 12rem
		);
		bottom: 1rem;
		content: "";
		display: block;
		width: 100%;
		height: 0.5rem;
		opacity: 0.9;
		position: absolute;
		transform: perspective(1rem) rotateX(3deg);
	}
}

              
            
!

JS

              
                
              
            
!
999px

Console