.wrap
  ul.nav 
    - for(var i = 1; i <= 5; i++)
      li.nav__link= i
    .nav__bar
View Compiled
$hover: #0288D1;
.wrap {
  display: grid;
  place-content: center;
  height: 100vh;
  background: #90CAF9;
  .nav {
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
    overflow: hidden;
    padding: 0;
    margin: 0;
    box-shadow: 
      0 5px 5px -5px rgba($hover, 0.15),
      0 10px 10px -5px rgba($hover, 0.15),
      0 15px 15px -5px rgba($hover, 0.15),
      0 20px 20px -5px rgba($hover, 0.15);
    &__link {
      flex: 1;
      padding: 50px;
      list-style: none;
      text-align: center;
      position: relative;
      font-size: 20px;
      font-weight: bold;
      transition: 0.5s ease;
      cursor: pointer;
      user-select: none;
      &:hover {
        color: #0288D1;
        @for $i from 2 through 5 {
          &:nth-of-type(#{$i}) ~ .nav__bar {
            top: $i * 20% - 20%;
          }
        }
      }
    }
    &__bar {
      top: 0;
      left: 0;
      position: absolute;
      background: #0288D1;
      width: 5px;
      height: 20%;
      transition: 0.35s cubic-bezier(0.32, 1.4, 0.13, 1.4);
    }
  }
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.