interactions · overlay · menu

Overlay de navigation

Menu plein écran avec grands liens centrés et réseaux sociaux, ouvert/fermé en CSS pur (checkbox hack).

Voir le code source
<style>
.bn-overlay-demo {
  position: relative;
  min-height: 320px;

  padding: 2rem;
  font-family: 'Inter', sans-serif;
  background: #0B0F10;
}

.bn-overlay__checkbox {
  display: none;
}

.bn-overlay__trigger {
  color: #E6E4DD;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.bn-overlay {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;

  background: #050808;

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}

.bn-overlay__checkbox:checked ~ .bn-overlay {
  opacity: 1;
  visibility: visible;
}

.bn-overlay__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: #E6E4DD;
  cursor: pointer;
  font-size: 1.2rem;
}

.bn-overlay__nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.bn-overlay__nav a {
  color: #C7C1B7;
  text-decoration: none;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.03em;
}

.bn-overlay__nav a:hover {
  color: #E6E4DD;
}

.bn-overlay__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.bn-overlay__footer > span {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5C6160;
}

.bn-overlay__social {
  display: flex;
  gap: 1rem;
}

.bn-overlay__social a {
  color: #979793;
  text-decoration: none;
  font-size: 0.75rem;
}

.bn-overlay__social a:hover {
  color: #E6E4DD;
}

</style>

<div class="bn-overlay-demo" data-fx-root>
  <input type="checkbox" id="bn-overlay-toggle" class="bn-overlay__checkbox" />

  <label for="bn-overlay-toggle" class="bn-overlay__trigger">☰ Menu</label>

  <div class="bn-overlay">
    <label for="bn-overlay-toggle" class="bn-overlay__close" aria-label="Fermer">✕</label>

    <nav class="bn-overlay__nav">
      <a href="#">À propos</a>
      <a href="#">Projets</a>
      <a href="#">Réflexions</a>
      <a href="#">Collection</a>
      <a href="#">Contact</a>
    </nav>

    <div class="bn-overlay__footer">
      <span>Suivez l'exploration</span>
      <div class="bn-overlay__social">
        <a href="#" aria-label="Instagram">IG</a>
        <a href="#" aria-label="X">X</a>
        <a href="#" aria-label="Behance">Bé</a>
      </div>
    </div>
  </div>
</div>