Pen Settings



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


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


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.


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.


                <div id="snow"></div>


                html, body {
  height: 100%;
  max-height: 100%;
  overflow: hidden;

#snow {
	background: #333 url( no-repeat;
  background-attachment: fixed;
  background-size: cover;
  bottom: 0px;
  position: fixed;
  left: 0px;
  right: 0px;
  top: 0px;
.particle {
  border-radius: 50%;
  background: #fff;
	width: 20px;
  height: 20px;
	font-family: "arial", sans-serif;
	position: absolute;
	visibility: hidden;


                var density = 200,
	speed = 1,
	winHeight = $(window).height(),
	winWidth  = $(window).width(),
	start = {yMin: -180, yMax: -180, xMin: 10, xMax: winWidth - 10, scaleMin:0.1, scaleMax:0.25, opacityMin:0.2, opacityMax:0.4},
	mid = {yMin:winHeight * 0.3, yMax:winHeight * 0.5, xMin: winWidth * 0.05, xMax: winWidth * 0.9, scaleMin:0.2, scaleMax:1, opacityMin:0.4, opacityMax:1},
	end = {yMin: winHeight + 50, yMax: winHeight + 50, xMin: 10, xMax: winWidth - 10, scaleMin:0.1, scaleMax:1, opacityMin:0.2, opacityMax:0.7},
	colors = ["#D1D5D8", "#EFEFEF"];

	function range(map, prop) {
		var min = map[prop + "Min"],
			max = map[prop + "Max"];
		return min + (max - min) * Math.random();

	function spawn(particle) {
		var wholeDuration = (10 / speed) * (0.7 + Math.random() * 0.4),
			delay = wholeDuration * Math.random(),
			partialDuration = (wholeDuration + 1) * (0.3 + Math.random() * 0.4);

		//set the starting values
		TweenLite.set(particle, {y:range(start, "y"), x:range(start, "x"), scale:range(start, "scale"), opacity:range(start, "opacity"), visibility:"hidden", color:colors[ Math.floor(Math.random() * colors.length) ]});

		//the y tween should be continuous and smooth the whole duration, wholeDuration, {delay:delay, y:range(end, "y"), ease:Linear.easeNone});

		//now tween the x independently so that it looks more randomized (rather than linking it with scale/opacity changes too), partialDuration, {delay:delay, x:range(mid, "x"), ease:Power1.easeOut});, wholeDuration - partialDuration, {delay:partialDuration + delay, x:range(end, "x"), ease:Power1.easeIn});

		//now create some random scale and opacity changes
		partialDuration = wholeDuration * (0.5 + Math.random() * 0.3);, partialDuration, {delay:delay, scale:range(mid, "scale"), autoAlpha:range(mid, "opacity"), ease:Linear.easeNone});, wholeDuration - partialDuration, {delay:partialDuration + delay, scale:range(end, "scale"), autoAlpha:range(end, "opacity"), ease:Linear.easeNone, onComplete:spawn, onCompleteParams:[particle]});

	$(window).ready(function() {
		var container = $("#snow"),
		for (i = 0; i < density; i++) {
			spawn( $("<div />", {id:"particle"+i}).addClass("particle").appendTo(container) );
      // .text( Math.round( Math.random() * 9 ))