<header class="main-header">
    <div class="container header-menu">
      <div class="header-menu__logo"><a href="#"><img src="img/decoration/logo.png" alt="Логотип"></a></div>
      <div class="header__apadtive-menu-link">
        <span>Menu</span>
      </div>
      <nav class="header-menu__nav" role="navigation">
        <div class="header__adaptive-menu_background">
          <ul class="header-menu__list">
            <li>
              <a class="header-menu__links" href="#">About</a>
            </li>
            <li>
              <a class="header-menu__links" href="#">Contact</a>
            </li>
            <li>
              <a class="header-menu__links" href="#">Catalog</a>
            </li>
            <li>
              <a class="header-menu__links" href="#">Blog</a>
            </li>
          </ul>
        </div>
        <a class="header-menu__login-link" href="#">Sign in</a>
      </nav>
    </div>
  </header>
@keyframes animatetop {
  from {
    top: -600px;
    opacity: 0;
  }

  to {
    top: 0;
    opacity: 1;
  }
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  background-color: #ffffff;
}

.main-header {
  border-bottom: 1px solid rgba(96, 96, 96,0.05);

  li {
    list-style: none;
  }

  .header-menu {
    height: 95px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .header__apadtive-menu-link {
      display: none;
      text-transform: uppercase;
      color: #5F5F5F;
      font-size: 14px;
      line-height: 16px;
    }

    // START ADAPTIVE MENU

    .menu {
      display: none;
    }
    @media only screen and (max-width: 767px) {
      // add bg for adaptive-menu
      .header__adaptive-menu_background {
        display: none;
        /* Hidden by default */
        position: fixed;
        /* Stay in place */
        z-index: 1000;
        /* Sit on top */
        padding-top: 100px;
        /* Location of the box */
        left: 0;
        top: 0;
        width: 100%;
        /* Full width */
        height: 100%;
        /* Full height */
        overflow: auto;
        /* Enable scroll if needed */
        background-color: rgb(0,0,0);
        /* Fallback color */
        background-color: rgba(0,0,0,0.2);
        /* Black w/ opacity */
      }

      .header-menu__nav .header-menu__list {
        display: none;
      }

      .header__apadtive-menu-link {
        display: block;
      }

      .header__menu-adaptive_active {
        position: absolute;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 30%;
        top: 0;
        left: 0;
        margin: 0;
        padding: 0;
        background-color: rgba(60,60,60,0.95);
        animation-name: animatetop;
        animation-duration: 0.2s;
      }

      .header__menu-adaptive_active li {
        padding: 15px;
      }

      .header__menu-adaptive_active .header-menu__links {
        margin: 0;
        color: #FFFFFF;
        font-size: 18px;
      }

      .header__menu-adaptive_active .header-menu__links:hover {
        color: #a18cff;
      }
    }
    // END OF ADAPTIVE MENU
    .header-menu__list,
    .header-menu__nav {
      display: flex;
      align-items: center;
    }

    .header-menu__links {
      text-decoration: none;
      font-size: 14px;
      line-height: 16px;
      text-transform: uppercase;
      margin-right: 40px;
      color: #5F5F5F;
    }

    .header-menu__links:hover {
      color: #3205F3;
    }

    .header-menu__login-link {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 170px;
      height: 55px;
      text-decoration: none;
      border: 1px solid #BDBDBD;
      border-radius: 5px;
      font-size: 15px;
      line-height: 21px;
      color: #3205F3;
    }

    .header-menu__login-link:hover {
      border: 1px solid #3205F3;
      background-color: #F0F0FF;
    }
  }
}
View Compiled
    document.addEventListener("DOMContentLoaded", function() {
        var openMenu = document.querySelector(".header__apadtive-menu-link");
        var links = document.querySelector(".header-menu__list");
        var bgAdaptiveMenu = document.querySelector('.header__adaptive-menu_background');

        openMenu.addEventListener("click", () => {
            links.classList.remove('header-menu__list');
            links.classList.add('header__menu-adaptive_active');
            bgAdaptiveMenu.style.display = 'block';
        });
        window.addEventListener('click', function(event) {
          if (event.target == bgAdaptiveMenu) {
            links.classList.add('header-menu__list');
            links.classList.remove('header__menu-adaptive_active');
            bgAdaptiveMenu.style.display = 'none';
          }
        });
    });

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.