组件 汉堡菜单 汉堡菜单组件

汉堡菜单组件

一个为社交媒体界面设计的响应式汉堡菜单,具有暗模式主题和互补色方案。

预览

HTML 代码

<div class="lg:hidden">
    <div class="flex items-center justify-between p-5 bg-gray-900 text-white">
        <div class="text-2xl font-bold">SocialApp</div>
        <button id="menu-toggle" class="focus:outline-none">
            <svg class="w-8 h-8" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
                <path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 6h16M4 12h16m-7 6h7" />
            </svg>
        </button>
    </div>
    <div id="menu" class="absolute top-0 left-0 w-full h-full bg-gray-800 opacity-0 pointer-events-none transition-opacity duration-300 ease-in-out">
        <div class="flex flex-col items-center justify-center h-full space-y-5 text-xl text-white">
            <img src="https://randomuser.me/api/portraits/men/1.jpg" alt="User Avatar" class="w-24 h-24 rounded-full border-2 border-indigo-500">
            <a href="#" class="hover:text-indigo-300 transition duration-300">Home</a>
            <a href="#" class="hover:text-indigo-300 transition duration-300">Profile</a>
            <a href="#" class="hover:text-indigo-300 transition duration-300">Messages</a>
            <a href="#" class="hover:text-indigo-300 transition duration-300">Settings</a>
        </div>
    </div>
</div>

<style>
  #menu-toggle:focus + #menu {
      opacity: 1;
      pointer-events: auto;
  }
</style>

相关组件

拟物化汉堡菜单

一个响应式汉堡菜单组件,采用拟物化元素、鲜艳的色彩和支持暗主题,适用于电子商务网站。

打开

3D汉堡菜单组件

响应式汉堡菜单,采用 3D 设计,融合了三色配色方案和复杂的互动元素,适用于商业/企业网站。

打开

Glassmorphism 汉堡菜单

一个简单、响应式的汉堡菜单组件,具有 Glassmorphism 设计、互补配色方案和深色模式支持。

打开