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

              
                nav
  input.toggle#nav(type="checkbox")
  label.label(for="nav")
    p Menu
    span.hum
    ul.list
      li.list__home: a(href="#0") Home
      li.list__about: a(href="#0") About
      li.list__clients
        a(href="#0")
          span Clients
        ul.list__clientsItems
          li: a(href="#0") Burger King
          li: a(href="#0") Southwest Airlines
          li: a(href="#0") Levi Strauss
      li.list__strauss
        a(href="#0")
          span Services
        ul.list__straussItem
          li: a(href="#0") Print Design
          li: a(href="#0") Web Design
          li: a(href="#0") Mobile App Development
      li.list__contact: a(href="#0") Contact

              
            
!

CSS

              
                $BG: #e2eff1;
$TOGGLE: #e23e57;
$TOGGLE2: #65799b;
$TOGGLE3: #555273;
$BORDER: #555273;
$FONT: #e2eff1;

$TOGGLE_SIZE: 100px;

@import url("https://fonts.googleapis.com/css?family=Cute+Font&display=swap");

@mixin prefixes($property, $value) {
  @each $prefix in -webkit-, -moz-, -ms-, -o-, "" {
    #{$prefix}#{$property}: $value;
  }
}

%input {
  position: absolute;
  opacity: 0;
  bottom: 0;
  z-index: -1;
  @include prefixes(transform-origin, bottom center);
  @include prefixes(box-sizing, border-box);

  &:after {
    top: 100px;
    width: 1px;
    height: 100%;
    background: $BORDER;
    z-index: -1;
  }
  a {
    display: flex;
    width: 100px;
    height: 100px;
    @include prefixes(align-items, center);
    margin: auto;
    justify-content: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    border-radius: 50%;
    line-height: 1;
    color: $FONT;
    @include prefixes(box-sizing, border-box);

    &:visited,
    &:active {
      color: $FONT;
    }
    &:hover {
      color: #fff;
    }
  }
}

%inputCheck {
  opacity: 1;
  z-index: 0;
}

nav {
  position: relative;
  margin: auto;
  width: 500px;
  height: 100%;
  @include prefixes(transform, scale(0.8));
}

ul {
  padding: 0;
  margin: 0;
  font-size: 30px;
  text-align: center;
}

li {
  list-style: none;
}

.toggle {
  opacity: 0;
  &:checked {
    & + .label {
      .hum {
        @include prefixes(transition, 0.8s);
        @include prefixes(transform, rotate(45deg) translate(10px, 10px));
        &:before {
          @include prefixes(transition, 0.8s);
          @include prefixes(transform, rotate(-90deg) translate(10px, 0px));
        }
        &:after {
          opacity: 0;
          @include prefixes(transition, 0.8s);
          @include prefixes(transform, rotate(-90deg) translate(20px, 0px));
        }
      }
      .list {
        &__home {
          @extend %inputCheck;
          opacity: 1;
          height: 200px;
          @include prefixes(transition, 0.8s);
        }
        &__about {
          @extend %inputCheck;
          opacity: 1;
          height: 200px;
          @include prefixes(transition, 0.8s);
        }
        &__clients {
          @extend %inputCheck;
          opacity: 1;
          @include prefixes(transition, 0.8s);
          @include prefixes(transform, translate(200px, -200px) rotate(45deg));

          &:after {
            height: 36px;
            @include prefixes(transition, 1.1s);
          }
          li {
            opacity: 0;
          }
        }
        &__strauss {
          @extend %inputCheck;
          opacity: 1;
          @include prefixes(transition, 0.8s);
          @include prefixes(transform, translate(90px, -260px) rotate(-135deg));

          &:after {
            height: 36px;
            @include prefixes(transition, 1.1s);
          }
        }
        &__clientsItems {
          &:nth-of-type(1) {
            height: 0;
          }
        }
        &__contact {
          @extend %inputCheck;
          opacity: 1;
          height: 200px;
          @include prefixes(transition, 0.8s);
        }
      }
    }
  }
}

.label {
  position: absolute;
  top: calc(50% - (100px / 2));
  left: calc(50% - (100px / 2));
  width: $TOGGLE_SIZE;
  height: $TOGGLE_SIZE;
  background-color: $TOGGLE;
  border-radius: 50%;
  z-index: 10;
}

.list {
  position: absolute;
  top: -200px;
  left: calc(50% - 250px);
  width: 500px;
  height: 500px;
  @include prefixes(transform-origin, center);

  &__home {
    @extend %input;
    height: 10px;
    transform: translate(200px, -300px);
    -webkit-transform: translate(200px, -300px);
    overflow: hidden;
    @include prefixes(transition, 0.8s);
    @include prefixes(transform, translate(200px, -300px));

    a {
      background: $TOGGLE2;
    }
  }
  &__about {
    @extend %input;
    height: 10px;
    overflow: hidden;
    transform: translate(158px, -275px) rotate(-45deg);
    @include prefixes(transform,  translate(158px, -275px) rotate(-45deg));
    @include prefixes(transition, 0.8s);
    a {
      background: $TOGGLE2;
      @include prefixes(transform,  rotate(45deg));
    }
  }
  &__clients {
    @extend %input;
    width: 300px;
    height: 300px;
    @include prefixes(transition, 0.8s);
    @include prefixes(transform,  translate(100px, -110px) rotate(45deg));

    a {
      background: $TOGGLE2;
      span {
        @include prefixes(transform,  rotate(-45deg));
      }
    }
    &:after {
      top: 250px;
      width: 1px;
      height: 0;
      background: $BORDER;
      left: 45px;
      @include prefixes(transition, 0.3s);
    }
    .list__clientsItems {
      @include prefixes(transition, 0.8s);
      li {
        @extend %input;
        @include prefixes(transition, 0.8s);
        opacity: 0;
        width: 100px;
        height: 0;
        overflow: hidden;
        &:after {
          z-index: -1;
        }
        a {
          margin: 0 0 auto 0;
          background: $TOGGLE3;
        }
        &:after {
          top: 100px;
          left: 50px;
        }
        &:nth-of-type(1) {
          @include prefixes(transform,  scale(0.8) translate(-15px, -155px) rotate(-20deg));

          a {
            @include prefixes(transform,  rotate(-25deg));
          }
        }
        &:nth-of-type(2) {
          font-size: 22px;
          @include prefixes(transform,  scale(0.8) translate(20px, -148px) rotate(30deg));

          a {
            @include prefixes(transform, rotate(-75deg));
          }
        }
        &:nth-of-type(3) {
          @include prefixes(transform,  scale(0.8) translate(33px, -107px) rotate(120deg));

          &:after {
            top: 100px;
            @include prefixes(transition, 0s);
          }
          a {
            @include prefixes(transform, rotate(195deg));
          }
        }
      }
    }
    &:hover {
      opacity: 1;
      ul,
      li {
        display: flex;
        display: -webkit-box;
        display: -ms-flexbox;
        @include prefixes(align-items, center);
      }
      .list__clientsItems {
        @include prefixes(transition, 0.8s);
        li {
          &:nth-of-type(1) {
            height: 200px;
            opacity: 1;
          }
          &:nth-of-type(2) {
            height: 225px;
            opacity: 1;
          }
          &:nth-of-type(3) {
            height: 210px;
            opacity: 1;
          }
        }
      }
    }
    a {
      margin: 150px 0 0 0;
    }
  }
  &__strauss {
    @extend %input;
    width: 200px;
    height: 300px;
    @include prefixes(transition, 0.8s);
    @include prefixes(transform,  translate(185px, -355px) rotate(-135deg));

    a {
      background: $TOGGLE2;
      span {
        @include prefixes(transform,  rotate(135deg));
      }
    }
    &:after {
      top: 250px;
      width: 1px;
      height: 0;
      background: $BORDER;
      left: 45px;
      @include prefixes(transition, 0.3s);
    }
    .list__straussItem {
      @include prefixes(transition, 0.8s);

      li {
        @extend %input;
        opacity: 0;
        width: 100px;
        height: 0;
        overflow: hidden;
        @include prefixes(transition, 0.8s);

        &:after {
          z-index: -1;
        }
        a {
          margin: 0 0 auto 0;
          background: $TOGGLE3;
        }
        &:after {
          top: 100px;
          left: 50px;
        }
        &:nth-of-type(1) {
          @include prefixes(transform,  scale(0.8) translate(-15px, -160px) rotate(-20deg));

          a {
            @include prefixes(transform,  rotate(155deg));
          }
        }
        &:nth-of-type(2) {
          font-size: 22px;
          @include prefixes(transform,  scale(0.8) translate(20px, -155px) rotate(30deg));

          a {
            @include prefixes(transform,  rotate(105deg));
          }
        }
        &:nth-of-type(3) {
          font-size: 22px;
          @include prefixes(transform, scale(0.8) translate(30px, -105px) rotate(120deg));

          &:after {
            top: 100px;
          }
          a {
            @include prefixes(transform, rotate(15deg));
          }
        }
      }
    }
    &:hover {
      opacity: 1;
      ul,
      li {
        display: flex;
        display: -webkit-box;
        display: -ms-flexbox;
        @include prefixes(align-items, center);
      }
      .list__straussItem {
        @include prefixes(transition, 0.8s);

        li {
          &:nth-of-type(1) {
            height: 200px;
            opacity: 1;
          }
          &:nth-of-type(2) {
            height: 230px;
            opacity: 1;
          }
          &:nth-of-type(3) {
            height: 225px;
            opacity: 1;
          }
        }
      }
    }
    a {
      margin: 150px 0 0 0;
    }
  }
  &__contact {
    @extend %input;
    height: 10px;
    overflow: hidden;
    @include prefixes(transition, 0.8s);
    @include prefixes(transform, translate(230px, -210px) rotate(135deg));

    a {
      background: $TOGGLE2;
      @include prefixes(transform, rotate(-135deg));
    }
  }
}

p {
  position: absolute;
  bottom: 10px;
  left: calc(50% - 22px);
  margin: 0;
  color: #fff;
  font-size: 30px;
}

.hum {
  position: absolute;
  top: 28px;
  left: 30px;
  width: 40px;
  height: 4px;
  background-color: #fff;
  border-radius: 4px;
  @include prefixes(transition, 0.8s);

  &:before {
    top: 10px;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #fff;
    border-radius: 4px;
    @include prefixes(transition, 0.8s);
  }
  &:after {
    top: 20px;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #fff;
    border-radius: 4px;
    @include prefixes(transition, 0.8s);
  }
}

@media screen and (min-width: 450px) {
  nav {
    @include prefixes(transform, scale(0.5));
  }
}

// base
html, body {
  width: 100%;
  height: 100%;
}

html {
  overflow: hidden;
}

body {
  position: relative;
  margin: 0;
  background-color: $BG;
  font-family: "Cute Font", Roboto, sans-serif;
  overflow: scroll;
  color: $FONT;
}

* {
  &:before,
  &:after {
    position: absolute;
    content: "";
  }
}

              
            
!

JS

              
                // (`・ω・´)
// No images, just CSS.
// Chrome recommended.
// twitter.com/study_dedede
              
            
!
999px

Console