cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              #top-bar.top-bar
	.bar
		button#navbox-trigger.navbox-trigger: i.fa.fa-lg.fa-th
	.navbox
		.navbox-tiles
			a.tile(href="#")
				.icon: i.fa.fa-home
				span.title Home
			a.tile(href="#")
				.icon: i.fa.fa-camera-retro
				span.title Gallery
			a.tile(href="#")
				.icon: i.fa.fa-question-circle
				span.title FAQ
			a.tile(href="#")
				.icon: i.fa.fa-lg.fa-envelope-o
				span.title Contact
			a.tile(href="#")
				.icon: i.fa.fa-wordpress
				span.title Blog
            
          
!
            
              /* Reset */
@import url(//codepen.io/chrisdothtml/pen/ojLzJK.css);

html,
body {
	height: 100%;
}

// Variables
$theme-color: #3498db;
$anim-speed: .2s;

// Mixins
@mixin animate($property: 'all') {
	transition: $property $anim-speed;
}

// Extenders
%animate {
	transition: all .3s;
}

%clearfix:after {
	content: '';
	display: table;
	clear: both;
}

/* Core Styles */
.top-bar {
	height: 50px;
	position: relative;
	z-index: 1000;
	@extend %animate;
	
	.bar {
		background-color: #252525;
		width: 100%;
		height: 100%;
		position: absolute;
		z-index: 2;
	}

	.navbox {
		visibility: hidden;
		opacity: 0;
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 1;
		transform: translateY(-200px);
		transition: all .2s;
	}
	
	.navbox-tiles {
		transform: translateY(-200px);
		@extend %animate;
	}
	
	&.navbox-open {
		
		.navbox-trigger {
			background-color: #484747;
		}
		
		.navbox {
			visibility: visible;
			opacity: 1;
			transform: translateY(0);
			transition: opacity .3s, transform .3s;
		}
		
		.navbox-tiles {
			transform: translateY(0);
		}
	}
}

.navbox-trigger {
	background-color: transparent;
	width: 50px;
	height: 50px;
	line-height: 50px;
	text-align: center;
	user-select: none;
	@include animate(background-color);

	.fa {
		font-size: 20px;
		color: #fff;
	}

	&:hover {
		background-color: #484747;
	}
}

.navbox {
	background-color: #484747;
	width: 100%;
	max-width: 380px;
	backface-visibility: initial;
}

.navbox-tiles {
	width: 100%;
	padding: 25px;
	@extend %clearfix;
	
	.tile {
		display: block;
		background-color: $theme-color;
		width: 30.3030303030303%;
		height: 0;
		padding-bottom: 29%;
		float: left;
		border: 2px solid transparent;
		color: #fff;
		position: relative;
		@include animate(border-color);
		
		.icon {
			width: 100%;
			height: 100%;
			text-align: center;
			position: absolute;
			top: 0;
			left: 0;
			
			.fa {
				font-size: 35px;
				position: absolute;
				top: 50%;
				left: 50%;
				transform: translate(-50%, -50%);
				backface-visibility: initial;
				@extend %animate;
			}
		}
		
		.title {
			padding: 5px;
			font-size: 12px;
			position: absolute;
			bottom: 0;
			left: 0;
			@extend %animate;
		}
		
		&:hover {
			border-color: #fff;
			text-decoration: none;
		}
		
		&:not(:nth-child(3n+3)) {
			margin-right: 4.54545454545455%;
		}
		
		&:nth-child(n+4) {
			margin-top: 15px;
		}
	}
}

@media screen and (max-width: 370px) {
	
	.navbox-tiles .tile {

		.icon .fa {
			font-size: 25px;
		}

		.title {
			padding: 3px;
			font-size: 11px;
		}
	}
}
            
          
!
            
              $(document).ready ->
	$('#navbox-trigger').click ->
		$('#top-bar').toggleClass 'navbox-open'
	
	$(document).on 'click', (e) ->
		$target = $(e.target)
		boxClicked = $target.closest('.navbox').length
		triggerClicked = $target.closest('#navbox-trigger').length
		
		if !boxClicked and !triggerClicked
			$('#top-bar').removeClass 'navbox-open'
            
          
!
999px
Loading ..................

Console