← 一覧へ

Tab Menu / 08 ネオンブルー|Neon Blue

デザイン見本

  • Tab 1
  • Tab 2
  • Tab 3
Good morning. This is the content of Tab 1.
Hello. This is the content of Tab 2.
Good evening. This is the content of Tab 3.

暗闘に浮かび上がるネオンサインのような、サイバーパンク風デザインです。`text-shadow` と `box-shadow` を重ねがけして強い発光感を表現。常に光が明滅するアニメーションにより、ゲーミングサイトやイベントページで強烈なインパクトを残します。

実装コード

HTML
<div class="tab-container">
  <ul>
    <li class="selected" data-id="tab-1">Tab 1</li>
    <li data-id="tab-2">Tab 2</li>
    <li data-id="tab-3">Tab 3</li>
  </ul>
  <div class="tab-content selected" id="tab-1">
    Tab 1 のコンテンツ
  </div>
  <div class="tab-content" id="tab-2">
    Tab 2 のコンテンツ
  </div>
  <div class="tab-content" id="tab-3">
    Tab 3 のコンテンツ
  </div>
</div>
CSS
.tab-container {
  overflow: hidden;
  border-radius: 12px;
}

.tab-container ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  background: #0a0a0a;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 150, 255, 0.3);
}

.tab-container ul::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
      transparent 0%, 
      rgba(0, 150, 255, 0.1) 50%, 
      transparent 100%);
  animation: neonPulse 3s ease-in-out infinite;
}

@keyframes neonPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

.tab-container ul li {
  flex: 1;
  padding: 16px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s ease;
  position: relative;
  color: #00aaff;
  border-right: 1px solid rgba(0, 150, 255, 0.2);
  text-shadow: 0 0 5px rgba(0, 150, 255, 0.5);
  font-weight: 500;
}

.tab-container ul li:last-child {
  border-right: none;
}

.tab-container ul li.selected {
  color: #fff;
  background: linear-gradient(135deg, #00aaff 0%, #0088cc 100%);
  box-shadow: 
      0 0 20px rgba(0, 150, 255, 0.6),
      inset 0 2px 4px rgba(255, 255, 255, 0.2);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  animation: neonGlow 2s ease-in-out infinite alternate;
}

@keyframes neonGlow {
  from { 
      box-shadow: 
          0 0 20px rgba(0, 150, 255, 0.6),
          inset 0 2px 4px rgba(255, 255, 255, 0.2);
  }
  to { 
      box-shadow: 
          0 0 30px rgba(0, 150, 255, 0.8),
          inset 0 2px 4px rgba(255, 255, 255, 0.3);
  }
}

.tab-container ul li:not(.selected):hover {
  background: rgba(0, 150, 255, 0.1);
  color: #00ccff;
  text-shadow: 0 0 8px rgba(0, 150, 255, 0.7);
  transform: translateY(-1px);
}

.tab-container .tab-content {
  display: none;
  padding: 24px;
  min-height: 150px;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  color: #00aaff;
  border-radius: 0 0 12px 12px;
  box-shadow: 
      0 4px 12px rgba(0, 0, 0, 0.5),
      0 0 20px rgba(0, 150, 255, 0.2);
  border: 1px solid rgba(0, 150, 255, 0.3);
  border-top: none;
  position: relative;
  overflow: hidden;
}

.tab-container .tab-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
      transparent 0%, 
      #00aaff 50%, 
      transparent 100%);
  animation: neonScan 2s linear infinite;
}

@keyframes neonScan {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.tab-container .tab-content.selected {
  display: block;
  animation: neonFadeIn 0.5s ease;
}

@keyframes neonFadeIn {
  from { 
      opacity: 0; 
      transform: translateY(-10px);
      box-shadow: 
          0 4px 12px rgba(0, 0, 0, 0.5),
          0 0 20px rgba(0, 150, 255, 0.1);
  }
  to { 
      opacity: 1; 
      transform: translateY(0);
      box-shadow: 
          0 4px 12px rgba(0, 0, 0, 0.5),
          0 0 20px rgba(0, 150, 255, 0.2);
  }
}
JS
const tabContainer = document.querySelector('.tab-container');
const tabMenuItems = tabContainer.querySelectorAll('ul li');
const tabContents = tabContainer.querySelectorAll('.tab-content');

tabMenuItems.forEach(tabMenuItem => {
  tabMenuItem.addEventListener('click', () => {
    tabMenuItems.forEach(item => {
      item.classList.remove('selected');
    });
    tabMenuItem.classList.add('selected');

    tabContents.forEach(tabContent => {
      tabContent.classList.remove('selected');
    });
    document.getElementById(tabMenuItem.dataset.id).classList.add('selected');
  });
});