This commit is contained in:
Mackie 2026-06-03 14:14:55 +08:00
parent 0c9d4beca2
commit 8ebc0a31cb
2 changed files with 39 additions and 33 deletions

View file

@ -1,29 +1,29 @@
import { getCachedGlobal } from '@/utilities/getGlobals' import { getCachedGlobal } from '@/utilities/getGlobals'
import Link from 'next/link'
import React from 'react' import React from 'react'
import { CMSLink } from '@/components/Link' import { CMSLink } from '@/components/Link'
export async function Footer() { export async function Footer() {
const footerData = await getCachedGlobal('footer', 1)() const footerData = await getCachedGlobal('footer', 1)()
const navItems = footerData?.navItems || [] const navItems = footerData?.navItems || []
return ( return (
<footer className="mt-auto border-t border-foreground/10 relative z-10"> <footer className="mt-auto relative z-10">
<div className="container py-8 flex flex-col items-center gap-4"> <div className="container py-8 flex flex-col sm:flex-row items-center justify-between gap-4">
<p className="text-foreground/30 text-xs">&copy; {new Date().getFullYear()} ByMackie</p>
<nav className="flex flex-wrap justify-center gap-6"> {navItems.length > 0 && (
{navItems.map(({ link }, i) => { <nav className="flex flex-wrap justify-center gap-5">
return <CMSLink className="text-foreground/60 hover:text-foreground transition-colors text-sm" key={i} {...link} /> {navItems.map(({ link }, i) => (
})} <CMSLink
key={i}
{...link}
className="text-foreground/40 hover:text-foreground/70 transition-colors text-xs"
/>
))}
</nav> </nav>
)}
<p className="text-foreground/40 text-sm text-center">
&copy; {new Date().getFullYear()} ByMackie. All rights reserved.
</p>
</div> </div>
</footer> </footer>
) )
} }

View file

@ -19,15 +19,14 @@ function ToggleButton() {
return ( return (
<button <button
onClick={toggle} onClick={toggle}
className="flex items-center gap-2 rounded-full border px-3 py-1.5 text-xs transition-all" aria-label="Toggle theme"
style={{ className="flex items-center justify-center w-8 h-8 rounded-full transition-colors text-foreground/50 hover:text-foreground/80 hover:bg-foreground/8"
border: isDark ? '1px solid rgba(255,255,255,0.2)' : '1px solid rgba(0,0,0,0.15)',
color: isDark ? 'rgba(255,255,255,0.7)' : 'rgba(0,0,0,0.6)',
background: 'transparent',
cursor: 'pointer',
}}
> >
{isDark ? '☀ Light' : '☾ Dark'} {isDark ? (
<i className="ti ti-sun" style={{ fontSize: 16 }} />
) : (
<i className="ti ti-moon" style={{ fontSize: 16 }} />
)}
</button> </button>
) )
} }
@ -48,16 +47,23 @@ export const HeaderClient: React.FC<HeaderClientProps> = ({ data }) => {
}, [headerTheme]) }, [headerTheme])
return ( return (
<header className="container relative z-20" {...(theme ? { 'data-theme': theme } : {})}> <header
<div className="py-8 flex justify-between"> className="fixed top-0 left-0 right-0 z-50 flex justify-center pt-4 pointer-events-none"
<Link href="/"> {...(theme ? { 'data-theme': theme } : {})}
<Logo loading="eager" priority="high" className="invert dark:invert-0" /> >
<div className="pointer-events-auto flex items-center gap-6 px-5 py-2.5 rounded-full border border-foreground/10 bg-background/70 backdrop-blur-md shadow-sm">
<Link href="/" className="shrink-0">
<Logo loading="eager" priority="high" className="invert dark:invert-0 h-6 w-auto" />
</Link> </Link>
<div className="flex items-center gap-3">
<div className="w-px h-4 bg-foreground/10" />
<HeaderNav data={data} /> <HeaderNav data={data} />
<div className="w-px h-4 bg-foreground/10" />
<ToggleButton /> <ToggleButton />
</div> </div>
</div>
</header> </header>
) )
} }