refactor(navbar): redesign tools dropdown menu into sleek, minimal professional navigation
This commit is contained in:
@@ -14,7 +14,8 @@ import {
|
||||
Smile,
|
||||
Scissors,
|
||||
Palette,
|
||||
ChevronDown
|
||||
ChevronDown,
|
||||
ChevronRight
|
||||
} from 'lucide-react';
|
||||
import { SiteConfig } from '@/types';
|
||||
import { BrandLogo } from './BrandLogo';
|
||||
@@ -28,42 +29,30 @@ interface NavbarProps {
|
||||
const TOOL_CATEGORIES = [
|
||||
{
|
||||
id: 'portrait-retouch',
|
||||
name: 'Portrait Retouch',
|
||||
tagline: 'Sub-pore blemish, teeth whitening & eye brightness',
|
||||
count: '5 tools',
|
||||
name: 'Portrait & Retouch',
|
||||
tagline: 'Blemish, teeth whitening & face swap',
|
||||
icon: Smile,
|
||||
color: 'text-rose-500',
|
||||
bg: 'bg-rose-500/10 text-rose-600 border-rose-500/20',
|
||||
href: '/tools#category-portrait-retouch',
|
||||
},
|
||||
{
|
||||
id: 'restoration',
|
||||
name: 'Archival Restoration',
|
||||
tagline: '4K super-resolution, vintage repair & colorization',
|
||||
count: '3 tools',
|
||||
name: 'Enhance & Restore',
|
||||
tagline: 'Deblur, 4K resolution & colorize',
|
||||
icon: Sparkles,
|
||||
color: 'text-indigo-500',
|
||||
bg: 'bg-indigo-500/10 text-indigo-600 border-indigo-500/20',
|
||||
href: '/tools#category-restoration',
|
||||
},
|
||||
{
|
||||
id: 'background-cutout',
|
||||
name: 'Background Cutout',
|
||||
tagline: 'P3M deep learning alpha matting & hair extraction',
|
||||
count: '1 tool',
|
||||
name: 'Cutout & Inpaint',
|
||||
tagline: 'Object eraser & background remover',
|
||||
icon: Scissors,
|
||||
color: 'text-emerald-500',
|
||||
bg: 'bg-emerald-500/10 text-emerald-600 border-emerald-500/20',
|
||||
href: '/tools#category-background-cutout',
|
||||
},
|
||||
{
|
||||
id: 'creative-art',
|
||||
name: 'Creative Art & Avatars',
|
||||
tagline: 'Anime key-art synthesis, Polaroids & object eraser',
|
||||
count: '3 tools',
|
||||
name: 'Creative & Diffusion',
|
||||
tagline: 'Anime avatar, dress & text-to-image',
|
||||
icon: Palette,
|
||||
color: 'text-amber-500',
|
||||
bg: 'bg-amber-500/10 text-amber-600 border-amber-500/20',
|
||||
href: '/tools#category-creative-art',
|
||||
},
|
||||
];
|
||||
@@ -179,27 +168,14 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
}`} />
|
||||
</Link>
|
||||
|
||||
{/* Tools Categories Dropdown Mega-Card on Hover */}
|
||||
{/* Tools Dropdown Menu - Sleek, Professional & Minimal */}
|
||||
{toolsDropdownOpen && (
|
||||
<div
|
||||
className="absolute top-full left-1/2 -translate-x-1/2 pt-2.5 w-[560px] z-50 animate-in fade-in zoom-in-95 duration-150"
|
||||
className="absolute top-full left-1/2 -translate-x-1/2 pt-2.5 w-[320px] z-50 animate-in fade-in zoom-in-95 duration-150"
|
||||
>
|
||||
<div className="studio-sheet p-4 sm:p-5 rounded-3xl bg-paper-hi border border-rule shadow-sheet space-y-3.5">
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between pb-2.5 border-b border-rule">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="w-2 h-2 rounded-full bg-accent animate-pulse" />
|
||||
<span className="text-xs font-semibold text-ink font-body">
|
||||
Studio Neural Categories
|
||||
</span>
|
||||
</div>
|
||||
<span className="text-[11px] font-semibold text-accent bg-accent/10 px-2.5 py-0.5 rounded-full border border-accent/20">
|
||||
12 models active
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* 2x2 Category Cards Grid */}
|
||||
<div className="grid grid-cols-2 gap-2.5">
|
||||
<div className="p-2 rounded-2xl bg-paper-hi border border-rule shadow-xl space-y-1">
|
||||
{/* Categories List */}
|
||||
<div className="space-y-0.5">
|
||||
{TOOL_CATEGORIES.map((cat) => {
|
||||
const Icon = cat.icon;
|
||||
return (
|
||||
@@ -212,21 +188,19 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
window.location.hash = `category-${cat.id}`;
|
||||
}
|
||||
}}
|
||||
className="group/cat p-3 rounded-2xl bg-paper border border-rule hover:border-accent hover:bg-paper-2 hover:shadow-glow motion-safe:transition-all duration-150 flex items-start gap-3"
|
||||
className="group/item flex items-center gap-3 p-2.5 rounded-xl hover:bg-paper-2 transition-all duration-150"
|
||||
>
|
||||
<div className={`w-8 h-8 rounded-xl flex items-center justify-center shrink-0 border ${cat.bg}`}>
|
||||
<Icon className="w-4 h-4" />
|
||||
<div className="w-8 h-8 rounded-lg bg-paper-2 border border-rule group-hover/item:border-accent/40 group-hover/item:bg-accent/10 flex items-center justify-center shrink-0 transition-colors">
|
||||
<Icon className="w-4 h-4 text-ink group-hover/item:text-accent transition-colors" />
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex items-center justify-between gap-1">
|
||||
<span className="font-semibold text-xs text-ink group-hover/cat:text-accent transition-colors truncate">
|
||||
<div className="flex items-center justify-between">
|
||||
<span className="font-display font-semibold text-xs text-ink group-hover/item:text-accent transition-colors">
|
||||
{cat.name}
|
||||
</span>
|
||||
<span className="text-[10px] text-muted font-body shrink-0">
|
||||
{cat.count}
|
||||
</span>
|
||||
<ChevronRight className="w-3.5 h-3.5 text-muted opacity-0 -translate-x-1 group-hover/item:opacity-100 group-hover/item:translate-x-0 transition-all" />
|
||||
</div>
|
||||
<p className="text-[11px] text-muted line-clamp-1 mt-0.5 font-body">
|
||||
<p className="text-[11px] text-muted truncate font-body">
|
||||
{cat.tagline}
|
||||
</p>
|
||||
</div>
|
||||
@@ -235,18 +209,15 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Footer Link */}
|
||||
<div className="pt-2 border-t border-rule flex items-center justify-between text-xs font-body">
|
||||
<span className="text-[11px] text-muted">
|
||||
Instant client GPU trial · Zero retention
|
||||
</span>
|
||||
{/* Clean Minimal Footer */}
|
||||
<div className="pt-1.5 mt-1 border-t border-rule/70 px-2.5 py-1">
|
||||
<Link
|
||||
href="/tools"
|
||||
onClick={() => setToolsDropdownOpen(false)}
|
||||
className="text-accent hover:underline font-semibold inline-flex items-center gap-1 text-xs"
|
||||
className="text-xs font-semibold text-accent hover:text-accent-hi inline-flex items-center justify-between w-full transition-colors py-1"
|
||||
>
|
||||
<span>View all 12 tools directory</span>
|
||||
<ArrowRight className="w-3 h-3 text-accent" />
|
||||
<span>Explore all 14 studio tools</span>
|
||||
<ArrowRight className="w-3.5 h-3.5" />
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
@@ -354,10 +325,10 @@ export function Navbar({ config, currentLocale }: NavbarProps) {
|
||||
window.location.hash = `category-${cat.id}`;
|
||||
}
|
||||
}}
|
||||
className="flex items-center gap-2 p-2 rounded-xl text-xs text-ink-2 hover:text-ink hover:bg-paper-2 bg-paper-hi/40 border border-rule/50 font-body"
|
||||
className="flex items-center gap-2 p-2 rounded-xl text-xs text-ink hover:text-accent hover:bg-paper-2 bg-paper-hi/60 border border-rule font-body transition-colors"
|
||||
>
|
||||
<Icon className={`w-3.5 h-3.5 ${cat.color} shrink-0`} />
|
||||
<span className="truncate">{cat.name}</span>
|
||||
<Icon className="w-3.5 h-3.5 text-accent shrink-0" />
|
||||
<span className="truncate font-medium">{cat.name}</span>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user