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

              
                <div class="cont">
	<div class="sky">
		<div class="sky-day">
			<div class="sky-dawn"></div>
		</div>
	</div>
</div>
<svg class="foreground" viewBox="0 0 1281 651.41">
	<path class="hills" d="M1281,718v60H142.1l-9.87-68.1s2.25-3.11,6.29-8.41c23.45-30.73,107.29-135,162.81-131,65.09,4.64,100,83.33,144,83.33S638.8,517.39,714.71,523.75,849.85,684.34,950.44,688.34s129-50.75,170.43-50.75c29.84,0,57.4,43.62,94.08,66.28,14.22,8.79,29.83,14.42,47.47,13.12A66.65,66.65,0,0,1,1281,718Z" transform="translate(0 -148.68)"/>
	<polygon class="trees" points="699.02 68.58 674 111.71 674 105.38 699.02 68.58"/>
	<polygon class="trees" points="667.4 194.33 667.14 125.07 639.38 64.37 667.12 117.59 666.85 46.32 666.85 46.32 666.53 46.32 666.67 46 641.12 1.72 668.52 41.75 681.98 10.73 671.65 46.31 677.49 261.92 708.15 187.51 677.88 276.27 685.4 553.41 668.73 554.41 667.44 204.44 642 157.86 667.4 194.33"/>
	<polygon class="trees" points="281.98 165.58 307 208.71 307 202.38 281.98 165.58"/>
	<polygon class="trees" points="313.13 291.33 313.39 222.07 341.15 161.37 313.42 214.59 313.68 143.32 313.68 143.32 314 143.32 313.86 143 339.42 98.72 312.02 138.75 298.55 107.73 308.88 143.31 303.04 358.92 272.38 284.51 302.65 373.27 295.13 650.41 311.8 651.41 313.1 301.44 338.54 254.86 313.13 291.33"/>
	<polygon class="trees" points="921.24 206.5 942 249.25 942 242.98 921.24 206.5"/>
	<polygon class="trees" points="947.09 331.15 947.3 262.49 970.34 202.33 947.05 255.08 947 184.55 947 184.32 947.81 184.32 947.69 184.06 968.9 140.2 946.16 179.89 934.99 149.15 943.56 184.42 938.71 398.14 913.26 324.38 938.39 412.36 932.15 583.42 945.98 584.41 947.05 341.16 968.17 294.99 947.09 331.15"/>
	<polygon class="trees" points="507.07 210.77 456.19 309.39 450.98 203.26 478.99 173.78 450.48 193.11 447.6 134.49 484.43 74.81 447.22 126.81 444.39 69.27 464.21 13.29 441.09 62.51 410.93 0 435.45 68.91 436.21 102.5 408.42 82.55 436.38 109.96 439.41 244.1 408.06 194.79 439.77 260.17 446.07 538.66 467.5 539.66 457.1 327.93 507.07 210.77"/>
	<polygon class="trees" points="915.5 355.57 876.58 420.87 872.6 350.61 894.02 331.09 872.21 343.88 870.01 305.07 898.18 265.56 869.72 300 867.56 261.9 882.72 224.83 865.04 257.42 841.97 216.04 860.72 261.66 861.3 283.9 840.05 270.69 861.43 288.84 863.75 377.64 839.77 345 864.03 388.28 868.84 572.66 885.23 573.32 877.28 433.14 915.5 355.57"/>
	<polygon class="trees" points="760.61 293.66 760.09 149.29 805.98 100.32 760.05 139.97 759.91 100.32 789.12 45.36 758.44 94.61 736.8 62.07 752.62 98.15 751.22 170.7 715.46 118.04 750.94 185.35 749.76 246.39 715.46 219.98 749.58 255.5 747.52 362.48 701.07 287.3 747.08 385.22 743.71 559.32 761.56 559.32 760.66 308.31 792.28 250.24 760.61 293.66"/>
	<polygon class="trees" points="995.93 457.72 996.25 367.18 967.98 336.47 996.27 361.34 996.36 336.47 978.37 302.01 997.27 332.89 1010.6 312.48 1000.85 335.11 1001.72 380.61 1023.75 347.58 1001.89 389.79 1002.62 428.07 1023.75 411.51 1002.72 433.79 1004 500.88 1032.61 453.73 1004.27 515.14 1006.34 624.32 995.35 624.32 995.9 466.91 976.42 430.49 995.93 457.72"/><polygon class="trees" points="374.11 340.01 374.49 234.67 341 198.94 374.51 227.87 374.61 198.94 353.3 158.84 375.69 194.78 391.48 171.03 379.93 197.35 380.95 250.29 407.05 211.87 381.16 260.98 382.02 305.52 407.05 286.25 382.15 312.17 383.66 390.22 417.55 335.37 383.98 407.05 386.43 534.32 373.41 534.32 374.07 350.94 350.99 308.44 374.11 340.01"/>
	<path class="trees" d="M0.12,733.22s186.22-49.57,331.8-60.35,457,43.29,690.22,41.94,258.86-29,258.86-29V800H0Z" transform="translate(0 -148.68)"/>
</svg>
<div id="clock"></div>

<div class="text">
	<h1>Time Changing Landscape</h1>
	<p> This liquid clock design changes colors to match the ambiance of the time of day.  Set to change every 20s to show the animation rather than being set to match the actual time, so you're not waiting hours for something to happen. </p>
</div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Wire+One);
@import url(https://fonts.googleapis.com/css?family=Lato:300);

body{
	margin: 0;
	background: #036;
	font: 70px "Wire One";
	transition: 10s ease;
}
.cont {
	width: 100%;
	height: 350px;
	display: block;
	margin: 0 auto;
	cursor: pointer;
}

.sky{
	width: 100%;
	height: 100%;
	display: block;
	position: relative;
	z-index: 2;
	top: 0;
	background: linear-gradient(#036, #17b,#2cb);
	transition: 10s ease;
}
.sky-dawn{
	width: 100%;
	height: 100%;
	display: block;
	position: relative;
	z-index: 2;
	top: 0;
	background: linear-gradient(#78d, #a8d,#eeb);
	opacity:0;
	transition: 10s ease;
}
.sky-day{
	width: 100%;
	height: 100%;
	display: block;
	position: relative;
	z-index: 2;
	top: 0;
	background: linear-gradient(#1bf,#6df,#bfe);
	opacity:0;
	transition: 10s ease;
}
.show{
	opacity: 1;	
}

.foreground{
	position: relative;
	z-index: 10;
	fill: #036;
}
.trees{
	transition: 10s ease;
}
.hills{
	transition: 10s ease;
}

#clock{
	width: 300px;
	margin: auto;
	display: block;
	position: relative;
	z-index: 20;
	color: #ee7;
	text-align: center;
	text-shadow: 0 0 2px #efd;
	transition: 1s ease;
}
.text{
	width: 80%;
	display: block;
	position: relative;
	z-index: 30;
	margin: 30% auto 0 auto;
	text-align: center;
	clear: both;
	transition: 1s ease;
}
.text h1{
	font-size: 40px;
	letter-spacing: 2px;
	color: #efa;
}
.text p {
	margin-top: 50px;
	font: 17px Lato;
	color: #ffd;
	letter-spacing: 1px;
}

@media screen and (max-width: 480px) {
	body {
		font-size: 50px;
	}
	.text h1{
		font-size: 30px;
	}
	.text p{
		font-size: 15px;
	}
}
              
            
!

JS

              
                //clock
$(document).ready(function(){
	setInterval(function(){
		var now = new Date();
		var hours = now.getHours();
		var minutes = now.getMinutes();
		
		if (hours < 10) {
			hours = "0" + hours;
		}
		if (minutes < 10) {
			minutes = "0" + minutes;
		}
		
		if (hours > 12){
			var hours = hours - 12;
			var ap = "p";
		}else if (hours == 12) {
			var ap = "p";
		}else if (hours == 24) {
			var hours = hours - 12;
			var ap = "a";
		}else {
			var ap = "a";
		}
		document.getElementById('clock').innerHTML = hours + ":" + minutes + ap;
	}, 1000);
});

$(".cont").ready(function(){
	setInterval(function(){
		var height = $(".foreground").height();
		var top = $(".foreground").height();
		var div = $(window).width();
		$(".cont").css("height", height + 30);
		$(".foreground").css("top", -top+15);
		$("#clock").css("margin-top", - top - div/2.3);
		$(".text").css("margin-top", top - 60);
	}, 0.01);
});

//color settings
$(document).ready(function(){
	setInterval(function(){
		var dawn = '#78d';
		var day = '#1bf';
		var dusk = '#036';
		
		var mood = new Date();
		var second = mood.getSeconds();
		if(second < 20){
			$('body').css('background', dawn);
			$('.trees').css('fill', dawn);
			$('.sky-dawn').css('opacity','1');
			$('.sky-day').css('opacity','1');
			$('.hills').css('fill','#c66');
		} else if(second < 40) {
			$('body').css('background', day);
			$('.trees').css('fill', day);
			$('.sky-dawn').css('opacity','0');
			$('.sky-day').css('opacity','1');
			$('.hills').css('fill','#db9');
		} else {
			$('body').css('background', dusk);
			$('.trees').css('fill', dusk);
			$('.sky-day').css('opacity','0');
			$('.hills').css('fill','#0be');
		}
	});
});
              
            
!
999px

Console