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

汉堡菜单组件

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

预览

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>

相关组件

汉堡菜单组件

适用于商业/公司网站的极简/扁平化设计响应式汉堡菜单组件,使用柔和的配色方案并支持深色模式。

打开

Cyberpunk_Hamburger_Menu_Photography

一个简单、响应迅速的赛博朋克主题汉堡菜单,用于摄影作品集,具有深色背景、明亮的三重色强调色,营造出霓虹灯美感,并完全支持深色模式。

打开

汉堡菜单组件

一个响应式汉堡菜单组件,采用粗野主义风格设计,采用柔和的配色方案。适用于展示作品或产品的作品集。

打开