Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <div class="menu-container">
  <div class="menu-circle">
    <div class="line-wrapper">
      <span class="line"></span>
      <span class="line"></span>
      <span class="line"></span>
    </div>
  </div>
</div>
              
            
!

CSS

              
                //I'm sure there are some better ways to do this animation. 
//This is my take on this
$bg-color: #ef5350;
$black: #222222;
$sidebar-color: #263238;

//Align the menu in the center of the red area - thanks flexbox!
.menu-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  align-content: center;
  height: 100%;
  width: 70%;
  position: relative;
}

//Draw a white circle outside of the menu lines and align its content div in the center
.menu-circle {
  width: 75px;
  height: 75px;
  background-color: #fff;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-content: center;
  align-items: center;
  cursor: pointer;
  transition: all .3s;
}

//A simple wrapper for our menu lines. Once again thanks flexbox! It's really confusing to work with paddings/margins for the spacing area between lines without flexbox.
.line-wrapper {
  width: 50px;
  height: 26px;
  display: flex;
  justify-content: space-around;
  flex-direction: column;
  align-items: center;
}

//Our menu lines are just empty spans. We give them height, width, and display properties and poof! They appear on the screen!
.line {
  height: 3px;
  width: 30px;
  background: $black;
  display: block;
  border-radius: 50px;
  transition: all .3s
}

//When the user clicks on the menu, we need to make some transformations. Rotate the first line 45 degrees, the third line -45 degrees to draw an X symbol, and throw the middle line on the left and fade it away.
//TranslateX and TranslateY are calculated with the very sophisticated method of trial and error. Yeah I know. Since we're rotating the element, the browser thinks that the center rotates too. So you have to calculate or use some framework like Greensock for crossbrowser compatibility. 
.line-wrapper.clicked .line:nth-child(1) {
  transform: rotate(45deg) translateY(7px) translateX(8px);
}

.line-wrapper.clicked .line:nth-child(3) {
  transform: rotate(-45deg) translateY(-5px) translateX(6px);
}

.line-wrapper.clicked .line:nth-child(2) {
  transform: translateX(-100%);
  opacity: 0;
}

//Top and Left properties are declared for Firefox. Chrome/Edge are clever enough to understand that the absolute position refers to the element that comes before/after them.
.menu-circle:before,
.menu-circle:after {
  content: "";
  display: block;
  height: 150px;
  width: 150px;
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  transition: transform .5s, opacity 1s;
  top: calc(50% - 75px);
  left: calc(50% - 75px);
}

.menu-circle:before {
  background: lighten($bg-color, 25);
  z-index: -1;
}

.menu-circle:after {
  background: lighten($bg-color, 20);
  z-index: -2;
}

.menu-circle.clicked:before {
  transform: scale(1);
  opacity: 0;
}

.menu-circle.clicked:after {
  transform: scale(1.75);
  opacity: 0;
}

//General layout & Responsive

body {
  background: $bg-color;
  height: 100vh;
  width: 100%;
  font-family: 'Raleway';
  font-weight: 100;
  color: white;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  overflow-x: hidden;
}

.sidebar {
    width: 30%;
    background: $sidebar-color;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-width: 360px;
    height: 100vh;
    overflow-y: auto;
}

.sidebar > div {
    padding: 2em 1.5em;
}

.sidebar h1 {
    font-weight: 900;
    text-align: center;
    font-size: calc(25px + (40 - 25) * ((100vw - 300px) / (1600 - 300)));
}

.sidebar h3 {
    text-align: center;
    margin: .75em 0;
    font-size: calc(10px + (20 - 10) * ((100vw - 300px) / (1600 - 300)));
}

.more-link-block {
    margin: 2em 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.more-link-link a {color: white;text-decoration: none;position: relative;display: block;margin: 0 .5em;z-index: 1;padding: .5em;}

.more-link-link {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: .5em 0;
}



.more-link-link a:first-child:after {
    content: "";
    display: block;
    width: 1px;
    height: 40px;
    background: white;
    position: absolute;
    top: -4px;
    left: calc(100% + .5em);
}

.more-link-link a:before {
    content: "";
    display: block;
    width: 1px;
    height: 40px;
    position: absolute;
    top: -4px;
    background: white;
    transition: all .3s;
    z-index: -1;
}

.more-link-link a:first-child:before {
    right: -.6em;
}

.more-link-link a:last-child:before {
    left: -.5em;
}

.more-link-link a:first-child:hover:before {
    width: calc(100% + 1em);
}

.more-link-link a:last-child:hover:before {
    width: calc(100% + 1em);
}

.more-link-link a:hover {
    color: $black;
    font-weight: 400;
    transition: all .3s;
}

.more-link-block p {
    font-weight: 400;
    letter-spacing: .5px;
    line-height: 1.5em;
}

.credit p:first-child a {
    font-weight: 900;
    font-size: 1.5em;
}

.credit p {
    line-height: 1.5em;
}

.credit a {
    color: white;
    font-weight: 600;
}

@media screen and (max-width: 1201px) {
    .sidebar {
        width: 100%;
        order: 1;
    }
}
              
            
!

JS

              
                //You don't really need jQuery for that. But anyway
$(function() {
  $('.menu-circle').click(function() {
    //Toggles the class for the outter circles
    $(this).toggleClass('clicked')
    //Toggles the class for the menu lines transformation into an X symbol
    $('.line-wrapper').toggleClass('clicked')
  })
})
              
            
!
999px

Console