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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <!--Menu-->
<div class="menu">
  <!--Trigger-->
  <div class="menu__trigger js-menu-trigger"><span>MENU</span></div>
  <!--/Trigger-->

  <!--Logo-->
  <div class="menu__logo">
    <svg viewBox="0 0 500 500">
            <defs>
                <linearGradient id="main-gradient" x1="0%" y1="0%" x2="100%" y2="0%">
                    <stop offset="0%" style="stop-color:#EE43BD;stop-opacity:1"/>
                    <stop offset="100%" style="stop-color:#FFD779;stop-opacity:1"/>
                </linearGradient>
            </defs>
            <path class="js-logo-shape" fill="url(#main-gradient)"
                  d="M 378.1,121.2 C 408.4,150 417.2,197.9 411,245.8 404.8,293.7 383.5,341.7 353.4,370.7 303.2,419.1 198.7,427.7 144.5,383.8 86.18,336.5 67.13,221.3 111.9,161 138.6,125 188.9,99.62 240.7,90.92 292.4,82.24 345.6,90.32 378.1,121.2 Z"></path>
        </svg>
    <h1>MICRO FRONT</h1>
  </div>
  <!--Logo-->

  <!--Inner-->
  <div class="menu__inner js-menu-inner">
    <!--Inner background-->
    <ul class="menu__inner-background js-menu-inner-background">
      <li><i></i></li>
      <li><i></i></li>
      <li><i></i></li>
      <li><i></i></li>
      <li><i></i></li>
    </ul>
    <!--/Inner background-->

    <div class="menu__items-wrapper js-menu-items-wrapper">
      <ul class="menu__items-list js-menu-items-list">
        <li class="js-menu-item is-active" data-morph="M 418.1,159.8 C 460.9,222.9 497,321.5 452.4,383.4 417.2,432.4 371.2,405.6 271.3,420.3 137.2,440 90.45,500.6 42.16,442.8 -9.572,381 86.33,289.1 117.7,215.5 144.3,153.4 145.7,54.21 212.7,36.25 290.3,15.36 373.9,94.6 418.1,159.8 Z">
          <a href="#">Home</a>
        </li>
        <li class="js-menu-item" data-morph="M 402.7,215.5 C 433.9,280.4 488.1,367.2 447.7,426.8 410.1,482.2 316.7,460.2 249.7,460.6 182.8,461.1 88.08,485.5 51.26,429.5 10.29,367.3 73.19,279.4 106.9,213 141.8,144 176.6,33.65 253.9,33.7 332.2,33.75 368.8,144.9 402.7,215.5 Z">
          <a href="#">About</a>
        </li>
        <li class="js-menu-item" data-morph="M 451.5,185.8 C 441.5,266.2 339.6,305 272.3,350.2 207.7,393.6 226.7,444.7 182.6,447.9 132.8,451.4 83.97,399.9 66.37,353.1 34.6,268.4 41.16,141.8 112,85.44 186.1,26.329999999999984 313.8,54.099999999999994 396,101.4 425.2,118.2 455.6,152.4 451.5,185.8 Z">
          <a href="#">Hover Me</a>
        </li>
        <li class="js-menu-item" data-morph="M 378.1,121.2 C 408.4,150 417.2,197.9 411,245.8 404.8,293.7 383.5,341.7 353.4,370.7 303.2,419.1 198.7,427.7 144.5,383.8 86.18,336.5 67.13,221.3 111.9,161 138.6,125 188.9,99.62 240.7,90.92 292.4,82.24 345.6,90.32 378.1,121.2 Z">
          <a href="#">Contact</a>
        </li>
      </ul>
      <div class="menu__items-shape js-menu-items-shape">
        <svg id="circle" viewBox="0 0 500 500">
                    <path id="object" class="js-items-shape-path" fill="url(#main-gradient)"
                          d="M 418.1,159.8 C 460.9,222.9 497,321.5 452.4,383.4 417.2,432.4 371.2,405.6 271.3,420.3 137.2,440 90.45,500.6 42.16,442.8 -9.572,381 86.33,289.1 117.7,215.5 144.3,153.4 145.7,54.21 212.7,36.25 290.3,15.36 373.9,94.6 418.1,159.8 Z"></path>
                </svg>
      </div>

    </div>

    <!--Trigger-->
    <div class="menu__trigger menu__trigger--close js-menu-close"><span>Close</span></div>
    <!--/Trigger-->
  </div>
  <!--/Inner-->

</div>
<!--/Menu-->
              
            
!

CSS

              
                body {
  font-family: "Montserrat", sans-serif;
  height: 100vh;
  background-image: linear-gradient(135deg, #8f24ed 30%, #107cb3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  @media only screen and (max-width: 600px) {
    display: block;
  }
}
* {
  outline: none;
  -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
}

*,
:after,
:before {
  box-sizing: border-box;
}

.menu {
  width: 320px;
  height: 568px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 0 0px 12px rgba(0, 0, 0, 0.1), 0 0 1px 1px rgba(0, 0, 0, 0.1),
    inset 0 0 0 12px rgba(255, 255, 255, 1);
  overflow: hidden;
  position: relative;
  background-color: #eaecef;
  margin: 30px auto;
  &__trigger {
    position: absolute;
    top: 24px;
    right: 26px;
    cursor: pointer;
    &:after {
      position: absolute;
      content: "";
      width: 100%;
      height: 12px;
      left: 0;
      transform: translateX(-7px);
      top: 8px;
      background-image: linear-gradient(0deg, #ee43bd 0%, #ffd779 100%);
      transition: all 0.2s ease;
      will-change: transform;
    }
    span {
      position: relative;
      z-index: 1;
      font-weight: 900;
      letter-spacing: -1px;
      text-transform: uppercase;
      font-size: 16px;
    }
    &:hover {
      &:after {
        transform: translateX(0);
      }
    }

    &--close {
      visibility: hidden;
      opacity: 0;
    }
  }
  &__logo {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    padding: 5px;
    transform: translateY(-50%);
    cursor: pointer;
    svg {
      width: 185px;
      margin: 0 auto;
      display: block;
    }
    h1 {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-weight: 900;
      font-size: 36px;
      text-align: center;
      letter-spacing: -1.5px;
      line-height: 28px;
    }
  }
  &__inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    z-index: 1;
    border-radius: 10px;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
  }
  &__inner-background {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    list-style-type: none;
    padding: 0;
    margin: 0;
    font-size: 0;

    li {
      position: relative;
      display: inline-block;
      height: 100%;
      overflow: hidden;
      &:first-child {
        width: 21px;
      }
      &:nth-child(2) {
        width: calc(33.33% - 14px);
      }
      &:nth-child(3) {
        width: calc(33.33% - 14px);
      }
      &:nth-child(4) {
        width: calc(33.33% - 14px);
      }
      &:last-child {
        width: 21px;
      }
      i {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: #fff;
        opacity: 0;
        visibility: hidden;
        &:after {
          content: "";
          display: block;
          height: 100%;
          width: 1px;
          background: #edeff5;
          z-index: 2;
        }
      }
    }
  }
  &__items-wrapper {
    position: relative;
    padding-left: 22px;
  }
  &__items-list {
    position: relative;
    z-index: 1;
    li {
      margin-bottom: 8px;
      a {
        color: #282828;
        text-decoration: none;
        font-size: 50px;
        line-height: 50px;
        text-transform: uppercase;
        display: block;
        letter-spacing: -1.2px;
        font-weight: 900;
      }
    }
  }
  &__items-shape {
    position: absolute;
    left: -32px;
    top: -60px;
    svg {
      position: relative;
      display: block;
      width: 140px;
      height: 140px;
      min-height: 150px;
      margin: 0 auto;
    }
  }
}

              
            
!

JS

              
                function menu() {
  var menuInner = $(".js-menu-inner"),
    menuTrigger = $(".js-menu-trigger"),
    menuInnerBackgroundItem = $(".js-menu-inner-background").find("i"),
    menuItem = $(".js-menu-items-list").find("li"),
    menuItemsShape = $(".js-menu-items-shape"),
    menuClose = $(".js-menu-close"),
    timeline = new TimelineMax({
      paused: true
    }),
    logoShape = $(".js-logo-shape"),
    logoShapePath =
      "M 189,80.37 C 243,66.12 307.3,87.28 350.9,124.1 389.3,156.6 417,211.2 418.1,263.4 419.1,305.7 401.8,355.6 368.5,379.1 298.8,428 179.2,446.4 117.6,386.3 65.4,335.3 78.55,230.3 105.5,160.5 119.7,123.6 152.6,89.85 189,80.37 Z",
    _self,
    linksWrapper = $(".js-menu-items-wrapper"),
    linksItems = $(".js-menu-items-list").find("li"),
    activeItem = $(".js-menu-item.is-active"),
    activeItemPosition = activeItem.position().top,
    menuItemsShapePath = $(".js-items-shape-path"),
    topOffset = 8;

  timeline
    .to(
      menuInner,
      1,
      {
        autoAlpha: 1,
        ease: Power4.easeOut
      },
      "start"
    )
    .fromTo(
      menuInnerBackgroundItem,
      0.25,
      {
        x: "-100%",
        autoAlpha: 0
      },
      {
        x: "0%",
        autoAlpha: 1,
        ease: Power1.easeOut
      },
      "start"
    )
    .staggerFromTo(
      menuItem,
      0.4,
      {
        x: -30,
        autoAlpha: 0
      },
      {
        x: 0,
        autoAlpha: 1,
        delay: 0.35,
        ease: Back.easeOut.config(1)
      },
      0.15,
      "start"
    )
    .fromTo(
      menuItemsShape,
      0.25,
      {
        scale: 0.7,
        autoAlpha: 0
      },
      {
        scale: 1,
        autoAlpha: 1,
        delay: 0.95,
        ease: Back.easeOut.config(1.7)
      },
      "start"
    )
    .fromTo(
      menuClose,
      0.2,
      {
        x: -10,
        autoAlpha: 0
      },
      {
        x: 0,
        autoAlpha: 1,
        delay: 1,
        ease: Power1.easeOut
      },
      "start"
    );

  function _logoShapeAnimation() {
    TweenMax.to(logoShape, 3, {
      attr: { d: logoShapePath },
      repeat: -1,
      yoyo: true,
      ease: Power0.easeNone
    });
  }

  function _hoverAnimation() {
    TweenMax.set(menuItemsShape, {
      y: activeItemPosition + topOffset
    });

    linksItems.on({
      mouseenter: function() {
        _self = $(this);
        var selfParent = _self.closest(linksWrapper),
          targetCircle = selfParent.find(menuItemsShape),
          circlePosition = _self.position().top;

        TweenMax.to(targetCircle, 0.4, {
          y: circlePosition + topOffset,
          ease: Power2.easeOut
        });

        TweenMax.to(menuItemsShapePath, 1, { morphSVG: this.dataset.morph });
      }
    });

    linksWrapper.on({
      mouseleave: function() {
        _self = $(this);
        var selfParent = _self.closest(linksWrapper),
          activeLink = selfParent.find(activeItem),
          targetCircle = selfParent.find(menuItemsShape),
          activeLinkPosition = activeLink.position().top;

        TweenMax.to(targetCircle, 0.4, {
          y: activeLinkPosition + topOffset,
          ease: Power2.easeOut
        });

        TweenMax.to(menuItemsShapePath, 1, { morphSVG: menuItemsShapePath });
      }
    });
  }

  menuTrigger.on("click", function() {
    timeline.play();
  });

  menuClose.on("click", function() {
    timeline.timeScale(1.25);
    timeline.reverse();
  });

  _logoShapeAnimation();
  _hoverAnimation();
}

menu();

              
            
!
999px

Console