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 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

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="sunny"></div>
<h2>Sunny</h2>

<div class="partly_cloudy">
	<div class="partly_cloudy__sun"></div>
	<div class="partly_cloudy__cloud"></div>
</div>
<h2>Partly cloudy</h2>

<div class="cloudy"></div>
<h2>Cloudy</h2>

<div class="rainy">
	<div class="rainy__cloud"></div>
	<div class="rainy__rain"></div>
</div>
<h2>Rainy</h2>

<div class="thundery">
	<div class="thundery__cloud"></div>
	<div class="thundery__rain"></div>
</div>
<h2>Thundery</h2>
              
            
!

CSS

              
                // Somewhat relevant stuff
* {
	box-sizing: border-box;
}

html {
	height: 100%;
	margin: 0;
	padding: 0;
	font-size: 18px;
	font-family: Arial, sans-serif;
}

body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	min-height: 100%;
	margin: 0;
	padding: 0;
	color: #8f90a3;
	background-color: #232435;
	background-image: linear-gradient(45deg, #232435, #35415f);
	background-attachment: fixed;
}

h2 {
	margin-bottom: 4rem;
	font-size: 1rem;
	text-transform: uppercase;
}

// Directly relevant stuff
.sunny {
	position: relative;
	width: 5rem;
	height: 5rem;
	margin-top: 4rem;
}

.sunny,
.partly_cloudy__sun {
	&:before {
		content: "";
		position: absolute;
		height: 80%;
		width: 80%;
		top: 10%;
		right: 10%;
		border-radius: 50%;
		z-index: 2;
		background-color: #f1c40f;
		background-image: radial-gradient(#f1c40f, #f39c12);
		box-shadow: 0 0 25px #917508;
	}
	&:after {
		content: "";
		position: absolute;
		height: 100%;
		width: 100%;
		border-radius: 50%;
		z-index: 1;
		background-color: #f39c12;
		will-change: opacity, transform;
		animation: fadeIn 2s linear infinite reverse,
			scaleDown 2s linear infinite reverse;
	}
}

.cloudy {
	position: relative;
	width: 5rem;
	height: 5rem;
}
.cloudy,
.partly_cloudy__cloud,
.rainy__cloud,
.thundery__cloud {
	&:before {
		content: "";
		position: absolute;
		height: 40%;
		width: 40%;
		top: 30%;
		right: 0%;
		border-radius: 50%;
		border-bottom-left-radius: 0;
		z-index: 2;
		background-color: #ecf0f1;
		background-image: radial-gradient(#ecf0f1, #bdc3c7);
		box-shadow: 0 0 25px rgba(0,0,0,.3);
	}
	&:after {
		content: "";
		position: absolute;
		height: 60%;
		width: 70%;
		top: 10%;
		right: 30%;
		border-radius: 50%;
		border-bottom-right-radius: 0;
		z-index: 1;
		background-color: #ecf0f1;
		background-image: radial-gradient(#ecf0f1, #bdc3c7);
		box-shadow: 0 0 25px rgba(0,0,0,.3);
	}
}

.partly_cloudy {
	position: relative;
	width: 5rem;
	height: 5rem;
	&__sun {
		position: absolute;
		width: 100%;
		height: 100%;
		z-index: 1;
	}
	&__cloud {
		position: absolute;
		width: 60%;
		height: 60%;
		top: 40%;
		z-index: 2;
		will-change: transform;
		animation: translateUp 2s linear infinite alternate;
	}
}

.rainy,
.thundery {
	position: relative;
	width: 5rem;
	height: 5rem;
	&__cloud {
		position: absolute;
		height: 100%;
		width: 100%;
		z-index: 2;
		&:before {
			background-color: #95a5a6;
			background-image: radial-gradient(#95a5a6, #7f8c8d);
		}
		&:after {
			background-color: #95a5a6;
			background-image: radial-gradient(#95a5a6, #7f8c8d);
		}
	}
	&__rain {
		position: absolute;
		height: 100%;
		width: 100%;
		z-index: 1;
		overflow: hidden;
		&:before {
			content: "";
			position: absolute;
			height: 80%;
			width: 20%;
			top: 20%;
			right: 50%;
			z-index: 1;
			background-image: linear-gradient(transparent, #94cdd1);
			will-change: opacity, transform;
			animation: fadeIn 1s ease-out infinite reverse,
				scaleUp 1s ease-out infinite;
		}
		&:after {
			content: "";
			position: absolute;
			height: 60%;
			width: 20%;
			top: 40%;
			right: 20%;
			z-index: 1;
			opacity: 0;
			background-image: linear-gradient(transparent, #94cdd1);
			will-change: opacity, transform;
			animation: fadeIn 2s ease-out .4s infinite reverse,
				scaleUp 2s ease-out .4s infinite;
		}
	}
}

.thundery {
	&__cloud {
		&:before {
			background-color: #4d5656;
			background-image: radial-gradient(#4d5656, #393c3c);
			animation: thunder 4s linear .02s infinite alternate;
		}
		&:after {
			background-color: #4d5656;
			background-image: radial-gradient(#4d5656, #393c3c);
			animation: thunder 4s linear infinite alternate;
		}
	}
	&__rain {
		&:before {
			animation: fadeIn .5s ease-out infinite reverse,
				scaleUp .5s ease-out infinite;
		}
		&:after {
			animation: fadeIn .75s ease-out .2s infinite reverse,
				scaleUp .75s ease-out .2s infinite;
		}
	}
}


// Animations
@keyframes fadeIn {
	0% { opacity: 0; }
	100% { opacity: 1; }
}
@keyframes scaleDown {
	0% { transform: scale(1); }
	100% { transform: scale(.8); }
}

@keyframes translateUp {
	0% { transform: translatey(15%); }
	100% { transform: translatey(0); }
}

@keyframes scaleUp {
	0% { transform: scaley(0); }
	100% { transform: scaley(1); }
}

@keyframes thunder {
	0% { box-shadow: 0 0 25px #fff; }
	2% { box-shadow: 0 0 25px rgba(0,0,0,.3); }
	49% { box-shadow: 0 0 25px rgba(0,0,0,.3); }
	50% { box-shadow: 0 0 25px #fff; }
	52% { box-shadow: 0 0 25px #f7db6e; }
	53% { box-shadow: 0 0 25px rgba(0,0,0,.3); }
	69% { box-shadow: 0 0 25px rgba(0,0,0,.3); }
	70% { box-shadow: 0 0 25px #fff; }
	71% { box-shadow: 0 0 25px rgba(0,0,0,.3); }
	75% { box-shadow: 0 0 25px rgba(0,0,0,.3); }
	76% { box-shadow: 0 0 25px #fff; }
	77% { box-shadow: 0 0 25px #a8d3f0; }
	78% { box-shadow: 0 0 25px rgba(0,0,0,.3); }
	100% { box-shadow: 0 0 25px rgba(0,0,0,.3); }
}
              
            
!

JS

              
                
              
            
!
999px

Console