FlixBotDev
Login
← Retour galerie

Navbars · html-css · intermediate

Island Float

Navbar flottante type “île”, sticky au scroll

Ouvrir Studio

Aperçu live

Code

:root {
      --ink: #040506;
      --acid: #b8ff2e;
      --glass: rgba(18, 20, 26, 0.85);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      min-height: 140vh;
      background:
        linear-gradient(180deg, #0a0c10 0%, var(--ink) 40%),
        var(--ink);
      font-family: "Segoe UI", system-ui, sans-serif;
      color: #fff;
    }

    .bg-grid {
      position: fixed;
      inset: 0;
      background-image:
        linear-gradient(rgba(184, 255, 46, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(184, 255, 46, 0.04) 1px, transparent 1px);
      background-size: 48px 48px;
      mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
      pointer-events: none;
    }

    .island {
      position: fixed;
      left: 50%;
      top: 1.25rem;
      transform: translateX(-50%);
      z-index: 100;
      display: flex;
      align-items: center;
      gap: 0.35rem;
      padding: 0.4rem;
      border-radius: 20px;
      background: var(--glass);
      border: 1px solid rgba(255, 255, 255, 0.1);
      backdrop-filter: blur(20px);
      box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(184, 255, 46, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
      animation: floatIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
      transition: width 0.4s ease, padding 0.3s ease;
    }

    .island.scrolled {
      top: 0.75rem;
      box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.65),
        0 0 40px rgba(184, 255, 46, 0.08);
    }

    @keyframes floatIn {
      from { opacity: 0; transform: translateX(-50%) translateY(-24px) scale(0.96); }
      to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
    }

    .island a {
      text-decoration: none;
      color: rgba(255, 255, 255, 0.7);
      font-size: 0.85rem;
      font-weight: 650;
      padding: 0.65rem 1rem;
      border-radius: 14px;
      transition: background 0.2s ease, color 0.2s ease;
      white-space: nowrap;
    }

    .island a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

    .island .logo {
      display: grid;
      place-items: center;
      width: 40px;
      height: 40px;
      border-radius: 12px;
      background: linear-gradient(145deg, var(--acid), #5aa80a);
      color: #06100a;
      font-weight: 900;
      font-size: 0.85rem;
      margin-right: 0.15rem;
      box-shadow: 0 0 24px rgba(184, 255, 46, 0.4);
    }

    .island .go {
      margin-left: 0.25rem;
      background: var(--acid) !important;
      color: #06100a !important;
      font-weight: 800;
      box-shadow: 0 0 24px rgba(184, 255, 46, 0.3);
    }

    .island .go:hover {
      filter: brightness(1.08);
    }

    .content {
      max-width: 720px;
      margin: 0 auto;
      padding: 8rem 1.5rem 4rem;
      text-align: center;
    }

    .content h1 {
      font-size: clamp(2.2rem, 6vw, 3.8rem);
      font-weight: 900;
      letter-spacing: -0.045em;
      line-height: 1.05;
      margin-bottom: 1rem;
    }

    .content h1 span {
      background: linear-gradient(90deg, #fff, var(--acid));
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }

    .content p {
      color: rgba(255, 255, 255, 0.5);
      line-height: 1.7;
      font-size: 1.05rem;
    }

    .blocks {
      display: grid;
      gap: 1rem;
      margin-top: 3rem;
    }

    .blocks div {
      height: 120px;
      border-radius: 20px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid rgba(255, 255, 255, 0.06);
    }

Envie de tweak les tokens ? Code Studio