组件 粘滞导航 复古电子商务粘性导航

复古电子商务粘性导航

一个复古/经典的粘性导航组件,适用于电子商务网站,具有鲜艳的颜色、复杂的元素、响应式设计和使用Tailwind CSS的暗模式支持。

预览

HTML 代码

<nav class="bg-gradient-to-r from-purple-600 via-pink-600 to-red-600 text-white sticky top-0 z-50 shadow-lg dark:from-gray-800 dark:via-gray-700 dark:to-gray-600">
  <div class="container mx-auto px-4 py-3 flex items-center justify-between">
    <!-- Logo/Brand -->
    <div class="flex items-center">
      <span class="text-2xl font-bold font-serif italic">RetroFinds</span>
    </div>

    <!-- Navigation Links -->
    <div class="hidden md:flex space-x-6">
      <a href="#" class="hover:text-yellow-300 transition duration-300 ease-in-out font-mono">New Arrivals</a>
      <a href="#" class="hover:text-yellow-300 transition duration-300 ease-in-out font-mono">Shop All</a>
      <a href="#" class="hover:text-yellow-300 transition duration-300 ease-in-out font-mono">Sale</a>
      <a href="#" class="hover:text-yellow-300 transition duration-300 ease-in-out font-mono">Contact</a>
    </div>

    <!-- Search and Icons -->
    <div class="flex items-center space-x-4">
      <div class="relative">
        <input type="text" placeholder="Search..." class="bg-white text-gray-800 rounded-full py-1 px-4 focus:outline-none focus:ring-2 focus:ring-yellow-300 dark:bg-gray-700 dark:text-white">
        <svg class="h-5 w-5 text-gray-400 absolute right-3 top-1/2 transform -translate-y-1/2 dark:text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg>
      </div>
      <a href="#" class="relative">
        <svg class="h-6 w-6 hover:text-yellow-300 transition duration-300 ease-in-out" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"></path></svg>
        <span class="absolute top-0 right-0 inline-flex items-center justify-center px-2 py-1 text-xs font-bold leading-none text-red-100 transform translate-x-1/2 -translate-y-1/2 bg-red-600 rounded-full">3</span>
      </a>
      <a href="#">
        <svg class="h-6 w-6 hover:text-yellow-300 transition duration-300 ease-in-out" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"></path></svg>
      </a>
    </div>

    <!-- Mobile Menu Button -->
    <div class="md:hidden flex items-center">
      <button class="mobile-menu-button">
        <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path></svg>
      </button>
    </div>
  </div>

  <!-- Mobile Menu Content (hidden by default) -->
  <div class="mobile-menu hidden md:hidden bg-purple-500 dark:bg-gray-700">
    <a href="#" class="block py-2 px-4 text-sm hover:bg-purple-600 dark:hover:bg-gray-600 font-mono">New Arrivals</a>
    <a href="#" class="block py-2 px-4 text-sm hover:bg-purple-600 dark:hover:bg-gray-600 font-mono">Shop All</a>
    <a href="#" class="block py-2 px-4 text-sm hover:bg-purple-600 dark:hover:bg-gray-600 font-mono">Sale</a>
    <a href="#" class="block py-2 px-4 text-sm hover:bg-purple-600 dark:hover:bg-gray-600 font-mono">Contact</a>
  </div>
</nav>

相关组件

灰度拟物化粘性导航

用于博客的响应式粘性导航栏,使用灰度调色板以拟物化样式。具有深色模式支持和简单的布局。使用 Tailwind CSS(仅限 HTML)构建,无需 JavaScript。拟物化设计旨在使导航栏看起来像一个物理的、略微凸起的元素。

打开

固定导航组件

一个为暗黑模式设计的粘性导航组件,使用 Tailwind CSS 具有响应式效果。

打开

粘性导航组件

一个具有玻璃态风格的粘性导航组件,具备响应效果并支持暗主题,使用Tailwind CSS。

打开