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="mobile-container">

  <a href="#" class="letter-trigger">
    <span class="m letter">M</span>
    <span class="e letter">E</span>
    <span class="n letter">N</span>
    <span class="u letter">U</span>

    <span class="bar-1"></span>
    <span class="bar-2"></span>
  </a>
  
  <h2>Title Here</h2>
  
  <div class="mobile-nav-container">
    
    <ul id="mobile-nav">

      <li><a href="#">Home</a></li>
      <li><a href="#">About</a></li>
      <li><a href="#">The Team</a></li>
      <li><a href="#">Portfolio</a></li>
      <li><a href="#">Contact</a></li>

    </ul>
    
  </div>
  
  <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut sodales metus sodales diam ultrices, vitae ullamcorper augue mattis. Maecenas blandit gravida mi, id interdum urna tempor vel. Proin leo tortor, mollis a gravida et, lacinia a metus. Aenean nec mollis tortor. Nam vulputate risus dolor, nec dictum sem tempor vitae. Suspendisse eget malesuada nisi, dapibus luctus augue. Nullam condimentum lectus iaculis arcu tincidunt commodo. Etiam eget magna at ipsum commodo fringilla. Fusce nisi eros, facilisis at libero nec, pharetra consequat mauris.</p>
  
</div>
            
          
!
            
              // ----- Set Up
$mobile-color: #29917f;
$maintext: #2f2f2f;

@import url(https://fonts.googleapis.com/css?family=Roboto:300);

* {
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
}

@mixin font-size( $fontSize:16, $baseSize: 16) {
	font-size: #{$fontSize}px;
	font-size: #{($fontSize/$baseSize)}rem;
}

@mixin ease ($dur:0.5s) {
	-webkit-transition: $dur ease;
	-moz-transition: $dur ease;
	-o-transition: $dur ease;
	transition: $dur ease;
}

@mixin transition($duration:0.2s, $ease:ease-out) {
	-webkit-transition: all $duration $ease;
	-moz-transition: all $duration $ease;
	transition: all $duration $ease;
}

@mixin translate($x:0, $y:0) {
	-moz-transform: translate($x, $y);
	-webkit-transform: translate($x, $y);
	-o-transform: translate($x, $y);
	-ms-transform: translate($x, $y);
	transform: translate($x, $y);
}

@function shade($color, $percent){
	@return mix(black, $color, $percent);
}

.mobile-container {
  background: #ccc;
  margin: 0 auto;
  max-width: 480px;
  padding: 15px 15px 200px;
  position: relative;
  width: 100%;
}

h2,
p {
  font-family: 'Roboto', sans-serif;
}

h2 {
  margin: 0;
  padding-top: 5px;
  padding-bottom: 10px;  
}

p {
  text-align: justify;
}

// ----- Menu Icon
.letter-trigger {
	background: white;
	border: 2px solid $mobile-color;
	display: block;
	height: 54px;
	line-height: 1;
	overflow: hidden;
	position: absolute;
	top: 10px;
	right: 15px;
	width: 54px;
	&:focus {
		outline: none;
	}
}

.letter {
	@include ease(0.3s);
	@include font-size(21);
	color: $maintext;
	font-family: 'Roboto', sans-serif;
	position: absolute;
}
.m {
	top: 4px;
	left: 7px;
	.open & {
		transform: translateX(-24px);
	}
}
.e {
	top: 4px;
	right: 8px;
	.open & {
		transform: translateX(-43px);
	}
}
.n {
	bottom: 4px;
	left: 7px;
	.open & {
		transform: translateX(43px);
	}
}
.u {
	right: 7px;
	bottom: 4px;
	.open & {
		transform: translateX(21px);
	}
}

[class^="bar-"] {
	@include ease(0.3s);
	background: $mobile-color;
	border-radius: 5px;
	display: block;
	height: 3px;
	opacity: 1;
	position: absolute;
	top: 23px;
	left: 2px;
	width: 46px;
}

.bar-1 {
	transform: rotate(-45deg) translateX(59px);
	.open & {
		transform: rotate(-45deg) translateX(0px);
	}
}

.bar-2 {
	transform: rotate(45deg) translateX(-59px);
	.open & {
		transform: rotate(45deg) translateX(0px);
	}
}

// ----- Mobile Menu
#mobile-nav {
  list-style-type: none;
  margin: 10px 0 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  right: 15px;
  left: 15px;
  visibility: hidden;
  z-index: 150;
  li {
		@include ease(0.3s);
		@include translate(100%,0);
		background: $mobile-color;
		opacity: 0;
    + li {
      border-top: 2px solid shade($mobile-color,20%);
    }
		// this generates the delay, adding more delay for each one. Currently it's set to 5, as there are 5 menu items, but larger menus will require a higher value
		@for $i from 1 through 5 {
			&:nth-of-type(#{$i}) {
				$delay: $i * 0.05;
				-webkit-transition-delay: #{$delay}s;
				-moz-transition-delay: #{$delay}s;
				-o-transition-delay: #{$delay}s;
				transition-delay: #{$delay}s;
			}
		}
	}
  .open & {
    visibility: visible;
    li {
      @include translate(0,0);
      opacity: 1;
    }
  }
  a {
    @include font-size(18);
    color: white;
    display: block;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    padding: 10px 0;
    text-align: center;
    text-decoration: none;
  }
}
            
          
!
            
              jQuery(document).ready(function($) {

	$(".letter-trigger").click(function(e){
		e.preventDefault();
		$('.letter-trigger').toggleClass('open');
    $('.mobile-nav-container').toggleClass('open');
	});

});
            
          
!
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