円が拡大してメニューが出現するハンバーガーメニュー(ボタンから円展開)

HTML
<div class="hamburger-wrapper">
  <button class="circle-trigger" id="hamburger-btn">MENU</button>
  <div class="circle-menu" id="menu-overlay">
    <nav class="menu-content">
      <ul>
        <li><a href="#">TOP</a></li>
        <li><a href="#">ABOUT</a></li>
        <li><a href="#">SERVICE</a></li>
        <li><a href="#">CONTACT</a></li>
      </ul>
    </nav>
  </div>
</div>
CSS
.hamburger-wrapper {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
}

/* 丸いトリガーボタン */
.circle-trigger {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #d60000;
  color: #fff;
  font-weight: bold;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  z-index: 20;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.3s ease;
}

.circle-trigger:hover {
  transform: scale(1.1);
}

/* 円が拡大して全画面を覆う */
.circle-menu {
  position: fixed;
  top: 5vh;
  left: 50%;
  transform: translateX(-50%) scale(0);
  width: 500vw;
  height: 100vw;
  background: #111;
  border-radius: 50%;
  z-index: 5;
  transition: transform 0.6s ease;
  pointer-events: none;
  overflow: hidden;
  margin: 100px 0 0;
  padding: 15% 0 0 0;
}

/* 開いた状態 */
.circle-menu.open {
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

/* メニュー内容 */
.menu-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease 0.3s;
}

.circle-menu.open .menu-content {
  opacity: 1;
  pointer-events: auto;
}

/* メニューリスト */
.menu-content ul {
  list-style: none;
  text-align: center;
  padding: 0;
  margin: 0;
}

.menu-content ul li {
  margin: 20px 0;
}

.menu-content ul li a {
  color: #fff;
  text-decoration: none;
  font-size: 2rem;
  font-weight: bold;
  transition: color 0.3s;
}

.menu-content ul li a:hover {
  color: #d60000;
}
JavaScript
const btn = document.getElementById("hamburger-btn");
const menu = document.getElementById("menu-overlay");

btn.addEventListener("click", function () {
  menu.classList.toggle("open");
});

menu.addEventListener("click", function () {
  menu.classList.remove("open");
});

🌟 有料会員限定素材を配布中!

ここでしか手に入らない特別デザイン素材を今すぐチェック!

有料会員ページを見る
目次