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.

            
              <body ng-app="app" ng-controller="main">
	<header>
		<div class="heading flex-row align-center">
			<div class="menu flex-auto ghost"><span class="fa fa-bars fa-lg"></span></div>
			<div class="title flex-1 flex-row">
				<span class="flex-auto ghost">MCE Lyneski</span>
				<span class="flex-1">Things</span>
			</div>
			<div class="alerts flex-auto">
				<span class="fa fa-exclamation-circle fa-fw"></span>
				<span class="fa fa-search fa-fw"></span>
				<span class="fa fa-list fa-fw" data-alert="12"></span>
			</div>
		</div>
		<nav>
			<li class="menu flex-auto ghost"><span class="fa fa-bars fa-lg"></span></li>
			<li><a href="#tab-1">Overview</a></li>
			<li class="active"><a href="#tab-2">Inventory Sources</a></li>
			<li><a href="#tab-3">Support</a></li>
			<li><a href="#tab-1">License</a></li>
			<li><a href="#tab-2">Logs</a></li>
			<li><a href="#tab-3">Recovery</a></li>
			<li><a href="#tab-3">Updates</a></li>
			<li class="alerts flex-auto ghost has-alerts">
				<span class="fa fa-exclamation-circle fa-fw primary"></span>
				<span class="fa fa-search fa-fw"></span>
				<span class="fa fa-list fa-fw" data-alert="12"></span>
			</li>
		</nav>
	</header>

	<div class="subheader">
		<div class="pad-y-1">
			<b>Hello World</b>
		</div>
		<div class="toolbar flex-row space-between">
			<div class="flex-row button-bar">
				<button class="control"><span class="fa fa-filter"></span> Filter</button>
				<button class="control"><span class="fa fa-sort-alpha-asc"></span> Name</button>
				<label class="control icon-input"><span class="icon fa fa-search"></span><input type="text" placeholder="find..."></label>
			</div>
			<div class="button-bar">
				<button class="control"><span class="fa fa-cog fa-fw"></span> Actions</button>
			</div>
		</div>
	</div>

	<main>
		<section class="content">
			<div class="item" ng-repeat="item in items">
				<div class="flex-row">
					<div>
						<div class="mark"></div>
					</div>
					<div class="data flex-1 flex-column">
						<h3>{{item.name}}</h3>
						<div><span class="ghost">Label</span> <span>{{item.label}}</span></div>
						<div><span class="ghost">System</span> <span>{{item.system}}</span></div>
						<div><span class="ghost">Build</span> <span>{{item.version}}</span></div>
					</div>
				</div>
			</div>
		</section>
		<aside>
			<div class="label rotate-90">
				<a href="#groups"><span class="fa fa-long-arrow-up"></span> Groups</a>
			</div>
		</aside>
	</main>
</body>
            
          
!
            
              $trans: .2s ease-out;
$shadow: 0 -.3rem .3rem .3rem #000; //0 1px 2px 0 rgba(#000, .5);
$base: #2496E1;

@mixin bg-blend($color1: #2496E1, $color2: #197CD6) {
	background: mix($color1,$color2) linear-gradient(90deg, $color1 36%, $color2);
}

@mixin dot-color($edge-width: .1em) {
	background: #D0021B linear-gradient(-180deg, #F90000, rgba(223,255,0,0.25));
	box-shadow: 0 0 0 $edge-width #E2001C;
	font-family: Helvetica-Bold;
}
// base reset
*, *::before, *::after {
	box-sizing: border-box;
}
html, body {
	margin: 0;
	height: 100%;
	font-family: "Helvetica Neue", sans-serif;
}
a {
	text-decoration: none;
	color: $base;
}
header a {
	color: inherit;
}
button, input[type=text] {
	border: 0;
	box-shadow: 0 0 0 1px rgba(#000, .2);
	background: #dedede;
	border-radius: .3em;
	appearance: none;
	font-size: 1em;
	line-height: 2;
	padding: 0 .5em;
}
input[type=text] {
	background: #fff;
}

// base layout legos
.flex-row {
	display: flex;
	flex-direction: row;
}
.flex-column {
	display: flex;
	flex-direction: column;
}
.flex-1 {
	flex: 1;
}
.flex-auto {
	flex: 0 0 auto;
}
.align-center {
	align-items: center;
}
.space-between {
	justify-content: space-between;
}

// Utility legos
.ghost {
	opacity: .5;
}
.rotate-90 {
	transform: rotate(90deg);
	transform-origin: left center;
}
.pad-1 {
	padding: 1rem;
}
.pad-y-1 {
	padding-top: 1rem;
	padding-bottom: 1rem;
}

// UI specifics
// THE MASTHEAD
header {
	/* @include bg-blend(); */
	box-shadow: $shadow;
	position: relative;
	z-index: 10;
	/* opacity: .3; */
}
.heading {
	@include bg-blend();
	padding: 1rem 1.5rem;
	font-size: 1.3em;
	font-weight: 200;
	line-height: 0;
	color: #fff;
	.menu {
		padding-right: 1rem;
	}
	.title {
		text-transform: uppercase;
		span {
			position: relative;
			+ span {
				padding-left: .5rem;
			}
		}
	}
}
nav {
	@include bg-blend();
	display: flex;
	text-align: center;
	text-transform: uppercase;
	align-items: center;
	font-size: .85em;
	color: #fff;
	/* transition: $trans; */
	li {
		flex: 1 1 auto;
		list-style: none;
		background: rgba(#000, .3);
		box-shadow: 0 .65em 1.65em -1em #000 inset;
		position: relative;
		&.active {
			background: transparent;
			box-shadow: none;
		}
	}
	a {
		display: block;
		padding: 1rem 0;
		text-overflow: ellipsis;
		overflow: hidden;
		white-space: nowrap;
		line-height: 0;
	}
	span {
		display: block;
		position: relative;
	}
	.menu, .alerts {
		font-size: 0;
		transition: $trans;
		padding: 1rem 0;
		line-height: 0;
	}
}
.alerts span {
	position: relative;
	transition: $trans;
}

[data-alert]::after {
	@include dot-color();
	content: attr(data-alert);
	border-radius: 2rem;
	font-size: .4em;
	line-height: 0;
	padding: 1em .5em;
	position: absolute;
	top: 50%;
	left: 100%;
	transform: translate(-65%, -100%);
	/* box-shadow: 0 0 1px 1px; */
}

.subheader {
	background: #eee;
	box-shadow: 0 -1px 0 0 rgba(#000, .2) inset;
	padding: 2rem 1rem 1rem 1rem;
	position: relative;
	z-index: 9;
	/* opacity: .3; */
}

// THE TOOLBAR
.toolbar {
	background: #eee;
	padding: 1rem 0 0 0;
}
.button-bar {
	.control + .control {
		margin-left: .5em;
	}
}
.icon-input {
	position: relative;
	display: inline-block;
	.icon {
		position: absolute;
		top: 50%;
		left: .5em;
		opacity: .35;
		transform: translate(0, -50%);
	}
	input {
		padding-left: 2em;
	}
}

// SIDEBAR
aside {
	border-right: 1px solid rgba(#000, .2);
	background: #efefef;
	padding: .5rem 0;
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 3rem;
	.label {
		position: relative;
		left: 50%;
		top: 0;
		transform: rotate(90deg);
		transform-origin: left center;
		white-space: nowrap;
	}
}

// THE MAIN
main {
	position: relative;
}
.content {
	padding-left: 3rem;
	position: relative;
}
.item {
	padding: 1em 1.5em;
	border-bottom: 1px solid rgba(#000, .05);
	.mark {
		padding: 2em;
		background: #eee;
		border: 1px solid rgba(#000, .1);
		border-radius: 100%;
		margin: 1em;
	}
}
.data {
	h3 {
		margin: 0 0 1em 0;
	}
	line-height: 1.4;
}

// ALTERNATE LAYOUTS
.sticky-heading {
	.heading {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 3;
		box-shadow: $shadow;
	}	
}
.sticky-nav {
	nav {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 3;
		box-shadow: $shadow;
		a {
			padding: 1.5rem 0;
		}
		.menu {
			font-size: 1rem;
			padding: 1rem;
		}
		
		// a @zherring concept
		.alerts {
			padding: 1rem;
			display: flex;
			align-items: center;
			margin-left: 1px;
			.primary {
				font-size: 1rem;
			}
			&.has-alerts {
				opacity: 1;
				&::after {
					content: '';
					@include dot-color;
					border-radius: 2rem;
					font-size: .5rem;
					line-height: 0;
					padding: .4rem;
					position: absolute;
					top: 50%;
					left: 50%;
					transform: translate(0%, -100%);
					transition: $trans;
				}
			}
			&:hover {
				span {
					font-size: 1rem;
					span + span {
						margin-left: 1rem;
					}
					&[data-alert]::after {
						font-size:.575rem;
					}
				}
				&.has-alerts::after {
					padding: 0;
					box-shadow: none;
					font-size: 1rem;
					left: 100%;
					transform: translate(-175%, -100%);
				}
			}
		}

	}
}
.sticky-bar {
	.subheader {
		padding: 0;
	}
	.toolbar {
		position: fixed;
		left: 0;
		right: 0;
		z-index: 2;
		padding: 1rem;
		box-shadow: 0 -1px 0 0 rgba(#000, .2) inset; //$shadow;
	}
}
.sticky-side {
	aside {
		position: fixed;
		left: 0;
		bottom: 0;
		z-index: 1;
	}
}


            
          
!
            
              (function(angular, _){
	'use strict';
	angular.module('app', []).controller('main', ['$scope', '$timeout', function($scope, $timeout){
		
		$scope.body = angular.element('body');

		$scope.items = [];
		_.times(50, function(n){
			$scope.items.push({
				name: 'thing' + n, 
				label: 'Data', 
				system: 'www.the-internet.yes!', 
				version: '2.'+n*Math.E
			});
		});
		
		var stickyEl = function(el, pane, classname, others) {
			var $others = [],
					otherHeight = 0,
					absEl = false,
					$el = angular.element(el),
					$pane = angular.element(pane),
					elHeight = 0, //$el.outerHeight(true),
					$elParent = $el.parent(),
					offset = $el.offset().top - $pane.offset().top;
			
			if(!_.isUndefined(others)) {
				if(_.isArray(others)) {
					_.each(others, function(o){
						$others.push(o);
					});
				} else {
					$others.push(others);
				}
			}
			
			if($el.css('position') === 'absolute' || $el.css('position') === 'fixed') {
				absEl = true;
			}

			if(!absEl) {
				elHeight = $el.outerHeight(true);
			}

			angular.element(window).bind('scroll', _.throttle(function() {
				if($others.length) {
					var h = 0;
					_.each($others, function(o){
						h = h + angular.element(o).outerHeight(true);
					});
					otherHeight = h;
				}
				
				var distance = $pane.scrollTop();
				var elDist = $pane.offset().top + otherHeight;
				var diff = offset - otherHeight;
				
				$scope.body.toggleClass(classname, (distance > diff));

				if($scope.body.hasClass(classname)) {
					$el.css({top: elDist});
					if(!absEl) {
						$elParent.css({paddingTop: elHeight + otherHeight});
					}
				} else {
					$el.css({top: ''});
					$elParent.css({paddingTop: ''});
				}
			}, 0));
		};
		
		var theel, els = [
			'.heading',
			'nav',
			'.toolbar',
			'aside'
		];
		
		if(angular.element('header').find('nav').length) {
			theel = els[1];
			stickyEl('nav', 'body', 'sticky-nav');
		} else {
			theel = els[0];
			stickyEl('.heading', 'body', 'sticky-heading');
		}
		stickyEl('.toolbar', 'body', 'sticky-bar', theel);
		stickyEl('aside', 'body', 'sticky-side', [theel, els[2]]);

	}]);
})(window.angular, window._);
            
          
!
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