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

              
                .device
	nav
		span.is-active
		a.home(href="#")
			i.fas.fa-home
		a.search(href="#")
			i.fas.fa-search
		a.about(href="#")
			i.fas.fa-bell
			span.badge 7
		a.profile.active(href="#")
			i.fas.fa-user
	.pages
		.comp.comp-home
			header
				h1 home
			section
				p content
			footer
				small footer
		.comp.comp-search
			header
				h1 search
			section
				p content
			footer
				small footer
		.comp.comp-about
			header
				h1 about
			section
				p content
			footer
				small footer
		.comp.comp-profile.is-active
			header 
				h1 Joshua Ward
				.avatar
			.details
				.followers
					h3 1325
					span followers
				.following
					h3 1985
					span following
				.Favorites
					h3 1111
					span favorites
			section
				h5 posts
				.feed
					.feed-item
						.user
							.user-avatar
						.post
							span.user-name Gary Busey &nbsp;
							span.user-handle @garybusey &nbsp;
							span.post-date
								span.date 13 
								span.month January 
								span.year 2019 
								span.time 15:43 
							p.content Busey ipsum dolor sit amet. It's OK to get Rib-grease on your face, because you're allowing people to see that you're proud of these ribs. Did you feel that?
					.feed-item
							.user
								.user-avatar
							.post
								span.user-name Gary Busey &nbsp;
								span.user-handle @garybusey &nbsp;
								span.post-date
									span.date 13 
									span.month January 
									span.year 2019 
									span.time 15:43 
								p.content Busey ipsum dolor sit amet. It's OK to get Rib-grease on your face, because you're allowing people to see that you're proud of these ribs. Did you feel that?
					.feed-item
						.user
							.user-avatar
						.post
							span.user-name Gary Busey &nbsp;
							span.user-handle @garybusey &nbsp;
							span.post-date
								span.date 13 
								span.month January 
								span.year 2019 
								span.time 15:43 
							p.content Busey ipsum dolor sit amet. It's OK to get Rib-grease on your face, because you're allowing people to see that you're proud of these ribs. Did you feel that?
					.feed-item
						.user
							.user-avatar
						.post
							span.user-name Gary Busey &nbsp;
							span.user-handle @garybusey &nbsp;
							span.post-date
								span.date 13 
								span.month January 
								span.year 2019 
								span.time 15:43 
							p.content Busey ipsum dolor sit amet. It's OK to get Rib-grease on your face, because you're allowing people to see that you're proud of these ribs. Did you feel that?
					.feed-item
							.user
								.user-avatar
							.post
								span.user-name Gary Busey &nbsp;
								span.user-handle @garybusey &nbsp;
								span.post-date
									span.date 13 
									span.month January 
									span.year 2019 
									span.time 15:43 
								p.content Busey ipsum dolor sit amet. It's OK to get Rib-grease on your face, because you're allowing people to see that you're proud of these ribs. Did you feel that?
					.feed-item
						.user
							.user-avatar
						.post
							span.user-name Gary Busey &nbsp;
							span.user-handle @garybusey &nbsp;
							span.post-date
								span.date 13 
								span.month January 
								span.year 2019 
								span.time 15:43 
							p.content Busey ipsum dolor sit amet. It's OK to get Rib-grease on your face, because you're allowing people to see that you're proud of these ribs. Did you feel that?
				.loading-more
					i.fas.fa-sync-alt
			footer
				a(href="#") posts
				a(href="#") posts with replies
				a(href="#") favorites
				a(href="#") media


              
            
!

CSS

              
                $base-duration: 250ms;

// Colors
$primary: #4DB6AC;
$accent: #46627f;
$white: whitesmoke;
$light-gray: #999;
$active: #3498db;
$red: #e74c3c;

// Breakpoints
$sm: 20rem;
$med: 48rem;
$lg: 64rem;

// fonts
$sans-serif: 'Roboto', sans-serif;
$slab-serif: 'Roboto Slab', serif;

*, *:before, *:after {
	box-sizing: border-box;
	outline: none;
}

html {
	font-family: $sans-serif;
	font-size: 16px;
	font-smooth: auto;
	font-weight: lighter;
	line-height: 1.5;
	color: #444;
}

body {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100vh;
}

h1, h2, h3, h4, h5 {
	font-family: $slab-serif;
}

p {
	margin-top: 0 !important;
}

.device {
	position: relative;
	display: block;
	width: 375px;
	height: 667px;
	background-color: lighten($primary,10%);
	border-radius: 10px;
	box-shadow: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
	overflow: hidden;
}

.badge {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	top: 10px;
	right: 10px;
	width: 15px;
	height: 15px;
	padding-top: 1px;
	background-color: $red;
	//border: 1px solid white;
	border-radius: 50%;
	box-shadow: 1px 1px 0 darken($accent,5%);
	font-size: 10px;
	font-weight: bold;
	line-height: 1;
	z-index: 99;
	.active & {
		color: $white;
	}
}

.pages {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	.comp {
		position: relative;
		display: none;
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		width: 100%;
		height: 100%;
		margin: 0;
		padding: 0 0 60px;
		background-color: lighten($accent,30%);
		transform: translateX(0%);
		transition: 0.25s;
		animation: slideIn 0.25s ease;
		&.is-active {
			display: flex;
		}
		&-home {
			
		}
		&-search {
			
		}
		&-about {
			
		}
		&-profile {
			.details {
				position: relative;
				display: flex;
				align-items: center;
				justify-content: space-around;
				width: 100%;
				padding: 20px 100px 20px 0;
				background-color: $white;
				> div {
					display: flex;
					flex-direction: column;
					align-items: center;
					justify-content: center;
					text-align: center;
					> span {
						font-size: 12px;
					}
				}
				h3 {
					margin: 0;
					padding: 0;
					color: $primary;
					font-size: 16px;
					font-weight: 700;
				}
			}
		}
		
		header {
			position: relative;
			display: flex;
			align-items: center;
			justify-content: space-between;
			flex: 0 0 10%;
			width: 100%;
			padding: 10px 15px;
			background-color: $primary;
			background-image: url('https://images.pexels.com/photos/459225/pexels-photo-459225.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=750&w=1260');
			background-position: center center;
			background-repeat: no-repeat;
			background-size: cover;
			&:before {
				position: absolute;
				content: '';
				top: 0;
				left: 0;
				width: 100%;
				height: 100%;
				background-color: rgba($primary,0.8);
				z-index: 0;
			}
			h1 {
				margin: 0;
				padding: 0;
				color: $white;
				font-size: 28px;
				text-shadow: 1px 1px $accent;
				animation: headingSlide 0.5s linear;
				z-index: 1;
			}
			.avatar {
				position: relative;
				width: 100px;
				height: 100px;
				margin-top: 60px;
				background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/50325/profile/profile-80.jpg?100000');
				background-position: center center;
				background-repeat: no-repeat;
				background-size: cover;
				border-radius: 50%;
				border: 5px solid white;
				box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
				text-align: center;
				transform: translateY(0%);
				animation: avatarSlide 0.5s ease;
				z-index: 99;
				span {
					position: absolute;
					bottom: -30px;
					left: 50%;
					width: 100%;
					color: $light-gray;
					font-size: 11px;
					transform: translateX(-50%);
					i {
						margin-left: 2px;
					}
				}
			}
		}
		section {
			position: relative;
			display: flex;
			flex-direction: column;
			flex: 0 1 auto;
			width: 100%;
			padding: 10px 15px 0;
			background-color: white;
			overflow-y: scroll;
			h5 {
				margin: 0;
				//background: red;
				color: $light-gray;
				text-transform: uppercase;
			}
			.feed {
				position: relative;
				flex: 1 0 auto;
				width: 100%;
				//height: 100%;
				.feed-item {
					position: relative;
					display: flex;
					align-items: flex-start;
					width: 100%;
					padding: 15px 10px;
					border-bottom: 1px solid lighten($light-gray,30%);
					.user {
						position: relative;
						display: flex;
						align-items: center;
						flex: 0 1 50px;
						padding-right: 10px;
						&-avatar {
							position: relative;
							display: flex;
							align-items: center;
							justify-content: center;
							width: 40px;
							height: 40px;
							background-color: lightgray;
							border: 3px solid $white;
							border-radius: 50%;
							box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
							&:before {
								position: absolute;
								content: '\f007';
								font-family: "Font Awesome 5 Free";
								font-size: 12px;
							}
						}
					}
					
					.post {
						position: relative;
						font-size: 12px;
						.user-name {
							font-weight: bold;
						}
						.user-handle {
							font-weight: bold;
							color: $primary;
						}
						.post-date {
							color: $light-gray;
						}
						p.content {
							margin: 0;
						}
					}
				}
			}
		}
		footer {
			position: relative;
			display: flex;
			align-items: center;
			justify-content: space-around;
			flex: 0 0 auto;
			width: 100%;
			padding: 3px 20px;
			background-color: $white;
			> a {
				color: $primary;
				font-size: 12px;
				text-decoration: none;
			}
		}
	}
}

@keyframes slideIn {
	0%   { transform: translateX(-100%); }
	100% { transform: translateX(0%); }
}

@keyframes headingSlide {
	0%   { transform: translateX(-100%); }
	50%  { transform: translateX(30%); }
	75%  { transform: translateX(-30%); }
	100% { transform: translateX(0); }
}

@keyframes avatarSlide {
	0%   { transform: translateY(-300%); }
	100% { transform: translateY(0%); }
}

nav {
	position: absolute;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 375px;
	height: 60px;
	background-color: lighten($accent,10%);
	//border-radius: 0 0 8px 8px;
	box-shadow: 0 0 3px rgba(0,0,0,0.12), 0 0 2px rgba(0,0,0,0.24);
	overflow: hidden;
	z-index: 9999;
	// &:before {
	// 	position: absolute;
	// 	content: '';
	// 	top: -5px;
	// 	left: 0;
	// 	width: 100%;
	// 	height: 5px;
	// 	background-color: rgba($accent,0.4);
	// }
	span.is-active {
		position: absolute;
		top: 0;
		left: 75%;
		width: 25%;
		height: 100%;
		background-color: $white;
		box-shadow: 0 0 10px 0 rgba(black,0.4);
		transition: left 0.25s ease-in-out;
		z-index: 0;
		&:before {
			position: absolute;
			content: '';
			top: 0;
			left: 0;
			width: 100%;
			height: 5px;
			background-color: $primary;
			z-index: 1;
		}
	}
	a {
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		width: 25%;
		height: 100%;
		padding: 0;
		color: $white;
		text-decoration: none;
		&.active {
			color: $primary;
		}
		> i {
			font-size: 18px;
		}
		> div {
			font-size: 12px;
		}
	}
} 

.loading-more {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 30px 0;
	color: $primary;
	animation: spinner 1s linear infinite;
}

@keyframes spinner {
	100% { transform: rotate(360deg);}
}
              
            
!

JS

              
                $('nav').find('a').click(function() {
	$('nav').find('a.active').removeClass('active');
	$(this).addClass('active');
	if($('a.active').is('.search')) {
		$('span.is-active').css('left','25%');
	} else if($('a.active').is('.about')) {
		$('span.is-active').css('left','50%');
	} else if($('a.active').is('.profile')) {
		$('span.is-active').css('left','75%');
	} else {
		$('span.is-active').css('left','0%');
	}
	if($('.search').is('.active')) {
		$('.pages').find('.is-active').removeClass('is-active');
		$('.comp-search').addClass('is-active');
	} else if($('.about').is('.active')) {
		$('.pages').find('.is-active').removeClass('is-active');
		$('.comp-about').addClass('is-active');
	} else if($('.profile').is('.active')) {
		$('.pages').find('.is-active').removeClass('is-active');
		$('.comp-profile').addClass('is-active');
	} else {
		$('.pages').find('.is-active').removeClass('is-active');
		$('.comp-home').addClass('is-active');
	};
});

              
            
!
999px

Console