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 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.

            
              <div class="container">
  <h1>CSS3 Mobile <span>Menu</span> Icons vol.1</h1>
  <p class="subheader">(click on them) / check on github - <span>https://github.com/eisenfox/menu-icons</span></p>
  
  <div class="icons-container">
    
    <!--icon #1-->
    <div class="icon">
      <h2>#1</h2>
      <div class="menu-icon menu-icon-1">
        <div class="bar bar-1"></div>
        <div class="bar bar-2"></div>
        <div class="bar bar-3"></div>
      </div>
    </div>
    
    <!--icon #2-->
    <div class="icon">
      <h2>#2</h2>
      <div class="menu-icon menu-icon-2">
        <div class="bar bar-1"></div>
        <div class="bar bar-2"></div>
        <div class="bar bar-3"></div>
      </div>
    </div>
    
    <!--icon #3-->
    <div class="icon">
      <h2>#3</h2>
      <div class="menu-icon menu-icon-3">
        <div class="bar bar-1"></div>
        <div class="bar bar-2"></div>
        <div class="bar bar-3"></div>
      </div>
    </div>
    
    <!--icon #4-->
    <div class="icon">
      <h2>#4</h2>
      <div class="menu-icon menu-icon-4">
        <div class="bar bar-1"></div>
        <div class="bar bar-2"></div>
        <div class="bar bar-3"></div>
      </div>
    </div>
    
    <!--icon #5-->
    <div class="icon">
      <h2>#5</h2>
      <div class="menu-icon menu-icon-5">
        <div class="bar bar-1"></div>
        <div class="bar bar-2"></div>
        <div class="bar bar-3"></div>
      </div>
    </div>
    
    <!--icon #6-->
    <div class="icon">
      <h2>#6</h2>
      <div class="menu-icon menu-icon-6">
        <div class="bar bar-1"></div>
        <div class="bar bar-2"></div>
        <div class="bar bar-3"></div>
      </div>
    </div>
         
  </div>
</div>
            
          
!
            
              $accent-color: #7B4B94;
$base-bg: lighten($accent-color, 50%);;
$basic-icon-color: #000;

//mixins
@mixin position-absolute ($top: null, $left: null, $right: null, $bottom: null) {
  position: absolute;
  top: $top;
  left: $left;
  right: $right;
  bottom: $bottom;
}

/* common styles !!!YOU DON'T NEED THEM  */
body {
  background-color: $base-bg;
}

.container {
  width: 550px;
  margin: 70px auto 0px auto;
  text-align:  center;
  
  h1 {
    font: {
      family: 'Oxygen', sans-serif;
      size: 25px;
    }
    margin-bottom: 20px;
    
    span {
      color: $accent-color;
      position: relative;
      background-color: $base-bg;
      display: inline-block;
      
      &:after {
        content: "";
        display: block;
        @include position-absolute($top: -17px, $left: 0, $right: 0);
        width: 2px;
        height: 60px;
        margin: auto;
        background-color: $accent-color;
        transform: rotate(45deg);
        z-index: -1;
      }
    }
  }
  
  .subheader {
    margin-bottom: 50px;
     font: {
      family: 'Oxygen', sans-serif;
      size: 15px;
    }
    
    span {
      color: $accent-color;
    }
  }
  
  .icon {
    margin-right: 50px;
    width: 60px;
    
    h2 {
      margin-bottom: 20px;
    }
  }
  
  .icons-container {
    display: flex;
  }
}

/* icon basic styles !!!YOU NEED THEM  */
.menu-icon {
  height: 43px;
  cursor: pointer;
  width: 50px;
  position: relative;
  
  .bar {
    width: 100%;
    height: 8px;
    background-color: $basic-icon-color; //change on your own mobile menu color
    border-radius: 20px;
    
    &-1 {
      @include position-absolute($top: 0px, $left: 0);
    }
    
    &-2 {
      @include position-absolute($top: 17px, $left: 0);
    }
    
    &-3 {
      @include position-absolute($top: 34px, $left: 0);
    }
  }
}

/* icon #1  */
.menu-icon.menu-icon-1 {
  transition: all 0.2s linear 0s;
  
  &.opened {
    transform: rotate(90deg);
    
    .bar {
      transition: all 0.2s linear 0.2s;
      transform: scale(0.2, 1);
      transform-origin: center center;
    }
  }
}

/* icon #2  */
.menu-icon.menu-icon-2 {
  transition: all 0.2s linear 0.2s;
  
   &.opened {
    transform: rotate(90deg);
     
    .bar {
      transition: all 0.2s linear 0s;
      transform: scale(0.5, 1);
      transform-origin: center center;
    }
  }
}

/* icon #3  */
.menu-icon.menu-icon-3 {
  
  .bar {
    transform-origin: right center;
  }
  
  &.opened {
    
    .bar {
      transition: all 0.2s linear 0.1s;
      
      &-1 {
        transform: scaleX(0.7) rotate(18deg);
        @include position-absolute($top: 17px, $left: 0);
      }
      
      &-3 {
        transform: scaleX(0.7) rotate(-18deg);
        @include position-absolute($top: 17px, $left: 0);
      }
    }
  }
}

/* icon #4  */
.menu-icon.menu-icon-4 {
  transform-origin: center center;
  
  &.opened {
    transition: all 0.3s linear 0.2s;
    transform: rotate(90deg) scale(0.4, 1);
    
    .bar {
      transition: all 0.2s linear 0s;
      
      &-1,
      &-3 {
        @include position-absolute($top: 17px, $left: 0);
      }
    }
  }
}

/* icon #5  */
.menu-icon.menu-icon-5 {
  transition: all 0.2s linear 0s;
  
  .bar {
    transition: all 0.2s linear 0.2s
  }
  
  &.opened {
    transform: rotate(90deg);
    
    .bar {
      
      &-2 {
        opacity: 0;
      }
      
      &-1 {
        transform: rotate(45deg);
        @include position-absolute($top: 17px, $left: 0);
      }
      
      &-3 {
        transform: rotate(-45deg);
        @include position-absolute($top: 17px, $left: 0);
      }
    }
  }
}

/* icon #6  */
.menu-icon.menu-icon-6 {
  transition: all 0.2s linear 0s;
  
  .bar {
    transition: all 0.2s linear 0s;
  }
  
  &.opened {
    transform: rotate(90deg);
    
    .bar {
      transform: scale(0.3,1);
      transform-origin: center center;
      
      &-1 {
        transition: all 0.2s linear 0.2s;
      }
      
      &-2 {
        transition: all 0.2s linear 0.3s;
      }
      
      &-3 {
        transition: all 0.2s linear 0.4s;
      }
    }
  }
}
            
          
!
            
              jQuery('.menu-icon').click(function() {
  jQuery(this).toggleClass('opened');
});
            
          
!
999px
Loading ..................

Console