cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

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.

            
              <h1 class="title">Hamburger [<span class="barry">menu</span>]</h1>

<div class="hamburger-menu">
  <span class="seed"></span>
  <span class="seed"></span>
  <span class="seed"></span>
  <span class="seed"></span>
		  <div class="burgher"></div>	
	</div>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Fredoka+One);
html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

/* VARS */
$burgher-width: 100px;
$burgher-height: 10px;
$burgher-spacing: 25px;
$seed-width: 2px;
$seed-height: 4px;
$seed-num: 3;
$ingredient-height: 4px;
$bun-color: #ED9728;
$meat-color: #A65E09;
$tomato-color: #FF6347;
$salad-color: #55AB55;
$background-color: #FAF494;
$font: 'Fredoka One';
$font-color: #403121;
$bounced-timing: cubic-bezier(.64,.57,.47,1.29);
$ease-timing: cubic-bezier(0.23, 1, 0.32, 1);

body {
	background: $background-color;
}

.title {
  font-size: 40px;
  line-height: 60px;
  color: $font-color;
  font-family: $font;
  text-align: center;
  padding-top: 5%;

}



.hamburger-menu {
	position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  width: $burgher-width;
	height: $burgher-height + $burgher-spacing*2;
	cursor: pointer;
  
  .seed {
    width: $seed-width;
    height: $seed-height;
    border-radius: 2px;
    display: inline-block;
    background: lighten($bun-color, 20%);
    position: absolute;
    z-index:9;
    transition: top 300ms $bounced-timing;
    
    &:nth-child(1) {
      top: -10px; 
      left: 21px;
    }
    &:nth-child(2) {
      top: -6px; 
      left: 43px;
    }
    &:nth-child(3) {
      top: -12px; 
      left: 61px;
    }
    &:nth-child(4) {
      top: -8px; 
      left: 81px;
    }
  }
}
.hamburger-menu:hover {
  .seed {
    &:nth-child(1) {
      top: -10px + ($burgher-height + $ingredient-height); 
    }
    &:nth-child(2) {
      top: -6px + ($burgher-height + $ingredient-height); 
    }
    &:nth-child(3) {
      top: -12px + ($burgher-height + $ingredient-height); 
    }
    &:nth-child(4) {
      top: -8px + ($burgher-height + $ingredient-height); 
    }
   }
  &:before {
    top: 21px;
     animation: none;
  }
  &:after {
    bottom: 21px;
    animation: none;
  }
  .burgher:before {
	  bottom: $burgher-height + $ingredient-height;
	  transition: bottom 300ms $bounced-timing;
  }
  .burgher:after {
	  top: $burgher-height + 4;
	  transition: top 300ms $bounced-timing;
  }
}

.hamburger-menu:before,
.hamburger-menu:after,
.burgher,
.burgher:after,
.burgher:before {
  width: $burgher-width;
	height: $burgher-height;
}
.hamburger-menu:before,
.hamburger-menu:after {height: $ingredient-height;}

// tomato
.hamburger-menu:before {
	content: "";
	position: absolute;
	left: 0;
	top: $burgher-spacing - $burgher-height;
  background: $tomato-color;
	transition: top 300ms $bounced-timing;
  border-radius: 2px;
  animation: floaty 3s infinite alternate linear;
}

// salad
.hamburger-menu:after {
	content: "";
	position: absolute;
	left: 0;
	bottom: $burgher-spacing - $burgher-height;
  background: $salad-color;
	transition: bottom 300ms $bounced-timing;
  border-radius: 2px;
  animation: floaty 3s infinite alternate linear;
}

// meat
.burgher {
	position: relative;
	transform: translateY($burgher-spacing);
  background: $meat-color;
	transition: all 0ms 300ms;
  border-radius: 2px;
}

// top bun
.burgher:before {
	content: "";
	position: absolute;
	left: 0;
	bottom: $burgher-spacing;
  background: $bun-color;
	transition: bottom 300ms $bounced-timing;
  width:$burgher-width;
  height: $burgher-height * 3;
  border-radius: 50% 50% 2px 2px;
}

// bottom bun
.burgher:after {
	content: "";
	position: absolute;
	left: 0;
	top: $burgher-spacing;
  background: $bun-color;
	transition: top 300ms $bounced-timing;
  border-radius: 2px;
}


@keyframes floaty {
  0% {
    transform: translate3d(1px, 1px, 0);
  }
  50% {
    transform: translate3d(0, -1px, 0);
  }
  100% {
    transform: translate3d(-1px, 1px, 0);
  }
}
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console