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="h-menu">
  <div class="icn-h-menu">
    <span class="ihm-1"></span>
    <span class="ihm-2"></span>
    <span class="ihm-3"></span>
  </div>
</div>
            
          
!
            
              //------------------------------------------------------
//Setting
$icn-color: #777;
$ratio:3; //Original size is 48 x 48 px square
$speed:0.2s;
//------------------------------------------------------
//Button and Background
html{
  font-size:16px * $ratio;
  background: radial-gradient(50% 16%, circle, #219eb0 32%, #3f679d 88%);
  height:100%;
  width:100%;
}
.h-menu{
  //Centering
  box-sizing:border-box;
  margin:auto;
  position:absolute;
  top:0;
  right:0;
  bottom:0;
  left:0;
  //Button design
  border-top:1px solid #f6f6f6;
  background:linear-gradient(to bottom, #e0e0e0 32%, #fafafa 88%);
  border-radius:0.5rem;
  box-shadow:0 0.375rem 1rem 0 rgba(0,0,0,0.3);
  transition: box-shadow $speed, background $speed;
  cursor:pointer;
  
  //Size
  width:3rem;
  height:3rem;
  //layout
  padding:0.75rem;
  
  //Interaction
    &.is-hover{
     box-shadow:0 .125rem 0.75rem 0 rgba(0,0,0,0.5);
    background:linear-gradient(to bottom, #dfdfdf 32%, #f0f0f0 88%);
    }
    &.is-mousedown{
      border-top:1px solid #dfdfdf;
      box-shadow:0 0px 0.5rem 0 rgba(0,0,0,0.6);
    }
    
}

//------------------------------------------------------
//Icon design
.icn-h-menu {
  position:relative;
  top:0.1875rem;

    span{
      display:block;
      width:1.5rem;
      height:0.0625rem;
      background: $icn-color;
      position:absolute;
      transition:transform $speed, opacity $speed, width $speed;

      &.ihm-2{
        top:0.5rem;
      }
      &.ihm-3{
        top:1rem;
      }
    }
}
//------------------------------------------------------
//Transition to Arrow Icon
.h-menu.is-active{
  .icn-h-menu{
    .ihm-1{
      transform: rotate(-225deg) translate3d(0.187rem,0.08rem,0); 
      width:1.25rem;
    }
    .ihm-2{
      transform:rotate(180deg);
    }
    .ihm-3{
      transform:rotate(225deg) translate3d(0.1875rem,-0.08rem,0);
      width:1.25rem;
    }
  }
}

            
          
!
            
              $(document).ready(function() {
  function arrow(){
        $(".h-menu").addClass('is-active');
    setTimeout(function(){
      init();
    },1000);
       
  }
  setTimeout(function(){
    arrow();
  },1000);
  
 
  function init(){
    
    $('.h-menu').on('click',
      function(){
        $(this).toggleClass('is-active');
    });
  }
  
  $('.h-menu').hover(function(){
    $(this).addClass('is-hover');
  },function(){
    $(this).removeClass('is-hover');
  });
  
  $('.h-menu').on('mousedown',function(){
    $(this).addClass('is-mousedown');
  });
  $('.h-menu').on('mouseup',function(){
    $(this).removeClass('is-mousedown');
  });
});
            
          
!
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