feat(homepage+tools): redesign hero with Image_homepage, transparent text buttons navbar, semi-solid transformation, and sticky persistent tools filter
This commit is contained in:
@@ -359,103 +359,103 @@ export function ToolGridSection({
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Elegant Non-Sticky Category Hub & Search (Zero obstruction, no sticky bar under topbar) */}
|
||||
{/* Persistent Sticky Search & Category Hub - Never disappears when scrolling */}
|
||||
{(showCategoryFilter || showSearch) && (
|
||||
<div className="mb-8 sm:mb-12 space-y-4">
|
||||
{/* Search Bar - Center Aligned */}
|
||||
{showSearch && (
|
||||
<div className="max-w-md mx-auto relative px-1">
|
||||
<Search className="w-4 h-4 absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 pointer-events-none" />
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Search AI photo tools..."
|
||||
value={searchQuery}
|
||||
onChange={(e) => setSearchQuery(e.target.value)}
|
||||
className="w-full pl-10 pr-9 py-2.5 rounded-full text-xs sm:text-sm border border-slate-200/90 bg-white text-slate-900 placeholder-slate-400 focus:outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 shadow-sm"
|
||||
/>
|
||||
{searchQuery && (
|
||||
<button
|
||||
onClick={() => setSearchQuery('')}
|
||||
className="absolute right-4 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 cursor-pointer"
|
||||
>
|
||||
<X className="w-3.5 h-3.5" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Category Navigation Dock:
|
||||
- On desktop: Centered floating glass pill capsule dock
|
||||
- On mobile: Smooth edge-padded horizontal touch rail */}
|
||||
{showCategoryFilter && (
|
||||
<div className="flex items-center justify-center">
|
||||
<div className="flex items-center gap-1.5 sm:gap-2 overflow-x-auto no-scrollbar scroll-smooth py-1 px-2 max-w-full touch-pan-x sm:p-1.5 sm:bg-white/80 sm:backdrop-blur-md sm:rounded-full sm:border sm:border-slate-200/90 sm:shadow-sm">
|
||||
{/* All Categories Pill */}
|
||||
<button
|
||||
onClick={() => {
|
||||
setSelectedCategory('all');
|
||||
if (searchQuery) setSearchQuery('');
|
||||
}}
|
||||
className={`shrink-0 flex items-center gap-1.5 sm:gap-2 px-3.5 sm:px-4 py-2 rounded-full text-xs font-bold transition-all duration-200 shadow-sm cursor-pointer ${
|
||||
selectedCategory === 'all' && !searchQuery
|
||||
? 'bg-blue-600 text-white shadow-blue-500/25 ring-2 ring-blue-500/30 scale-[1.02]'
|
||||
: 'bg-white text-slate-700 hover:text-slate-900 hover:bg-slate-50 border border-slate-200/90 sm:border-transparent'
|
||||
}`}
|
||||
>
|
||||
<Layers className="w-3.5 h-3.5" />
|
||||
<span>All Tools</span>
|
||||
<span
|
||||
className={`text-[10px] font-mono px-1.5 py-0.2 rounded-full ${
|
||||
<div className="sticky top-[52px] sm:top-[58px] z-30 -mx-4 sm:-mx-6 lg:-mx-8 px-4 sm:px-6 lg:px-8 py-2.5 sm:py-3 bg-[#FAF8F5]/95 backdrop-blur-md border-b border-slate-200/80 shadow-xs mb-8 sm:mb-12 transition-all">
|
||||
<div className="max-w-7xl mx-auto flex flex-col md:flex-row items-center justify-between gap-2.5 sm:gap-4">
|
||||
{/* Category Navigation Pills */}
|
||||
{showCategoryFilter && (
|
||||
<div className="w-full md:w-auto flex items-center justify-start md:justify-center overflow-x-auto no-scrollbar scroll-smooth py-0.5">
|
||||
<div className="flex items-center gap-1.5 sm:gap-2">
|
||||
{/* All Categories Pill */}
|
||||
<button
|
||||
onClick={() => {
|
||||
setSelectedCategory('all');
|
||||
if (searchQuery) setSearchQuery('');
|
||||
}}
|
||||
className={`shrink-0 flex items-center gap-1.5 sm:gap-2 px-3 sm:px-3.5 py-1.5 sm:py-2 rounded-full text-xs font-bold transition-all duration-200 shadow-sm cursor-pointer ${
|
||||
selectedCategory === 'all' && !searchQuery
|
||||
? 'bg-white/20 text-white'
|
||||
: 'bg-slate-100 text-slate-600'
|
||||
? 'bg-blue-600 text-white shadow-blue-500/25 ring-2 ring-blue-500/30 scale-[1.02]'
|
||||
: 'bg-white text-slate-700 hover:text-slate-900 hover:bg-slate-50 border border-slate-200/90'
|
||||
}`}
|
||||
>
|
||||
{tools.length}
|
||||
</span>
|
||||
</button>
|
||||
|
||||
{/* Category Pills */}
|
||||
{categorizedTools.map((group) => {
|
||||
const isSelected =
|
||||
selectedCategory === group.id && !searchQuery;
|
||||
const catName = group.category
|
||||
? resolveLocalised(group.category.name, locale)
|
||||
: group.id;
|
||||
const theme = CATEGORY_THEMES[group.id];
|
||||
|
||||
return (
|
||||
<button
|
||||
key={group.id}
|
||||
onClick={() => {
|
||||
setSelectedCategory(group.id);
|
||||
if (searchQuery) setSearchQuery('');
|
||||
}}
|
||||
className={`shrink-0 flex items-center gap-1.5 sm:gap-2 px-3 sm:px-3.5 py-2 rounded-full text-xs font-bold transition-all duration-200 shadow-sm cursor-pointer ${
|
||||
isSelected
|
||||
? 'bg-blue-600 text-white shadow-blue-500/25 ring-2 ring-blue-500/30 scale-[1.02]'
|
||||
: 'bg-white text-slate-700 hover:text-slate-900 hover:bg-slate-50 border border-slate-200/90 sm:border-transparent'
|
||||
<Layers className="w-3.5 h-3.5" />
|
||||
<span>All Tools</span>
|
||||
<span
|
||||
className={`text-[10px] font-mono px-1.5 py-0.2 rounded-full ${
|
||||
selectedCategory === 'all' && !searchQuery
|
||||
? 'bg-white/20 text-white'
|
||||
: 'bg-slate-100 text-slate-600'
|
||||
}`}
|
||||
>
|
||||
<span className={isSelected ? 'text-white' : ''}>
|
||||
{theme?.icon || <Wand2 className="w-4 h-4" />}
|
||||
</span>
|
||||
<span>{catName}</span>
|
||||
<span
|
||||
className={`text-[10px] font-mono px-1.5 py-0.2 rounded-full ${
|
||||
{tools.length}
|
||||
</span>
|
||||
</button>
|
||||
|
||||
{/* Category Pills */}
|
||||
{categorizedTools.map((group) => {
|
||||
const isSelected =
|
||||
selectedCategory === group.id && !searchQuery;
|
||||
const catName = group.category
|
||||
? resolveLocalised(group.category.name, locale)
|
||||
: group.id;
|
||||
const theme = CATEGORY_THEMES[group.id];
|
||||
|
||||
return (
|
||||
<button
|
||||
key={group.id}
|
||||
onClick={() => {
|
||||
setSelectedCategory(group.id);
|
||||
if (searchQuery) setSearchQuery('');
|
||||
}}
|
||||
className={`shrink-0 flex items-center gap-1.5 sm:gap-2 px-3 sm:px-3.5 py-1.5 sm:py-2 rounded-full text-xs font-bold transition-all duration-200 shadow-sm cursor-pointer ${
|
||||
isSelected
|
||||
? 'bg-white/20 text-white'
|
||||
: 'bg-slate-100 text-slate-600'
|
||||
? 'bg-blue-600 text-white shadow-blue-500/25 ring-2 ring-blue-500/30 scale-[1.02]'
|
||||
: 'bg-white text-slate-700 hover:text-slate-900 hover:bg-slate-50 border border-slate-200/90'
|
||||
}`}
|
||||
>
|
||||
{group.tools.length}
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
<span className={isSelected ? 'text-white' : ''}>
|
||||
{theme?.icon || <Wand2 className="w-4 h-4" />}
|
||||
</span>
|
||||
<span>{catName}</span>
|
||||
<span
|
||||
className={`text-[10px] font-mono px-1.5 py-0.2 rounded-full ${
|
||||
isSelected
|
||||
? 'bg-white/20 text-white'
|
||||
: 'bg-slate-100 text-slate-600'
|
||||
}`}
|
||||
>
|
||||
{group.tools.length}
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
)}
|
||||
|
||||
{/* Search Bar */}
|
||||
{showSearch && (
|
||||
<div className="w-full md:w-64 lg:w-72 relative shrink-0">
|
||||
<Search className="w-3.5 h-3.5 sm:w-4 sm:h-4 absolute left-3 top-1/2 -translate-y-1/2 text-slate-400 pointer-events-none" />
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Search AI photo tools..."
|
||||
value={searchQuery}
|
||||
onChange={(e) => setSearchQuery(e.target.value)}
|
||||
className="w-full pl-8 sm:pl-9 pr-7 sm:pr-8 py-1.5 sm:py-2 rounded-full text-xs sm:text-sm border border-slate-200/90 bg-white text-slate-900 placeholder-slate-400 focus:outline-none focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 shadow-sm"
|
||||
/>
|
||||
{searchQuery && (
|
||||
<button
|
||||
onClick={() => setSearchQuery('')}
|
||||
className="absolute right-2.5 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 cursor-pointer"
|
||||
>
|
||||
<X className="w-3.5 h-3.5" />
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user