css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="window">
	<h1>Mac launchpad in CSS</h1>
	<p>A simple demonstration of the Mac launchpad effect in CSS. JavaScript is used to control when the effect is triggered or removed.</p>
	<p>
		Made by <a href="http://migueljimenez.co" target="_blank">Miguel Jiménez</a> | 
		<a target="_blank" href="https://twitter.com/jachinte">@jachinte</a>
	</p>
	<p>You may also like <a href="https://codepen.io/jachinte/pen/bVNraO" target="_blank">Mission Control in CSS</a></p>
	<a title="Click to open" class="open-menu launchpad-icon"></a>
</div>
<div id="icons">
	Icons by <a href="http://xenatt.deviantart.com/" target="_blank">xenatt</a> from <a href="https://www.iconfinder.com/iconsets/minimalism" target="_blank">Iconfinder</a>
</div>
<div id="launchpad">
	<div class="content">
		<nav>
			<a class="icon-safari">Safari</a>
			<a class="icon-notes">Notes</a>
			<a class="icon-facetime">Facetime</a>
			<a class="icon-appstore">App store</a>
			<a class="icon-dictionary">Dictionary</a>
			<a class="icon-texteditor">Text Editor</a>
			<a class="icon-monitor">Activity Monitor</a>
			<a class="icon-airport">AirPort Utility</a>
			<a class="icon-chromium">Chromium</a>
			<a class="icon-opera">Opera</a>
			<a class="icon-skydrive">Skydrive</a>
			<!--<a class="icon-dropbox">Dropbox</a>-->
			<!--<a class="icon-soundcloud">Soundcloud</a>-->
			<a class="icon-twitter">Twitter</a>
			<a class="icon-pinterest">Pinterest</a>
			<a class="icon-imovie">iMovie</a>
		</nav>
	</div>
</div>
            
          
!
            
              @duration: .4s;
@blur: 30px;
@background: url(http://media.idownloadblog.com/wp-content/uploads/2014/08/Yosemite-5-wallpaper-thumbnail.png);
@icon-margin: 40px;

.yosemite-background {
	background: @background no-repeat center center fixed;
	background-size: cover;
}

body {
	.yosemite-background;
	font-family: sans-serif;
	margin: 0;
	padding: 0;
}

* { box-sizing: border-box; }
a { cursor: pointer; }

#launchpad {
	display: none;
	
	&.shown {
		display: block;
		
		&.start { animation: show @duration 1; }
		&.end { animation: hide @duration 1; }
		
		.content {
			// counteracts the blurred edges
			background: #310505;
			bottom: 0;
			left: 0;
			position: fixed;
			right: 0;
			top: 0;
			
			&:before {
				.yosemite-background;
				bottom: 0;
				content: '';
				filter: blur(@blur);
				left: 0;
				position: absolute;
				right: 0;
				top: 0;
				z-index: -1;
			}
			
			nav {
				margin: 20px auto;
				width: 90%;
				
				a {
					color: white;
					filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
					font-size: 14px;
					text-align: center;
					text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5);
					&:active { 
						opacity: .6;	
					}
				}
				
				&.scale-down { 
					animation: scale-down @duration 1; }
				&.scale-up { 
					animation: scale-up @duration 1; }
			}
		}
	}
}

.window {
	background: white;
	border-color: #eee;
	border-width: 30px 0 0 0;
	border-style: solid;
	border-radius: 3px;
	box-shadow: 0 0 60px 10px rgba(0, 0, 0, 0.2);
	left: 50%;
	margin: -160px 0 0 -320px;
	min-height: 320px;
	padding: 10px 30px;
	position: absolute;
	top: 50%;
	width: 640px;
	
	h1 {
		font-weight: normal;
		text-align: center;
	}
	
	a {
		color: #00BFFF;
		text-decoration: none;
	}
}

// KEYFRAMES

@keyframes show {
	0% { opacity: 0; }
	100% { opacity: 1; }
}

@keyframes hide {
	0% { opacity: 1; }
	100% { opacity: 0; }
}

@keyframes scale-up {
	0% { transform: scale(1); }
	100% { transform: scale(1.2); }
}

@keyframes scale-down {
	0% { transform: scale(1.2); }
	100% { transform: scale(1); }
}

// ICONS

a[class^="icon"] {
	background-position: top;
	background-repeat: no-repeat;
	display: inline-block;
	height: 128px;
	padding: 128px 0 0 0;
	margin: @icon-margin;
	width: 128px;
}

.launchpad-icon {
	background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/Launcher.png);
	background-position: top;
	background-repeat: no-repeat;
	display: block;
	height: 128px;
	margin: 15px auto;
	width: 128px;
}
.icon-facetime { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/facetime.png); }
.icon-skydrive { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/skydrive.png); }
.icon-dropbox { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/dropbox.png); }
.icon-soundcloud { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/soundcloud.png); }
.icon-chromium { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/Chromium.png); }
.icon-safari { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/istatmenu.png); }
.icon-opera { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/opera.png); }
.icon-appstore { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/Appstore.png); }
.icon-airport { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/AirPortUtility.png); }
.icon-pinterest { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/Pinterest.png); }
.icon-twitter { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/twitter.png); }
.icon-dictionary { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/dictionary.png); }
.icon-notes { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/notes.png); }
.icon-monitor { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/NetworkMonitor.png); }
.icon-imovie { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/imovie.png); }
.icon-texteditor { background: url(https://cdn2.iconfinder.com/data/icons/minimalism/128/tTextEditor.png); }

#icons {
	bottom: 10px;
	color: #9E9E9E;
	left: 10px;
	position: absolute;
	
	a {
		color: #BADA55;
		text-decoration: none;
	}
}
            
          
!
            
              $(function() {
	var launchpad = $("#launchpad"),
		open = function() {
			launchpad.addClass("shown start");
			launchpad.find("nav").addClass("scale-down");
		},
		close = function() {
			launchpad
				.removeClass("start")
				.addClass("end");
			launchpad.find("nav")
				.removeClass("scale-down")
				.addClass("scale-up");
			setTimeout(function() {
				launchpad.removeClass("shown end");
				launchpad.find("nav").removeClass("scale-up");
			}, 350);
		};
	
	// Open the launchpad
	$(".open-menu").on("click", open);
	
	// Close the launchpad when the content is clicked, only if the  target is not a link
	$(document).mouseup(function (e) {
		var content = launchpad.find(".content"),
			nav = content.find("nav");
		
		if (content.is(e.target) || nav.is(e.target)) {
			close();
		}
	});
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console