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

              
                <header>
		<ul class="left">
				<li class="apple">
						<i class="fa fa-apple"></i>
						<div class="submenu">
								<ul>
										<li>About This Mac</li>
										<li>Software Update...</li>
										<li>Mac OS X Software...</li>
										<li class="spacer"></li>
										<li>System Preferences...</li>
										<li class="hasSubMenu">Dock</li>
										<li class="spacer"></li>
										<li class="hasSubMenu">Recent Items</li>
										<li class="spacer"></li>
										<li class="shortcut" shortcut="&#x2325;&#x2318;&#x238B;">Force Quit...</li>
										<li class="spacer"></li>
										<li>Sleep</li>
										<li>Restart...</li>
										<li>Shut Down...</li>
										<li class="spacer"></li>
										<li class="shortcut" shortcut="&#x21E7;&#x2318;Q">Log Out Jack Harner...</li>
								</ul>
						</div>
				</li>
				<li><strong>Finder</strong>
						<div class="submenu">
								<ul>
										<li>About Finder</li>
										<li class="spacer"></li>
										<li class="shortcut" shortcut="&#x2318;,">Preferences...</li>
										<li class="spacer"></li>
										<li class="shortcut" shortcut="&#x21E7;&#x2318;&#x232b;">Empty Trash...</li>

										<li>Secure Empty Trash...</li>
										<li class="spacer"></li>
										<li class="hasSubMenu">Services</li>
										<li class="spacer"></li>
										<li class="shortcut" shortcut="&#x2318;H">Hide Finder</li>

										<li class="shortcut" shortcut="&#x2325;&#x2318;H">Hide Others</li>

										<li class="noChoice">Show All</li>

								</ul>
						</div>
				</li>
				<li>File
						<div class="submenu">
								<ul>
										<li class="shortcut" shortcut="&#x2318;N">New Finder Window</li>
										<li class="shortcut" shortcut="&#x21E7;&#x2318;N">New Folder</li>
										<li class="shortcut noChoice" shortcut="&#x21E7;&#x2318;N">New Folder With Selection</li>
										<li class="shortcut" shortcut="&#x2325;&#x2318;N">New Smart Folder</li>
										<li>New Burn Folder</li>
										<li class="shortcut noChoice" shortcut="&#x2318;O">Open</li>
										<li class="hasSubMenu noChoice">Open With</li>
										<li class="shortcut noChoice" shortcut="&#x2318;P">Print</li>
										<li class="shortcut noChoice" shortcut="&#x2318;W">Close Window</li>
										<li class="spacer"></li>
										<li class="shortcut" shortcut="&#x2318;I">Get Info</li>
										<li class="spacer"></li>
										<li class="noChoice">Compress</li>
										<li class="spacer"></li>
										<li class="shortcut noChoice" shortcut="&#x2318;D">Duplicate</li>
										<li class="shortcut noChoice" shortcut="&#x2318;L">Make Alias</li>
										<li class="shortcut noChoice" shortcut="&#x2318;Y">Quick Look</li>
										<li class="shortcut noChoice" shortcut="&#x2318;R">Show Original</li>
										<li class="shortcut noChoice" shortcut="&#x21E7;&#x2318;P">Add to Dock</li>
										<li class="spacer"></li>
										<li class="shortcut noChoice" shortcut="&#x2318;&#x232b;">Move to Trash</li>
										<li class="shortcut noChoice" shortcut="&#x2318;E">Eject</li>
										<li>Burn "Desktop" to Disc...</li>
										<li class="spacer"></li>
										<li class="shortcut" shortcut="&#x2318;F">Find</li>
								</ul>
						</div>
				</li>
				<li>Edit
						<div class="submenu">
								<ul>
										<li class="noChoice shortcut" shortcut="&#x2318;Z">Undo</li>
										<li class="noChoice shortcut" shortcut="&#x21E7;&#x2318;Z">Redo</li>
										<li class="spacer"></li>
										<li class="shortcut" shortcut="&#x2318;X">Cut</li>
										<li class="shortcut" shortcut="&#x2318;C">Copy</li>
										<li class="shortcut" shortcut="&#x2318;V">Paste</li>
										<li class="shortcut" shortcut="&#x2318;A">Select All</li>
										<li class="spacer"></li>
										<li>Show Clipboard</li>
										<li class="spacer"></li>
										<li class="shortcut" shortcut="fn fn">Start Dictation</li>
										<li>Special Characters...</li>
								</ul>
						</div>
				</li>
				<li>View
						<div class="submenu">
								<ul>
										<li class="noChoice shortcut" shortcut="&#x2318;1">as Icons</li>
										<li class="noChoice shortcut" shortcut="&#x2318;2">as List</li>
										<li class="noChoice shortcut" shortcut="&#x2318;3">as Columns</li>
										<li class="noChoice shortcut" shortcut="&#x2318;4">as Cover Flow</li>
										<li class="spacer"></li>
										<li class="noChoice">Clean Up Selection</li>
										<li class="hasSubMenu">Clean Up By</li>
										<li class="hasSubMenu">Sort By</li>
										<li class="spacer"></li>
										<li class="noChoice">Hide Path Bar</li>
										<li class="noChoice shortcut" shortcut="&#x2318;/">Hide Status Bar</li>
										<li class="noChoice shortcut" shortcut="&#x2325;&#x2318;S">Hide Sidebar</li>
										<li class="spacer"></li>
										<li class="noChoice shortcut" shortcut="&#x2325;&#x2318;T">Toolbar</li>
										<li class="noChoice">Customize Toolbar...</li>
										<li class="spacer"></li>
										<li class="shortcut" shortcut="&#x2318;J">Show View Options</li>
								</ul>
						</div>
				</li>
				<li>Go
						<div class="submenu">
								<ul>
										<li class="shortcut noChoice" shortcut="&#x2318;[">Back</li>
										<li class="shortcut noChoice" shortcut="&#x2318;]">Forward</li>
										<li class="shortcut" shortcut="&#x2318;&uarr;">Enclosing Folder</li>
										<li class="spacer"></li>
										<li class="hasSubMenu">Recent Folders</li>
										<li class="spacer"></li>
										<li class="shortcut" shortcut="&#x21E7;&#x2318;G">Go to Folder...</li>
										<li class="shortcut" shortcut="&#x2318;K">Connect to Server...</li>
								</ul>
						</div>
				</li>
				<li>Window
						<div class="submenu">
								<ul>
										<li class="shortcut noChoice" shortcut="&#x2318;M">Minimize</li>
										<li class="noChoice">Zoom</li>
										<li class="shortcut noChoice" shortcut="&#x2318;`">Cycle Through Windows</li>
										<li class="spacer"></li>
										<li class="noChoice">Bring All to Front</li>
								</ul>
						</div>
				</li>
				<li>Help
						<div class="submenu">
								<ul>
										<li class="search">Search
												<input id="search" type="text"></input>
										</li>
										<li>Help Center</li>
								</ul>
						</div>
				</li>
		</ul>
		<ul class="right">
				<li><a href="https://www.codepen.io/jackharner" target='_blank'><i class="fa fa-codepen"></i></a></li>
				<li><a href="https://www.twitter.com/jackharner" target='_blank'><i class="fa fa-twitter"></i></a></li>
				<li id="volume-icon-li"><i class="fa fa-volume-off" id="volume-icon"></i>
						<div class="submenu">
								<ul class="volume">
										<li class="volume">
												<div>
														<input type="range" min="0" max="100" value="0" id="volume">
												</div>
										</li>
								</ul>
				</li>
				<li><span id="clock"></span>
						<div class="submenu">
								<ul>
										<li id="date" class="noChoice"></li>
										<li class="spacer"></li>
										<li>View as Analog</li>
										<li>View as Digital</li>
										<li class="spacer"></li>
										<li>Open Date & Time Preferences...</li>
								</ul>
						</div>
				</li>
				<li>Jack Harner
						<div class="submenu">
								<ul>
										<li><a href="https://jackharner.com/" target="_blank">Website</a></li>
								</ul>
						</div>
				</li>
				<li><i class="fa fa-search"></i></li>
				<li><i class="fa fa-bars"></i></li>
		</ul>
</header>
<div id="Desktop"><span class="icon" id="icon1" data-title="Macintosh HD"><img src="https://assets.codepen.io/237800/mac-hard-drive-icon_1.png"></span><span class="icon" data-title="OS Original"><img src="https://assets.codepen.io/237800/mac-hard-drive-icon_1.png"></span>
		<span class="icon" data-title="CD-ROM"><img src="https://assets.codepen.io/237800/CD.png"></span>
		<span class="icon" data-title="iTunes" id="iTunes_ico"><img src="https://assets.codepen.io/237800/iTunes-logo.svg"></span>
</div>


<footer>
		<ul>
				<li data-title="Finder"><img data-title="Finder" src="https://assets.codepen.io/237800/finder.png"></li>
				<li data-title="Chrome"><img src="https://assets.codepen.io/237800/Google_Chrome_icon_2011.png"></li>
				<li data-title="iTunes" class="closed" id="iTunes"><img src="https://assets.codepen.io/237800/iTunes-logo.svg"></li>
				<li data-title="Photoshop"><img src="https://assets.codepen.io/237800/Adobe_Photoshop_CS6_icon.png"></li>
				<li data-title="Dreamweaver"><img src="https://assets.codepen.io/237800/Adobe_Dreamweaver_CS6_Icon.png"></li>
				<li data-title="System&nbsp;Preferences"><img src="https://assets.codepen.io/237800/20140418_System_Preferences.png"></li>
				<li data-title="Trash"><img src="https://assets.codepen.io/237800/512-TrashIcon-macosx1.png"></li>
		</ul>
</footer>

              
            
!

CSS

              
                body {
	background: url(https://assets.codepen.io/237800/universe-wallpaper.jpg)
		center center / cover fixed no-repeat;
	font-family: "Helvetica", sans-serif;
	margin: 0;
	overflow: hidden;
	padding: 0;
	perspective-origin: 0 0;
}

/*--Header--*/
header {
	background: linear-gradient(
		to bottom,
		rgba(230, 230, 230, 1) 0%,
		rgba(163, 163, 163, 1) 100%
	);
	display: block;
	font-size: 0.9em;
	height: 1.3em;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}
header ul {
	margin: 0 5px;
	padding: 0 3px;
}
header li {
	display: inline-block;
	line-height: 1.3em;
	padding: 0 0.5em;
	position: relative;
	cursor: default;
}
header .left {
	float: left;
}
header .right {
	float: right;
}
a {
	color: #000;
	text-decoration: none;
	&:hover {
		text-decoration: underline;
	}
}
.apple i {
}
header .selected {
	background: -webkit-gradient(
		linear,
		left top,
		left bottom,
		color-stop(0%, rgba(89, 120, 245, 1)),
		color-stop(100%, rgba(51, 94, 246, 1))
	);
	color: #fff;
	border-bottom: 0.1em solid #5978f5;
}
/*--Menus--*/
.visible {
	display: block !important;
}
.shortcut:after {
	content: attr(shortcut);
	float: right;
	padding-right: 20px;
}
.search {
	padding: 5px 10px !important;
}
.noChoice {
	color: #adadad;
	&:hover {
		background: #fff !important;
		color: #adadad !important;
	}
}
#volume-icon-li {
	width: 1em;
}
.submenu {
	display: none;
	& input[type="text"] {
		border-radius: 2em;
		border: 1px solid #333;
		height: 2em;
		padding: 0 10px;
	}
	& input[type="range"] {
		transform: rotate(-90deg);
		margin-left: -50px;
		margin-top: 65px;
	}
	& ul {
		background: #fff;
		border-radius: 0 0 5px 5px;
		color: #333;
		font-size: 14px;
		left: 0px;
		margin: 0 !important;
		overflow: hidden;
		padding: 0 5px 0 0;
		position: absolute;
		top: 1.3em;
		width: auto;
		white-space: nowrap;
		&.volume {
			height: 10em;
			width: 2em;
			margin: 0;
			padding: 0;
			position: absolute;
			overflow: visible;
			& li {
				margin: 0;
				padding: 0;
			}
		}
		& li {
			display: block !important;
			vertical-align: middle;
			float: none;
			margin-right: 75px;
			font-weight: 400;
			padding: 2.5px 0px 2.5px 15px;
			width: 100%;
			&.spacer {
				background: rgba(211, 211, 211, 0.8);
				height: 1px !important;
				margin: 2px 0;
				padding: 0;
				width: 102%;
				position: relative;
				&:hover {
					background: rgba(211, 211, 211, 0.8);
				}
			}
		}
	}
	& li:hover:not(.volume) {
		background: -webkit-gradient(
			linear,
			left top,
			left bottom,
			color-stop(0%, rgba(89, 120, 245, 1)),
			color-stop(100%, rgba(51, 94, 246, 1))
		);
		color: #fff;
	}
	& .hasSubMenu:after {
		content: "\f04b";
		font-family: FontAwesome;
		font-size: 0.8em;
		display: inline-block;
		position: absolute;
		right: 25px;
	}
}

/*--Desktop--*/
#Desktop {
	/*-moz-column-count: 15;
	-moz-column-gap: 10px;
	-webkit-column-count: 15;
	-webkit-column-gap: 10px;
	-webkit-column-width: 80px;
	column-count: 15;
	column-gap: 10px;
	column-width: 80px;
	column-fill: balance;
-moz-column-fill: balance;
-webkit-column-fill: balance;
	direction: rtl;*/
	display: flex;
	align-content: right;
	flex-direction: column;
	align-items: flex-end;
	height: 85vh;
	padding: 25px;
	position: absolute;
	right: 0 !important;
	text-align: right;
	z-index: -1;
	width: 100%;
}
#Desktop span.icon {
	display: block;
	float: right;
	margin: 5px 0;
	transition: all 0.2s;
	width: auto;
	z-index: 1;
	text-align: center;
	&:after {
		color: #fff;
		content: attr(data-title);
		display: block;
		margin-bottom: 10px;
		padding: 1px 5px;
		text-shadow: 0px 0px 4px #000;
		transition: all 0.2s;
	}
}
#Desktop span.icon img {
	border: 2px solid rgba(225, 225, 225, 0);
	border-radius: 6px;
	transition: all 0.2s;
	width: 75px;
}
.focus img {
	border: 2px solid rgba(225, 225, 225, 0.5) !important;
	border-radius: 6px;
}
span.focus:after {
	background: #146ece;
	border-radius: 15px;
	text-shadow: none !important;
}
/*--Dock--*/
footer {
	bottom: 0;
	display: inline-block;
	height: 4.4em;
	left: 50%;
	min-width: 35em;
	padding: 0 10px;
	perspective: 1000px;
	position: absolute;
	text-align: center;
	transform: translatex(-50%);
	&:before {
		background: linear-gradient(
			to top,
			rgba(230, 230, 230, 1) 0%,
			rgba(163, 163, 163, 1) 100%
		);
		bottom: 0;
		content: "";
		height: 4em;
		left: 0;
		margin-top: 15px;
		position: absolute;
		right: 0;
		top: 0;
		transform: rotatex(45deg);
		width: 100%;
		z-index: -1;
	}
}
footer ul {
	display: inline-block;
	margin: 0 0.1em;
	padding: 0;
	transform-origin: bottom center !important;
}
footer li {
	display: inline-block;
	vertical-align: top;
	position: relative;
	transform: scale(1);
	transform-origin: bottom center;
	transition: transform 2s;
	&:before {
		background: rgba(0, 0, 0, 0.3);
		border-radius: 12px;
		color: #fff;
		content: attr(data-title);
		display: block;
		float: left;
		font-size: 0.9em;
		left: 50%;
		margin: 2px auto;
		opacity: 0;
		padding: 0 10px;
		position: absolute;
		text-align: center;
		top: -35px;
		transform: translatex(-50%);
		transform-origin: bottom center !important;
		visibility: hidden;
		width: auto;
	}
	&:hover:before {
		opacity: 1;
		top: -45px;
		visibility: visible;
	}
}
.jump {
	-webkit-animation: JUMP 600ms 2 cubic-bezier(0.4, 0.01, 0.6, 0.99);
}
footer img {
	-webkit-box-reflect: below -5px -webkit-gradient(
			linear,
			left bottom,
			left top,
			color-stop(0%, rgba(230, 230, 230, 0.2)),
			color-stop(100%, rgba(255, 255, 255, 0))
		);
	align-items: center;
	bottom: 0;
	display: flex;
	justify-content: center;
	margin: 0 5px;
	position: relative;
	transform: scale(1);
	transform-origin: bottom center !important;
	transition: all 0.2s;
	width: 4em;
	&:hover {
		margin: 0 10px;
		transform: scale(1.2);
	}
}

@-webkit-keyframes JUMP {
	0% {
		bottom: 0;
	}
	50% {
		bottom: 20px;
		padding-bottom: 20px;
	}
	100% {
		bottom: 0;
	}
}

              
            
!

JS

              
                //Clock;
function updateClock() {
		var currentTime = new Date();
		var currentHours = currentTime.getHours();
		var currentMinutes = currentTime.getMinutes();
		var currentSeconds = currentTime.getSeconds();
		var shortDays = [
				'Sun', //Sunday starts at 0
				'Mon',
				'Tue',
				'Wed',
				'Thu',
				'Fri',
				'Sat'
		];
		var longDays = [
				'Sunday', //Sunday starts at 0
				'Monday',
				'Tuesday',
				'Wednesday',
				'Thursday',
				'Friday',
				'Saturday'
		];
		var months = ['January', 'Feburary', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];

		d = new Date(); //This returns Wed Apr 02 2014 17:28:55 GMT+0800 (Malay Peninsula Standard Time)
		m = d.getMonth();
		month = (months[m]);
		date = d.getDate();
		year = d.getFullYear();
		x = d.getDay(); //This returns a number, starting with 0 for Sunday

		var day = (shortDays[x]);
		var longDay = (longDays[x]);

		// Pad the minutes and seconds with leading zeros, if required
		currentMinutes = (currentMinutes < 10 ? "0" : "") + currentMinutes;
		currentSeconds = (currentSeconds < 10 ? "0" : "") + currentSeconds;

		// Choose either "AM" or "PM" as appropriate
		var timeOfDay = (currentHours < 12) ? "AM" : "PM";

		// Convert the hours component to 12-hour format if needed
		currentHours = (currentHours > 12) ? currentHours - 12 : currentHours;

		// Convert an hours component of "0" to "12"
		currentHours = (currentHours === 0) ? 12 : currentHours;

		// Compose the string for display
		var currentTimeString = day + " " + currentHours + ":" + currentMinutes + " " + timeOfDay;
		var longTimeString = longDay + ", " + month + " " + date + ", " + year;
		$("#clock").html(currentTimeString);
		$("#date").html(longTimeString);

}

$(document).ready(function() {
		updateClock();
		setInterval('updateClock()', 1000);
});

//Desktop Item Selection
$("#Desktop span").click(function(e) {
		e.stopPropagation();
		if (e.shiftKey) {
				//Shift-Click
				$(this).addClass("focus");
		} else {
				$(".focus").removeClass("focus");
				$(this).addClass("focus");
		}
});
$("body:not(#Desktop span)").click(function() {
		$("#Desktop span").removeClass("focus");

});

$("#Desktop span").dblclick(function() {
		//$(".window").addClass("open");
});
$("#close").click(function() {
		$(".window").removeClass("open");
});
//$("footer img").click(function(){$(this).animate(margin-bottom: 15px,5000,function(){};)});

//Menu Bar Selection
$("header ul li").click(function(e) {
		e.stopPropagation();
		$(".visible").removeClass("visible");
		$(this).children(" div.submenu").addClass("visible").fadeIn();
		$(".selected").removeClass("selected");
		$(this).addClass("selected");
});
$("body:not(header ul.left li), body:not(header li input#search)").click(function() {
		$(".selected").removeClass("selected");
		$(".visible").removeClass("visible");
});

//Jump

$("footer img").click(function() {
		$(this).removeClass("jump");
		this.offsetWidth = this.offsetWidth;
		$(this).addClass("jump");
});

$("#volume").on("change mousemove", function() {
		if ($(this).val() < 10) {
				$("#volume-icon").removeClass();
				$("#volume-icon").addClass("fa fa-volume-off");
		}
});
$("#volume").on("change mousemove", function() {
		if ($(this).val() > 10 && $(this).val() < 66) {
				$("#volume-icon").removeClass();
				$("#volume-icon").addClass("fa fa-volume-down");
		}
});
$("#volume").on("change mousemove", function() {
		if ($(this).val() > 66) {
				$("#volume-icon").removeClass();
				$("#volume-icon").addClass("fa fa-volume-up");
		}
});


              
            
!
999px

Console