修改移动端菜单栏侧边栏布局

This commit is contained in:
Eamon-meng
2026-03-14 15:25:23 +08:00
parent b2c36196b4
commit 83530d7f1e
2 changed files with 298 additions and 20 deletions

View File

@@ -164,10 +164,10 @@ export default function Header(props: HeaderProps) {
</Wrap>
</div>
{/* 下拉菜单 */}
{/* 桌面端下拉菜单 */}
<div
className={merge(
`flex-auto overflow-auto lg:flex-none lg:basis-72 shadow-lg box-content`,
`hidden lg:flex flex-auto overflow-auto lg:flex-none lg:basis-72 shadow-lg box-content`,
`bg-[#fffe] backdrop-blur-sm`,
`transition-[opacity,padding] transition-discrete duration-200 ease-in-out`,
menu
@@ -180,7 +180,20 @@ export default function Header(props: HeaderProps) {
{pages[page]}
</div>
{/* 遮罩层 */}
{/* 移动端侧边栏菜单 */}
{menu && page === 3 && (
<div className="lg:hidden fixed inset-0 z-20 flex">
<div
className="flex-1 bg-black/40"
onPointerDown={enterMenuMask}
/>
<div className="w-72 max-w-[80vw] bg-white shadow-xl overflow-y-auto">
{pages[3]}
</div>
</div>
)}
{/* 遮罩层(桌面端) */}
<div className="flex-auto" onPointerEnter={enterMenuMask}/>
</HeaderContext.Provider>