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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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

Looking for quick-add? Try the external resource search, it's quicker and gives you access to the most recent version of thousands of libraries. ☝️

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.

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