feat(tools): enhance tools page layout with 4-column grid, high-contrast sidebar, and category pagination

This commit is contained in:
2026-11-11 12:26:25 +05:30
parent 63a2c02b60
commit ba77f5279f
+114 -103
View File
@@ -279,7 +279,7 @@ function ToolCardImage({ tool, toolName }: { tool: ToolItem; toolName: string })
// 1. VIDEO TOOL (Background Remover)
if (media.type === 'video') {
return (
<div className="relative w-full aspect-[4/3] rounded-2xl overflow-hidden bg-paper-2 select-none group/img isolate shadow-inner">
<div className="relative w-full aspect-[4/3] rounded-xl overflow-hidden bg-paper-2 select-none group/img isolate shadow-inner">
<video
ref={videoRef}
src={media.videoUrl}
@@ -297,7 +297,7 @@ function ToolCardImage({ tool, toolName }: { tool: ToolItem; toolName: string })
// 2. SINGLE IMAGE (Polaroid, etc.)
if (media.type === 'single') {
return (
<div className="relative w-full aspect-[4/3] rounded-2xl overflow-hidden bg-paper-2 select-none group/img shadow-inner">
<div className="relative w-full aspect-[4/3] rounded-xl overflow-hidden bg-paper-2 select-none group/img shadow-inner">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
src={media.image}
@@ -317,7 +317,7 @@ function ToolCardImage({ tool, toolName }: { tool: ToolItem; toolName: string })
onPointerDown={handleContainerPointerDown}
onPointerMove={handleContainerPointerMove}
onPointerLeave={handleContainerPointerLeave}
className="relative w-full aspect-[4/3] rounded-2xl overflow-hidden bg-paper-2 select-none cursor-ew-resize group/img shadow-inner touch-pan-y"
className="relative w-full aspect-[4/3] rounded-xl overflow-hidden bg-paper-2 select-none cursor-ew-resize group/img shadow-inner touch-pan-y"
style={{ touchAction: 'pan-y' }}
>
{/* Enhanced / After Image (Underneath) */}
@@ -364,11 +364,11 @@ function ToolCardImage({ tool, toolName }: { tool: ToolItem; toolName: string })
aria-valuenow={Math.round(splitPos)}
tabIndex={0}
style={{ touchAction: 'none' }}
className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-8 h-8 rounded-full bg-paper-hi text-ink shadow-md flex items-center justify-center border border-rule pointer-events-auto cursor-ew-resize touch-none before:absolute before:-inset-3 before:content-['']"
className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-7 h-7 rounded-full bg-paper-hi text-ink shadow-md flex items-center justify-center border border-rule pointer-events-auto cursor-ew-resize touch-none before:absolute before:-inset-3 before:content-['']"
>
<div className="flex items-center gap-[2px] pointer-events-none">
<div className="w-0 h-0 border-y-[3.5px] border-y-transparent border-r-[4.5px] border-r-ink" />
<div className="w-0 h-0 border-y-[3.5px] border-y-transparent border-l-[4.5px] border-l-ink" />
<div className="w-0 h-0 border-y-[3px] border-y-transparent border-r-[4px] border-r-ink" />
<div className="w-0 h-0 border-y-[3px] border-y-transparent border-l-[4px] border-l-ink" />
</div>
</div>
</div>
@@ -389,57 +389,39 @@ function ToolCard({
const toolName = resolveLocalised(tool.name, locale);
const toolSummary = resolveLocalised(tool.summary, locale);
const archetypeBadge =
tool.pageType === 'masking'
? 'Smart Masking'
: tool.pageType === 'image-thumbnail'
? 'Style Presets'
: tool.pageType === 'text-to-image'
? 'Text-to-Image'
: tool.pageType === 'two-images'
? 'Dual Fusion'
: 'Single-Click';
return (
<div className="group studio-sheet p-4 sm:p-5 rounded-3xl bg-paper-hi border border-rule shadow-[0_4px_24px_-4px_rgba(0,0,0,0.03)] hover:border-accent hover:shadow-glow motion-safe:transition-[border-color,box-shadow,transform] duration-300 hover:-translate-y-1 flex flex-col justify-between h-full">
<div className="group studio-sheet p-3.5 sm:p-4 rounded-2xl bg-paper-hi border border-rule shadow-[0_4px_20px_-4px_rgba(0,0,0,0.03)] hover:border-accent hover:shadow-glow motion-safe:transition-[border-color,box-shadow,transform] duration-300 hover:-translate-y-1 flex flex-col justify-between h-full">
{/* Image Dominant Preview Frame */}
<ToolCardImage tool={tool} toolName={toolName} />
{/* Info Area: Title, Subtitle, and Direct Action Button */}
<div className="mt-4 flex-1 flex flex-col justify-between space-y-3.5">
<div className="mt-3 flex-1 flex flex-col justify-between space-y-2.5">
<div>
{/* Badge & Tool Title */}
<div className="flex items-center justify-between gap-2 mb-1.5">
<span className="px-2.5 py-0.5 rounded-full bg-accent/10 border border-accent/20 text-[10px] font-semibold text-accent font-body uppercase tracking-wider">
{archetypeBadge}
</span>
<span className="text-[11px] text-muted font-body">Free browser trial</span>
</div>
{/* Tool Title */}
<Link href={`/tools/${tool.slug}`} className="block">
<h4 className="text-base sm:text-lg font-display font-bold text-ink tracking-tight leading-snug group-hover:text-accent transition-colors">
<h4 className="text-sm sm:text-base font-display font-bold text-ink tracking-tight leading-snug group-hover:text-accent transition-colors line-clamp-1">
<AnimatedShinyText>{toolName}</AnimatedShinyText>
</h4>
</Link>
{/* Tool Description */}
<p className="mt-1.5 text-xs text-ink-2 font-body line-clamp-2 leading-relaxed">
<p className="mt-1 text-xs text-ink-2 font-sans line-clamp-2 leading-relaxed">
{toolSummary}
</p>
</div>
{/* Action Button Row: Highly Visible Prominent Primary Button */}
<div className="pt-3 border-t border-rule">
<div className="pt-2.5 border-t border-rule">
<Link
href={`/tools/${tool.slug}`}
className="w-full inline-flex items-center justify-between px-5 py-3 rounded-2xl bg-ink hover:bg-accent text-paper-hi font-display font-bold text-xs sm:text-sm transition-all duration-200 shadow-xs hover:shadow-md group/btn active:scale-98"
className="w-full inline-flex items-center justify-between px-3.5 py-2.5 rounded-xl bg-ink hover:bg-accent text-paper-hi font-display font-bold text-xs transition-all duration-200 shadow-xs hover:shadow-md group/btn active:scale-98"
aria-label={`Open interactive studio for ${toolName}`}
>
<span className="flex items-center gap-2">
<Sparkles className="w-4 h-4 text-accent group-hover/btn:text-white transition-colors" />
<span>Launch Tool Studio</span>
<span className="flex items-center gap-1.5">
<Sparkles className="w-3.5 h-3.5 text-accent group-hover/btn:text-white transition-colors" />
<span>Launch Studio</span>
</span>
<ArrowRight className="w-4 h-4 text-paper-hi group-hover/btn:translate-x-1 transition-transform" aria-hidden="true" />
<ArrowRight className="w-3.5 h-3.5 text-paper-hi group-hover/btn:translate-x-0.5 transition-transform" aria-hidden="true" />
</Link>
</div>
</div>
@@ -541,7 +523,7 @@ export function ToolGridSection({
{resolveLocalised(title, locale)}
</h3>
)}
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 sm:gap-5">
{tools.map((tool) => (
<ToolCard key={tool.id} tool={tool} locale={locale} />
))}
@@ -554,7 +536,7 @@ export function ToolGridSection({
// =========================================================================
// FULL EDGE-TO-EDGE STUDIO WORKSPACE ARCHITECTURE (/tools)
// Left Sidebar is docked directly to the left screen edge.
// Right Main Studio area fills the remaining screen width with spacious cards.
// Right Main Studio area fills the remaining screen width with compact 4-column cards.
// =========================================================================
return (
<div id="tools-catalog" className="w-full min-h-[calc(100vh-73px)] flex flex-col lg:flex-row bg-paper relative">
@@ -574,6 +556,7 @@ export function ToolGridSection({
{/* =========================================================================
LEFT SIDEBAR: DOCKED DIRECTLY TO VIEWPORT EDGE (STICKY DESKTOP)
High-contrast, clearly legible font with dedicated active category states
========================================================================= */}
<aside className="hidden lg:flex flex-col justify-between w-72 xl:w-80 shrink-0 border-r border-rule bg-paper-hi sticky top-[73px] h-[calc(100vh-73px)] overflow-y-auto no-scrollbar p-5 xl:p-6 z-20">
@@ -582,7 +565,7 @@ export function ToolGridSection({
{/* Categories Header */}
<div className="pb-3.5 border-b border-rule">
<h2 className="text-sm font-bold text-ink font-body">
<h2 className="text-sm font-bold text-slate-900 font-sans tracking-tight">
Categories
</h2>
</div>
@@ -590,24 +573,24 @@ export function ToolGridSection({
{/* Instant Search Bar with shortcut hint */}
{showSearch && (
<div className="relative w-full">
<Search className="w-3.5 h-3.5 absolute left-3.5 top-1/2 -translate-y-1/2 text-muted pointer-events-none" />
<Search className="w-3.5 h-3.5 absolute left-3.5 top-1/2 -translate-y-1/2 text-slate-400 pointer-events-none" />
<input
type="text"
placeholder="Search tools..."
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
className="w-full pl-9 pr-8 py-2.5 rounded-2xl text-xs border border-rule bg-paper text-ink placeholder:text-muted focus:outline-none focus:border-accent focus:ring-2 focus:ring-accent/20 shadow-2xs font-body transition-colors"
className="w-full pl-9 pr-8 py-2.5 rounded-xl text-xs sm:text-sm border border-slate-200 bg-white text-slate-900 placeholder:text-slate-400 focus:outline-none focus:border-accent focus:ring-2 focus:ring-accent/20 shadow-2xs font-sans transition-colors"
/>
{searchQuery ? (
<button
onClick={() => setSearchQuery('')}
className="absolute right-2.5 top-1/2 -translate-y-1/2 text-muted hover:text-ink cursor-pointer p-0.5"
className="absolute right-2.5 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-900 cursor-pointer p-0.5"
aria-label="Clear search query"
>
<X className="w-3.5 h-3.5" />
</button>
) : (
<kbd className="absolute right-2.5 top-1/2 -translate-y-1/2 text-[10px] font-mono text-muted bg-paper-2 border border-rule px-1.5 py-0.5 rounded pointer-events-none">
<kbd className="absolute right-2.5 top-1/2 -translate-y-1/2 text-[10px] font-mono text-slate-500 bg-slate-100 border border-slate-200 px-1.5 py-0.5 rounded pointer-events-none">
/
</kbd>
)}
@@ -616,17 +599,17 @@ export function ToolGridSection({
{/* Categories Navigation */}
<div className="space-y-2">
<div className="flex items-center justify-between px-1 font-body">
<span className="text-xs font-bold text-ink uppercase tracking-wider">Workspaces</span>
<div className="flex items-center justify-between px-1 font-sans">
<span className="text-xs font-bold text-slate-600 uppercase tracking-wider">Workspaces</span>
{(selectedCategory !== 'all' || searchQuery) && (
<button
onClick={() => {
handleSelectCategory('all');
setSearchQuery('');
}}
className="inline-flex items-center gap-1 text-[11px] font-semibold text-accent hover:underline cursor-pointer lowercase"
className="inline-flex items-center gap-1 text-xs font-semibold text-accent hover:underline cursor-pointer lowercase"
>
<RotateCcw className="w-2.5 h-2.5" />
<RotateCcw className="w-3 h-3" />
<span>reset</span>
</button>
)}
@@ -637,27 +620,27 @@ export function ToolGridSection({
<button
type="button"
onClick={() => handleSelectCategory('all')}
className={`w-full flex items-center justify-between px-3.5 py-2.5 rounded-2xl text-xs font-body transition-all duration-150 cursor-pointer ${
className={`w-full flex items-center justify-between px-3.5 py-2.5 rounded-xl text-xs sm:text-sm font-sans transition-all duration-150 cursor-pointer ${
selectedCategory === 'all' && !searchQuery
? 'bg-ink text-paper-hi shadow-xs font-semibold'
: 'bg-transparent text-ink-2 hover:bg-paper hover:text-ink border border-transparent hover:border-rule font-medium'
? 'bg-slate-900 text-white shadow-xs font-semibold'
: 'bg-transparent text-slate-800 hover:bg-slate-100 hover:text-slate-950 border border-transparent hover:border-slate-200 font-medium'
}`}
>
<div className="flex items-center gap-2.5 min-w-0">
<div className={`w-6 h-6 rounded-lg flex items-center justify-center shrink-0 ${
selectedCategory === 'all' && !searchQuery
? 'bg-paper-hi/20 text-accent'
: 'bg-paper-2 text-muted'
? 'bg-white/20 text-accent'
: 'bg-slate-100 text-slate-600'
}`}>
<Layers className="w-3.5 h-3.5" />
</div>
<span className="truncate">All Studio Tools</span>
</div>
<span
className={`text-[10px] font-mono px-2 py-0.5 rounded-full font-bold shrink-0 ${
className={`text-[11px] font-mono px-2 py-0.5 rounded-full font-bold shrink-0 ${
selectedCategory === 'all' && !searchQuery
? 'bg-paper-hi/20 text-paper-hi'
: 'bg-paper-2 text-muted'
? 'bg-white/20 text-white'
: 'bg-slate-100 text-slate-700 border border-slate-200/60'
}`}
>
{tools.length}
@@ -677,27 +660,27 @@ export function ToolGridSection({
key={group.id}
type="button"
onClick={() => handleSelectCategory(group.id)}
className={`w-full flex items-center justify-between px-3.5 py-2.5 rounded-2xl text-xs font-body transition-all duration-150 cursor-pointer ${
className={`w-full flex items-center justify-between px-3.5 py-2.5 rounded-xl text-xs sm:text-sm font-sans transition-all duration-150 cursor-pointer ${
isSelected
? 'bg-ink text-paper-hi shadow-xs font-semibold'
: 'bg-transparent text-ink-2 hover:bg-paper hover:text-ink border border-transparent hover:border-rule font-medium'
? 'bg-slate-900 text-white shadow-xs font-semibold'
: 'bg-transparent text-slate-800 hover:bg-slate-100 hover:text-slate-950 border border-transparent hover:border-slate-200 font-medium'
}`}
>
<div className="flex items-center gap-2.5 min-w-0">
<div className={`w-6 h-6 rounded-lg flex items-center justify-center shrink-0 ${
isSelected
? 'bg-paper-hi/20 text-accent'
: 'bg-paper-2 text-muted'
? 'bg-white/20 text-accent'
: 'bg-slate-100 text-slate-600'
}`}>
{theme?.icon || <Wand2 className="w-3.5 h-3.5 text-accent" />}
</div>
<span className="truncate">{catName}</span>
</div>
<span
className={`text-[10px] font-mono px-2 py-0.5 rounded-full font-bold shrink-0 ${
className={`text-[11px] font-mono px-2 py-0.5 rounded-full font-bold shrink-0 ${
isSelected
? 'bg-paper-hi/20 text-paper-hi'
: 'bg-paper-2 text-muted'
? 'bg-white/20 text-white'
: 'bg-slate-100 text-slate-700 border border-slate-200/60'
}`}
>
{group.tools.length}
@@ -714,48 +697,48 @@ export function ToolGridSection({
<div className="pt-4 border-t border-rule space-y-3">
<Link
href="/apps"
className="w-full inline-flex items-center justify-between px-3.5 py-2.5 rounded-2xl text-xs font-body font-semibold text-ink bg-paper-2 hover:bg-ink hover:text-paper-hi transition-colors duration-150 group shadow-2xs"
className="w-full inline-flex items-center justify-between px-3.5 py-2.5 rounded-xl text-xs sm:text-sm font-sans font-semibold text-slate-800 bg-slate-100 hover:bg-slate-900 hover:text-white transition-colors duration-150 group shadow-2xs"
>
<div className="flex items-center gap-2">
<Smartphone className="w-3.5 h-3.5 text-accent group-hover:text-paper-hi" />
<Smartphone className="w-3.5 h-3.5 text-accent group-hover:text-white" />
<span>Mobile studio suite</span>
</div>
<ArrowRight className="w-3 h-3 text-accent group-hover:text-paper-hi group-hover:translate-x-0.5 transition-all" />
<ArrowRight className="w-3 h-3 text-accent group-hover:text-white group-hover:translate-x-0.5 transition-all" />
</Link>
</div>
</aside>
{/* =========================================================================
RIGHT MAIN STUDIO WORKSPACE (SPACIOUS 2-TO-3 COLUMN CARDS GALLERY)
RIGHT MAIN STUDIO WORKSPACE (SPACIOUS 4-COLUMN CARDS GALLERY)
========================================================================= */}
<div className="flex-1 min-w-0 px-4 sm:px-8 xl:px-12 py-8 xl:py-10 space-y-10 relative z-10">
<div className="flex-1 min-w-0 px-4 sm:px-6 xl:px-8 py-8 xl:py-10 space-y-10 relative z-10">
{/* ================= MOBILE FILTER HEADER (< lg) ================= */}
<div className="lg:hidden space-y-3 pb-4 border-b border-rule">
<div className="flex items-center justify-between">
<span className="text-sm font-bold text-ink font-body">
<span className="text-sm font-bold text-slate-900 font-sans">
Categories
</span>
<span className="text-xs font-medium text-muted font-body">
<span className="text-xs font-medium text-slate-500 font-sans">
{tools.length} tools
</span>
</div>
{showSearch && (
<div className="relative w-full">
<Search className="w-4 h-4 absolute left-3.5 top-1/2 -translate-y-1/2 text-muted pointer-events-none" />
<Search className="w-4 h-4 absolute left-3.5 top-1/2 -translate-y-1/2 text-slate-400 pointer-events-none" />
<input
type="text"
placeholder="Search studio tools..."
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
className="w-full pl-9 pr-8 py-2.5 rounded-2xl text-xs sm:text-sm border border-rule bg-paper-hi text-ink placeholder:text-muted focus:outline-none focus:border-accent focus:ring-2 focus:ring-accent/20 shadow-2xs font-body transition-colors"
className="w-full pl-9 pr-8 py-2.5 rounded-xl text-xs sm:text-sm border border-slate-200 bg-white text-slate-900 placeholder:text-slate-400 focus:outline-none focus:border-accent focus:ring-2 focus:ring-accent/20 shadow-2xs font-sans transition-colors"
/>
{searchQuery && (
<button
onClick={() => setSearchQuery('')}
className="absolute right-3 top-1/2 -translate-y-1/2 text-muted hover:text-ink cursor-pointer p-0.5"
className="absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-900 cursor-pointer p-0.5"
aria-label="Clear search"
>
<X className="w-4 h-4" />
@@ -768,10 +751,10 @@ export function ToolGridSection({
<button
type="button"
onClick={() => handleSelectCategory('all')}
className={`inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-full text-xs font-body font-semibold shrink-0 transition-colors ${
className={`inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-full text-xs font-sans font-semibold shrink-0 transition-colors ${
selectedCategory === 'all' && !searchQuery
? 'bg-ink text-paper-hi shadow-xs'
: 'bg-paper-hi text-ink-2 border border-rule hover:text-ink'
? 'bg-slate-900 text-white shadow-xs'
: 'bg-white text-slate-800 border border-slate-200 hover:text-slate-950'
}`}
>
<Layers className="w-3.5 h-3.5" />
@@ -789,10 +772,10 @@ export function ToolGridSection({
key={group.id}
type="button"
onClick={() => handleSelectCategory(group.id)}
className={`inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-full text-xs font-body font-semibold shrink-0 transition-colors ${
className={`inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-full text-xs font-sans font-semibold shrink-0 transition-colors ${
isSelected
? 'bg-ink text-paper-hi shadow-xs'
: 'bg-paper-hi text-ink-2 border border-rule hover:text-ink'
? 'bg-slate-900 text-white shadow-xs'
: 'bg-white text-slate-800 border border-slate-200 hover:text-slate-950'
}`}
>
<span className="shrink-0">{theme?.icon}</span>
@@ -807,7 +790,7 @@ export function ToolGridSection({
{/* ================= INTEGRATED STUDIO HEADER ================= */}
<div className="space-y-4 border-b border-rule pb-8">
{/* Breadcrumb row */}
<div className="flex items-center gap-2 text-xs font-body text-muted">
<div className="flex items-center gap-2 text-xs font-sans text-slate-500">
<span>Studio Directory</span>
<span>/</span>
{activeCategoryItem ? (
@@ -815,7 +798,7 @@ export function ToolGridSection({
<button
type="button"
onClick={() => handleSelectCategory('all')}
className="hover:text-ink hover:underline cursor-pointer"
className="hover:text-slate-900 hover:underline cursor-pointer"
>
All Vision Workspaces
</button>
@@ -845,12 +828,12 @@ export function ToolGridSection({
{resolveLocalised(activeCategoryItem.category?.name, locale)}
</KineticText>
</h1>
<span className="text-xs font-semibold text-accent bg-accent/10 px-2.5 py-0.5 rounded-full border border-accent/20 font-body">
<span className="text-xs font-semibold text-accent bg-accent/10 px-2.5 py-0.5 rounded-full border border-accent/20 font-sans">
{activeCategoryItem.tools.length}{' '}
{activeCategoryItem.tools.length === 1 ? 'tool' : 'tools'}
</span>
</div>
<p className="text-sm sm:text-base text-ink-2 font-body max-w-2xl mt-1.5 leading-relaxed">
<p className="text-sm sm:text-base text-ink-2 font-sans max-w-2xl mt-1.5 leading-relaxed">
{resolveLocalised(activeCategoryItem.category?.description, locale)}
</p>
</div>
@@ -859,7 +842,7 @@ export function ToolGridSection({
<button
type="button"
onClick={() => handleSelectCategory('all')}
className="self-start sm:self-center shrink-0 inline-flex items-center gap-1.5 px-4 py-2 rounded-full text-xs font-body font-semibold text-ink bg-paper-hi border border-rule hover:border-accent hover:text-accent transition-colors shadow-2xs cursor-pointer"
className="self-start sm:self-center shrink-0 inline-flex items-center gap-1.5 px-4 py-2 rounded-full text-xs font-sans font-semibold text-slate-800 bg-paper-hi border border-rule hover:border-accent hover:text-accent transition-colors shadow-2xs cursor-pointer"
>
<span>Show all {tools.length} tools</span>
<ArrowRight className="w-3.5 h-3.5 text-accent" />
@@ -873,7 +856,7 @@ export function ToolGridSection({
{resolveLocalised(title, locale) || 'AI Photo & Vision Tools Studio'}
</KineticText>
</h1>
<p className="text-sm sm:text-base text-ink-2 font-body max-w-3xl mt-3 leading-relaxed">
<p className="text-sm sm:text-base text-ink-2 font-sans max-w-3xl mt-3 leading-relaxed">
{resolveLocalised(subtitle, locale) ||
'Client-side neural vision models running directly in volatile GPU memory with zero retention. Test interactive before/after sliders or export in native 4K.'}
</p>
@@ -884,41 +867,41 @@ export function ToolGridSection({
{/* ================= SEARCH RESULTS ACTIVE VIEW ================= */}
{searchResults ? (
<div className="space-y-6">
<div className="studio-sheet p-5 sm:p-6 rounded-3xl bg-paper-hi border border-rule shadow-[0_4px_24px_-4px_rgba(0,0,0,0.03)] flex items-center justify-between">
<div className="studio-sheet p-5 sm:p-6 rounded-2xl bg-paper-hi border border-rule shadow-[0_4px_20px_-4px_rgba(0,0,0,0.03)] flex items-center justify-between">
<div>
<h3 className="text-lg sm:text-xl font-display font-bold text-ink">
Search results for &quot;{searchQuery}&quot;
</h3>
<p className="text-xs text-muted font-body mt-0.5">
<p className="text-xs text-slate-500 font-sans mt-0.5">
Found {searchResults.length} matching {searchResults.length === 1 ? 'tool' : 'tools'} in catalog
</p>
</div>
<button
onClick={() => setSearchQuery('')}
className="text-xs font-body font-semibold text-accent hover:underline cursor-pointer px-3.5 py-1.5 rounded-full bg-accent/10 border border-accent/20"
className="text-xs font-sans font-semibold text-accent hover:underline cursor-pointer px-3.5 py-1.5 rounded-full bg-accent/10 border border-accent/20"
>
Clear search
</button>
</div>
{searchResults.length > 0 ? (
<div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6 sm:gap-7 lg:gap-8">
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 sm:gap-5">
{searchResults.map((tool) => (
<ToolCard key={tool.id} tool={tool} locale={locale} />
))}
</div>
) : (
<div className="text-center py-16 text-muted space-y-3 font-body studio-sheet rounded-3xl bg-paper-hi border border-rule p-8 max-w-lg mx-auto shadow-sheet">
<p className="font-bold text-ink text-base">
<div className="text-center py-16 text-muted space-y-3 font-sans studio-sheet rounded-2xl bg-paper-hi border border-rule p-8 max-w-lg mx-auto shadow-sheet">
<p className="font-bold text-slate-900 text-base">
No studio tools found matching &quot;{searchQuery}&quot;
</p>
<p className="text-xs text-muted">
<p className="text-xs text-slate-500">
Try searching for &quot;blemish&quot;, &quot;restoration&quot;,
&quot;background&quot;, or &quot;avatar&quot;.
</p>
<button
onClick={() => setSearchQuery('')}
className="mt-3 inline-flex items-center px-4 py-2 rounded-full bg-ink text-paper-hi text-xs font-semibold shadow-sm cursor-pointer hover:bg-ink/90 transition-colors"
className="mt-3 inline-flex items-center px-4 py-2 rounded-full bg-slate-900 text-white text-xs font-semibold shadow-sm cursor-pointer hover:bg-slate-800 transition-colors"
>
View all tools directory
</button>
@@ -926,9 +909,9 @@ export function ToolGridSection({
)}
</div>
) : activeCategoryItem ? (
/* ================= SINGLE CATEGORY FOCUSED WORKSPACE ================= */
/* ================= SINGLE CATEGORY FOCUSED WORKSPACE (SHOWS ALL TOOLS IN CATEGORY) ================= */
<div className="space-y-6">
<div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6 sm:gap-7 lg:gap-8">
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 sm:gap-5">
{activeCategoryItem.tools.map((tool) => (
<ToolCard
key={tool.id}
@@ -940,7 +923,7 @@ export function ToolGridSection({
</div>
</div>
) : (
/* ================= CATEGORIZED TOOLS GALLERY ================= */
/* ================= CATEGORIZED TOOLS GALLERY (2 ROWS PER CATEGORY + SEE MORE) ================= */
<div className="space-y-12 sm:space-y-16">
{/* Displayed Categories */}
{categorizedTools.map((group) => {
@@ -950,6 +933,10 @@ export function ToolGridSection({
: group.id;
const catDesc = group.category ? resolveLocalised(group.category.description, locale) : '';
// In "All Tools" view, only 2 rows are visible (4 items per row * 2 rows = 8 tools)
const displayedTools = group.tools.slice(0, 8);
const hasMoreTools = group.tools.length > 8;
return (
<div
key={group.id}
@@ -967,13 +954,13 @@ export function ToolGridSection({
<h3 className="text-xl sm:text-2xl font-display font-bold text-ink tracking-tight">
<KineticText>{catName}</KineticText>
</h3>
<span className="text-xs font-semibold text-accent bg-accent/10 px-2.5 py-0.5 rounded-full border border-accent/20 font-body">
<span className="text-xs font-semibold text-accent bg-accent/10 px-2.5 py-0.5 rounded-full border border-accent/20 font-sans">
{group.tools.length}{' '}
{group.tools.length === 1 ? 'tool' : 'tools'}
</span>
</div>
{catDesc && (
<p className="text-xs sm:text-sm text-ink-2 mt-0.5 font-body line-clamp-1 sm:line-clamp-none">
<p className="text-xs sm:text-sm text-ink-2 mt-0.5 font-sans line-clamp-1 sm:line-clamp-none">
{catDesc}
</p>
)}
@@ -984,18 +971,23 @@ export function ToolGridSection({
{selectedCategory === 'all' && (
<button
type="button"
onClick={() => handleSelectCategory(group.id)}
className="self-start sm:self-auto text-xs font-body font-semibold text-muted hover:text-accent transition-colors inline-flex items-center gap-1 cursor-pointer"
onClick={() => {
handleSelectCategory(group.id);
if (typeof window !== 'undefined') {
window.scrollTo({ top: 0, behavior: 'smooth' });
}
}}
className="self-start sm:self-auto text-xs font-sans font-semibold text-slate-500 hover:text-accent transition-colors inline-flex items-center gap-1 cursor-pointer"
>
<span>Filter {catName}</span>
<span>View all {group.tools.length}</span>
<ChevronRight className="w-3.5 h-3.5" />
</button>
)}
</div>
{/* Tool Cards Grid: Spacious 3-Column Layout on Desktop */}
<div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6 sm:gap-7 lg:gap-8">
{group.tools.map((tool) => (
{/* Tool Cards Grid: 4 items in a row, at most 2 rows (8 tools) visible */}
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 sm:gap-5">
{displayedTools.map((tool) => (
<ToolCard
key={tool.id}
tool={tool}
@@ -1004,6 +996,25 @@ export function ToolGridSection({
/>
))}
</div>
{/* "See More" Button after 2 rows: shifts sidebar and view to dedicated category */}
{hasMoreTools && (
<div className="flex items-center justify-center pt-3">
<button
type="button"
onClick={() => {
handleSelectCategory(group.id);
if (typeof window !== 'undefined') {
window.scrollTo({ top: 0, behavior: 'smooth' });
}
}}
className="inline-flex items-center gap-2 px-6 py-2.5 rounded-xl bg-white hover:bg-slate-900 text-slate-900 hover:text-white border border-slate-200 hover:border-slate-900 font-sans font-semibold text-xs sm:text-sm shadow-xs hover:shadow-md transition-all duration-200 group/more cursor-pointer active:scale-98"
>
<span>See more in {catName} ({group.tools.length - 8} more tools)</span>
<ArrowRight className="w-4 h-4 text-accent group-hover/more:text-white group-hover/more:translate-x-1 transition-all" />
</button>
</div>
)}
</div>
);
})}