Pen Settings

HTML

CSS

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

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                // Hello, 
// I made this little experiment just for fun. 
// I'm looking for a Web Developer position in London. If you are interested please contact me [moreno at themesholic.com]

header
  h1 CSS3 Explode Menu
  h3 By 
    a(href="https://codepen.io/MorenoDiDomenico/", target="_blank") Moreno Di Domenico


#stage
    
  #circle-menu
    a(class="menu-trigger", href="#", data-open="OPEN", data-close="CLOSE")
    ul
      li
        a(href="#") 
          i(class="wi wi-cloudy-gusts")
      li
        a(href="#") 
          i(class="wi wi-rain-mix")
      li
        a(href="#") 
          i(class="wi wi-day-sleet")
      li
        a(href="#") 
          i(class="wi wi-thunderstorm")

              
            
!

CSS

              
                @import "lesshat";

@circle_width: 100px;

@trigger_color: #e74c3c;
@link1_color: #1abc9c;
@link2_color: #3498db;
@link3_color: #e67e22;
@link4_color: #8e44ad;

body{
  background: #141719;
  font-family: 'Montserrat', sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-font-smoothing:antialiased;
  font-smoothing: antialiased;
}

header{
	text-align: center;
	padding: 120px 0;
  	background: #fff;

	h1{
		margin: 0 0 15px 0;
		padding: 0;
		font-size: 42px;
		font-weight: normal;
	}

	h3{
		margin: 0;
		padding: 0;
		text-transform: uppercase;
		font-size: 14px;
		font-weight: bold;
		color: #999;
		a{
      		color: #09c;
			text-decoration: none;
			
			&:hover{
				color: #09c;
				text-decoration: underline;
			}
		}
	}
}

#stage{
  position: relative;
  height: 500px;
}

#circle-menu{
  display: inline-block;
  width: @circle_width;
  height: @circle_width;
  position: absolute;
  top: 50%;
  left: 50%;
  .transform(translateX(-50%) translateY(-50%));

  .menu-trigger{
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background: @trigger_color;
    color: #fff;
    display: inline-block;
    line-height: @circle_width;
    text-align: center;
    z-index: 9;
    text-decoration: none;
    font-size: .85rem;
    font-weight: bold;
    border: 3px solid transparent;
    .border-radius(50%);
    .transition(all .2s ease);
    
    &:before, &:after{
      position: absolute;
      left: 0;
      width: 100%;
      .transition(all .2s ease);
    }
    
    &:before{
      content: attr(data-open);
    }
    
    &:after{
      content: attr(data-close);
      .opacity(0);
      .transform(translateY(15%));
    }
  }
  
  ul{
    margin: 0;
    padding: 0;
    list-style: none;
    
    li{
      position: absolute;
      width: @circle_width;
      height: @circle_width;
      display: inline-block;
      .border-radius(50%);
      .opacity(0);
      .transition(all 0.85s cubic-bezier(0, 1.8, 1, 1.2));
      
      &:nth-child(1){
        background-color: @link1_color;
      }
      
      &:nth-child(2){
        background-color: @link2_color;
      }
      
      &:nth-child(3){
        background-color: @link3_color;
      }
      
      &:nth-child(4){
        background-color: @link4_color;
      }

      a{
        color: #fff;
        font-size: 1.5rem;
        line-height: @circle_width;
        display: block;
        text-align: center;
      }
    }
  }
  
  &.open{
    
    .menu-trigger{
      background: transparent;
      border-color: @trigger_color;
      
      &:before{
        .opacity(0);
        .transform(translateY(-15%));
      }
      
      &:after{
        .opacity(1);
        .transform(translateY(0));
      }
    }
    
    ul{
      li{
        
        .opacity(1);
        
        &:nth-child(1){
          .transform(translateY(-@circle_width*1.2))
        }
        
        &:nth-child(2){
          .transform(translateX(@circle_width*1.2))
        }
        
        &:nth-child(3){
          .transform(translateY(@circle_width*1.2))
        }
        
        &:nth-child(4){
          .transform(translateX(-@circle_width*1.2))
        }
        
        &:hover{
          
          &:nth-child(1){
             background-color: lighten(@link1_color, 10%);
          }
          
          &:nth-child(2){
             background-color: lighten(@link2_color, 10%);
          }
          
          &:nth-child(3){
             background-color: lighten(@link3_color, 10%);
          }
          
          &:nth-child(4){
             background-color: lighten(@link4_color, 10%);
          }
 
        }
      }
    }
    
  }
}
              
            
!

JS

              
                $('.menu-trigger').on 'click', (e) ->
  e.preventDefault();
  $('#circle-menu').toggleClass('open')
              
            
!
999px

Console