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

              
                .stripe
.center
	.card
		.dismiss
		.illustration
			.car
				.body
					.body-front
					.body-back
					.window
				.front.wheel
				.back.wheel
			.layer-0
			.layer-1
				.chunk-1
					.tree	
					.tree	
					.bush
					.tree	
					.tree	
					.tree	
				.chunk-2
					.tree	
					.tree
					.tree	
					.bush
					.tree	
					.tree
			.layer-2
				.chunk-1
					.house
					.house
					.house
				.chunk-2
					.house
					.house
					.house
					.house
			.hill
		.content
			h2 Your order is on its way!
			p Check your mail box for a tracking code and estimated delivery time.
			
				
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Red+Hat+Display:400,900&display=swap');

$car-body: white;
$car-window: #8DA8A6;
$car-accent: #FE5F55;
$car-wheel: #333;
$car-wheel-rim: #DDD;

$card: #fff;
$layer-0: #999;
$layer-1: #B6C997;
$layer-2: #E5D0BE;
$layer-3: #E4EFD2;
$layer-4: #EDF9F8;

$text: #2C3534;

body {
	background: white;
	
	overflow: hidden;
	
	font-family: Red Hat Display, sans-serif;
	letter-spacing: 0.05rem;
	line-height: 1.5rem;
}

.stripe {
	position: absolute;
	height: 30rem;
	width: 400%;
	left: 50%;
	top: 50%;
	background: $car-accent;
	transform: translate(-50%, -50%) rotate(-30deg);
}

.center {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.card {
	position: relative;
	background: $card;
	color: $text;
	width: 24rem;
	border-radius: 1rem;
	overflow: hidden;
	
	box-shadow: 
		0 0 8rem 0 rgba(black, 0.2),
		0 2rem 4rem -3rem rgba(black, 0.9);
	
	.dismiss {
		position: absolute;
		right: 1rem;
		top: 1rem;
		width: 2rem;
		height: 2rem;
		opacity: 0.6;
		cursor: pointer;
		z-index: 50;
		transition: opacity 200ms, transform 200ms cubic-bezier(.25, 1, 0.5, 2);
		
		&:before, &:after {
			content: '';
			position: absolute;
			left: 1rem;
			height: 1.5rem;
			width: 0.25rem;
			background: $text;
			border-radius: 1rem;
			transform: rotate(45deg);
		}
		
		&:after {
			transform: rotate(-45deg);
		}
		
		&:hover {
			opacity: 0.8;
			transform: scale(1.1);
		}
	}
	
	.illustration {
		position: relative;
		height: 10rem;
		background: $layer-4;
		overflow: hidden;
	}
	
	.content {
		padding: 2rem;
		h2, p {
			opacity: 0.7;
			margin: 0; 
		}
		
		h2 { 
			opacity: 0.9;
			margin-bottom: 1rem; 
		}
	}
}

.car {
	position: absolute;
	top: 7rem;
	left: 10rem;
	z-index: 30;
	animation: car 10s infinite  ease-in-out;
	
	.body {
		position: absolute;
		animation: car-body 0.5s infinite;
	}
	
	.body-front {		
			content: '';
			position: absolute;
			left: 3rem;
			bottom: -2rem;
			height: 1rem;
			width: 1rem;
			background: $car-body;
		
		&:after{
			content: '';
			position: absolute;
			bottom: 1rem;
			height: 0;
			width: 0;
			border-bottom: 1rem solid $car-body;
			border-right: 1rem solid transparent;
		}
	}
	.body-back {
		position: absolute;
		height: 2rem;
		width: 3rem;
		background: $car-body;
		overflow: hidden;
		
		&:after {
			content: '';
			position: absolute;
			height: 0.5rem;
			width: 3rem;
			background: $car-accent;
			transform: translate(-0.5rem, 0.2rem) rotate(-30deg);
		}
	}
	.window {
		position: absolute;
		width: 0.4rem;
		height: 0.9rem;
		background: $car-window;
		top: 0.1rem;
		left: 2.55rem;
		
		&:after {
			content: '';
			position: absolute;
			left: 0.4rem;
			height: 0;
			width: 0;
			border-bottom: 0.9rem solid $car-window;
			border-right: 0.9rem solid transparent;
		}
	}
	.wheel {
		position: absolute;
		top: 1.5rem;
		left: 0.25rem;
		height: 1rem;
		width: 1rem;
		border-radius: 50%;
		background: $car-wheel;
		
		&:after {
			content: '';
			position: absolute;
			height: 0.5rem;
			width: 0.5rem;
			left: 0.25rem;
			top: 0.25rem;
			border-radius: 50%;
			background: $car-wheel-rim;
			
		}
		
		&.front {
			left: 2.75rem;
		}
	}
}

.tree {
	position: absolute;
	width: 0.5rem;
	height: 1rem;
	background: inherit;
	top: -0.5rem;
	
	&:after {
		content: '';
		position: absolute;
		bottom: 1rem;
		left: -0.75rem;
		height: 4rem;
		width: 2rem;
		background: inherit;
		border-radius: 3rem 3rem 2rem 2rem/ 8rem 8rem 4rem 4rem;
	}
}

.bush {
	position: absolute;
	height: 2rem;
	width: 2rem;
	border-radius: 50%;
	background: inherit;
	box-shadow: 2.5rem -0.1rem 0 0.1rem $layer-1;
	transform: scale(0.8);
	top: -1rem;
	
	&:before {
		content: '';
		position: absolute;
		left: 1rem;
		top: -0.5rem;
		height: 1.5rem;
		width: 1.5rem;
		border-radius: 50%;
		background: inherit;
		box-shadow: 1rem 0.25rem 0 0.25rem $layer-1;
	}
	
	&:after {
		content: '';
		position: absolute;
		left: 1rem;
		bottom: 0;
		height: 1.2rem;
		width: 2.25rem;
		background: inherit;
	}
	
}

.house {
	position: absolute;
	left: 10rem;
	width: 4rem;
	height: 2rem;
	background: inherit;
	top: -2rem;
	
	&:after {
		content: '';
		position: absolute;
		bottom: 2rem;
		border-left: 2rem solid transparent;
		border-right: 2rem solid transparent;
		border-bottom: 1.5rem solid $layer-2;
	}
}

.hill {
	position: absolute;
	background: $layer-3;
	width: 16rem;
	height: 8rem;
	border-radius: 50%;
	top: 4rem;
	left: 2rem;
	
	&:after {
		content: '';
		position: absolute;
		width: 16rem;
		height: 6rem;
		background: inherit;
		border-radius: 50%;
		top: 1rem;
		left: 6rem;
	}
	
		&:before {
		content: '';
		position: absolute;
		width: 20rem;
		height: 8rem;
		background: inherit;
		border-radius: 50%;
		top: 1rem;
		left: -10rem;
	}
}

.layer-0 {
	position: absolute;
	background: $layer-0;
	width: 24rem;
	height: 1.5rem;
	top: 9rem;
	z-index: 25;
}

.layer-1 {
	position: absolute;
	background: $layer-1;
	width: 24rem;
	height: 1.5rem;
	top: 8.5rem;
	z-index: 20;
	
	.chunk-1 {
		position: absolute;
		background: inherit;
		animation: chunk 6s linear infinite;
		
		div:nth-child(1) { left: 3rem }
		div:nth-child(2) { left: 6rem }
		div:nth-child(3) { left: 7rem }
		div:nth-child(4) { left: 12em }
		div:nth-child(5) { left: 15rem }
		div:nth-child(6) { left: 20rem }
	}
	
	.chunk-2 {
		position: absolute;
		background: inherit;
		transform: translateX(24rem);
		animation: chunk 6s 3s linear infinite;
		
		div:nth-child(1) { left: 3rem }
		div:nth-child(2) { left: 6rem }
		div:nth-child(3) { left: 9rem }
		div:nth-child(4) { left: 11em }
		div:nth-child(5) { left: 17rem }
		div:nth-child(6) { left: 22rem }
	}
}

.layer-2 {
	position: absolute;
	background: $layer-2;
	width: 24rem;
	height: 2rem;
	top: 8rem;
	z-index: 10;
	
	.chunk-1 {
		position: absolute;
		background: inherit;
		animation: chunk 12s linear infinite;
		
		div:nth-child(1) { left: 3rem }
		div:nth-child(2) { left: 8rem }
		div:nth-child(3) { left: 13rem }
	}
	
	.chunk-2 {
		position: absolute;
		background: inherit;
		transform: translateX(24rem);
		animation: chunk 12s 6s linear infinite;
		
		div:nth-child(1) { left: 3rem }
		div:nth-child(2) { left: 8rem }
		div:nth-child(3) { left: 13rem }
		div:nth-child(4) { left: 18rem }
	}
}

@keyframes chunk {
	0% {
		transform: translateX(24em);
	}	
	100% {
		transform: translateX(-24em);
	}
}

@keyframes car-body {
	0%, 100% {
		transform: translate(0, 0);
	}
	
	25% {
		transform: translate(0, -0.05em);
	}
	
	75% {
		transform: translate(0, 0.05em);
	}
}

@keyframes car {
	0% {
		transform: translateX(-24em);
	}	
	20%, 80% {
		transform: translateX(0);
	}
	100% {
		transform: translateX(24em);
	}
}
              
            
!

JS

              
                
              
            
!
999px

Console