feat(tools): enhance tools page layout with 4-column grid, high-contrast sidebar, and category pagination
This commit is contained in:
@@ -279,7 +279,7 @@ function ToolCardImage({ tool, toolName }: { tool: ToolItem; toolName: string })
|
|||||||
// 1. VIDEO TOOL (Background Remover)
|
// 1. VIDEO TOOL (Background Remover)
|
||||||
if (media.type === 'video') {
|
if (media.type === 'video') {
|
||||||
return (
|
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
|
<video
|
||||||
ref={videoRef}
|
ref={videoRef}
|
||||||
src={media.videoUrl}
|
src={media.videoUrl}
|
||||||
@@ -297,7 +297,7 @@ function ToolCardImage({ tool, toolName }: { tool: ToolItem; toolName: string })
|
|||||||
// 2. SINGLE IMAGE (Polaroid, etc.)
|
// 2. SINGLE IMAGE (Polaroid, etc.)
|
||||||
if (media.type === 'single') {
|
if (media.type === 'single') {
|
||||||
return (
|
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 */}
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||||
<img
|
<img
|
||||||
src={media.image}
|
src={media.image}
|
||||||
@@ -317,7 +317,7 @@ function ToolCardImage({ tool, toolName }: { tool: ToolItem; toolName: string })
|
|||||||
onPointerDown={handleContainerPointerDown}
|
onPointerDown={handleContainerPointerDown}
|
||||||
onPointerMove={handleContainerPointerMove}
|
onPointerMove={handleContainerPointerMove}
|
||||||
onPointerLeave={handleContainerPointerLeave}
|
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' }}
|
style={{ touchAction: 'pan-y' }}
|
||||||
>
|
>
|
||||||
{/* Enhanced / After Image (Underneath) */}
|
{/* Enhanced / After Image (Underneath) */}
|
||||||
@@ -364,11 +364,11 @@ function ToolCardImage({ tool, toolName }: { tool: ToolItem; toolName: string })
|
|||||||
aria-valuenow={Math.round(splitPos)}
|
aria-valuenow={Math.round(splitPos)}
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
style={{ touchAction: 'none' }}
|
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="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-[3px] border-y-transparent border-r-[4px] 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-l-[4px] border-l-ink" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -389,57 +389,39 @@ function ToolCard({
|
|||||||
const toolName = resolveLocalised(tool.name, locale);
|
const toolName = resolveLocalised(tool.name, locale);
|
||||||
const toolSummary = resolveLocalised(tool.summary, 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 (
|
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 */}
|
{/* Image Dominant Preview Frame */}
|
||||||
<ToolCardImage tool={tool} toolName={toolName} />
|
<ToolCardImage tool={tool} toolName={toolName} />
|
||||||
|
|
||||||
{/* Info Area: Title, Subtitle, and Direct Action Button */}
|
{/* 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>
|
<div>
|
||||||
{/* Badge & Tool Title */}
|
{/* 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>
|
|
||||||
|
|
||||||
<Link href={`/tools/${tool.slug}`} className="block">
|
<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>
|
<AnimatedShinyText>{toolName}</AnimatedShinyText>
|
||||||
</h4>
|
</h4>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
{/* Tool Description */}
|
{/* 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}
|
{toolSummary}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Action Button Row: Highly Visible Prominent Primary Button */}
|
{/* 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
|
<Link
|
||||||
href={`/tools/${tool.slug}`}
|
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}`}
|
aria-label={`Open interactive studio for ${toolName}`}
|
||||||
>
|
>
|
||||||
<span className="flex items-center gap-2">
|
<span className="flex items-center gap-1.5">
|
||||||
<Sparkles className="w-4 h-4 text-accent group-hover/btn:text-white transition-colors" />
|
<Sparkles className="w-3.5 h-3.5 text-accent group-hover/btn:text-white transition-colors" />
|
||||||
<span>Launch Tool Studio</span>
|
<span>Launch Studio</span>
|
||||||
</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>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -541,7 +523,7 @@ export function ToolGridSection({
|
|||||||
{resolveLocalised(title, locale)}
|
{resolveLocalised(title, locale)}
|
||||||
</h3>
|
</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) => (
|
{tools.map((tool) => (
|
||||||
<ToolCard key={tool.id} tool={tool} locale={locale} />
|
<ToolCard key={tool.id} tool={tool} locale={locale} />
|
||||||
))}
|
))}
|
||||||
@@ -554,7 +536,7 @@ export function ToolGridSection({
|
|||||||
// =========================================================================
|
// =========================================================================
|
||||||
// FULL EDGE-TO-EDGE STUDIO WORKSPACE ARCHITECTURE (/tools)
|
// FULL EDGE-TO-EDGE STUDIO WORKSPACE ARCHITECTURE (/tools)
|
||||||
// Left Sidebar is docked directly to the left screen edge.
|
// 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 (
|
return (
|
||||||
<div id="tools-catalog" className="w-full min-h-[calc(100vh-73px)] flex flex-col lg:flex-row bg-paper relative">
|
<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)
|
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">
|
<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 */}
|
{/* Categories Header */}
|
||||||
<div className="pb-3.5 border-b border-rule">
|
<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
|
Categories
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -590,24 +573,24 @@ export function ToolGridSection({
|
|||||||
{/* Instant Search Bar with shortcut hint */}
|
{/* Instant Search Bar with shortcut hint */}
|
||||||
{showSearch && (
|
{showSearch && (
|
||||||
<div className="relative w-full">
|
<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
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Search tools..."
|
placeholder="Search tools..."
|
||||||
value={searchQuery}
|
value={searchQuery}
|
||||||
onChange={(e) => setSearchQuery(e.target.value)}
|
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 ? (
|
{searchQuery ? (
|
||||||
<button
|
<button
|
||||||
onClick={() => setSearchQuery('')}
|
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"
|
aria-label="Clear search query"
|
||||||
>
|
>
|
||||||
<X className="w-3.5 h-3.5" />
|
<X className="w-3.5 h-3.5" />
|
||||||
</button>
|
</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>
|
</kbd>
|
||||||
)}
|
)}
|
||||||
@@ -616,17 +599,17 @@ export function ToolGridSection({
|
|||||||
|
|
||||||
{/* Categories Navigation */}
|
{/* Categories Navigation */}
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="flex items-center justify-between px-1 font-body">
|
<div className="flex items-center justify-between px-1 font-sans">
|
||||||
<span className="text-xs font-bold text-ink uppercase tracking-wider">Workspaces</span>
|
<span className="text-xs font-bold text-slate-600 uppercase tracking-wider">Workspaces</span>
|
||||||
{(selectedCategory !== 'all' || searchQuery) && (
|
{(selectedCategory !== 'all' || searchQuery) && (
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
handleSelectCategory('all');
|
handleSelectCategory('all');
|
||||||
setSearchQuery('');
|
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>
|
<span>reset</span>
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
@@ -637,27 +620,27 @@ export function ToolGridSection({
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => handleSelectCategory('all')}
|
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
|
selectedCategory === 'all' && !searchQuery
|
||||||
? 'bg-ink text-paper-hi shadow-xs font-semibold'
|
? 'bg-slate-900 text-white shadow-xs font-semibold'
|
||||||
: 'bg-transparent text-ink-2 hover:bg-paper hover:text-ink border border-transparent hover:border-rule font-medium'
|
: '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="flex items-center gap-2.5 min-w-0">
|
||||||
<div className={`w-6 h-6 rounded-lg flex items-center justify-center shrink-0 ${
|
<div className={`w-6 h-6 rounded-lg flex items-center justify-center shrink-0 ${
|
||||||
selectedCategory === 'all' && !searchQuery
|
selectedCategory === 'all' && !searchQuery
|
||||||
? 'bg-paper-hi/20 text-accent'
|
? 'bg-white/20 text-accent'
|
||||||
: 'bg-paper-2 text-muted'
|
: 'bg-slate-100 text-slate-600'
|
||||||
}`}>
|
}`}>
|
||||||
<Layers className="w-3.5 h-3.5" />
|
<Layers className="w-3.5 h-3.5" />
|
||||||
</div>
|
</div>
|
||||||
<span className="truncate">All Studio Tools</span>
|
<span className="truncate">All Studio Tools</span>
|
||||||
</div>
|
</div>
|
||||||
<span
|
<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
|
selectedCategory === 'all' && !searchQuery
|
||||||
? 'bg-paper-hi/20 text-paper-hi'
|
? 'bg-white/20 text-white'
|
||||||
: 'bg-paper-2 text-muted'
|
: 'bg-slate-100 text-slate-700 border border-slate-200/60'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{tools.length}
|
{tools.length}
|
||||||
@@ -677,27 +660,27 @@ export function ToolGridSection({
|
|||||||
key={group.id}
|
key={group.id}
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => handleSelectCategory(group.id)}
|
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
|
isSelected
|
||||||
? 'bg-ink text-paper-hi shadow-xs font-semibold'
|
? 'bg-slate-900 text-white shadow-xs font-semibold'
|
||||||
: 'bg-transparent text-ink-2 hover:bg-paper hover:text-ink border border-transparent hover:border-rule font-medium'
|
: '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="flex items-center gap-2.5 min-w-0">
|
||||||
<div className={`w-6 h-6 rounded-lg flex items-center justify-center shrink-0 ${
|
<div className={`w-6 h-6 rounded-lg flex items-center justify-center shrink-0 ${
|
||||||
isSelected
|
isSelected
|
||||||
? 'bg-paper-hi/20 text-accent'
|
? 'bg-white/20 text-accent'
|
||||||
: 'bg-paper-2 text-muted'
|
: 'bg-slate-100 text-slate-600'
|
||||||
}`}>
|
}`}>
|
||||||
{theme?.icon || <Wand2 className="w-3.5 h-3.5 text-accent" />}
|
{theme?.icon || <Wand2 className="w-3.5 h-3.5 text-accent" />}
|
||||||
</div>
|
</div>
|
||||||
<span className="truncate">{catName}</span>
|
<span className="truncate">{catName}</span>
|
||||||
</div>
|
</div>
|
||||||
<span
|
<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
|
isSelected
|
||||||
? 'bg-paper-hi/20 text-paper-hi'
|
? 'bg-white/20 text-white'
|
||||||
: 'bg-paper-2 text-muted'
|
: 'bg-slate-100 text-slate-700 border border-slate-200/60'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{group.tools.length}
|
{group.tools.length}
|
||||||
@@ -714,48 +697,48 @@ export function ToolGridSection({
|
|||||||
<div className="pt-4 border-t border-rule space-y-3">
|
<div className="pt-4 border-t border-rule space-y-3">
|
||||||
<Link
|
<Link
|
||||||
href="/apps"
|
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">
|
<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>
|
<span>Mobile studio suite</span>
|
||||||
</div>
|
</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>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</aside>
|
</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) ================= */}
|
{/* ================= MOBILE FILTER HEADER (< lg) ================= */}
|
||||||
<div className="lg:hidden space-y-3 pb-4 border-b border-rule">
|
<div className="lg:hidden space-y-3 pb-4 border-b border-rule">
|
||||||
<div className="flex items-center justify-between">
|
<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
|
Categories
|
||||||
</span>
|
</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
|
{tools.length} tools
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{showSearch && (
|
{showSearch && (
|
||||||
<div className="relative w-full">
|
<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
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Search studio tools..."
|
placeholder="Search studio tools..."
|
||||||
value={searchQuery}
|
value={searchQuery}
|
||||||
onChange={(e) => setSearchQuery(e.target.value)}
|
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 && (
|
{searchQuery && (
|
||||||
<button
|
<button
|
||||||
onClick={() => setSearchQuery('')}
|
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"
|
aria-label="Clear search"
|
||||||
>
|
>
|
||||||
<X className="w-4 h-4" />
|
<X className="w-4 h-4" />
|
||||||
@@ -768,10 +751,10 @@ export function ToolGridSection({
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => handleSelectCategory('all')}
|
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
|
selectedCategory === 'all' && !searchQuery
|
||||||
? 'bg-ink text-paper-hi shadow-xs'
|
? 'bg-slate-900 text-white shadow-xs'
|
||||||
: 'bg-paper-hi text-ink-2 border border-rule hover:text-ink'
|
: 'bg-white text-slate-800 border border-slate-200 hover:text-slate-950'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<Layers className="w-3.5 h-3.5" />
|
<Layers className="w-3.5 h-3.5" />
|
||||||
@@ -789,10 +772,10 @@ export function ToolGridSection({
|
|||||||
key={group.id}
|
key={group.id}
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => handleSelectCategory(group.id)}
|
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
|
isSelected
|
||||||
? 'bg-ink text-paper-hi shadow-xs'
|
? 'bg-slate-900 text-white shadow-xs'
|
||||||
: 'bg-paper-hi text-ink-2 border border-rule hover:text-ink'
|
: 'bg-white text-slate-800 border border-slate-200 hover:text-slate-950'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<span className="shrink-0">{theme?.icon}</span>
|
<span className="shrink-0">{theme?.icon}</span>
|
||||||
@@ -807,7 +790,7 @@ export function ToolGridSection({
|
|||||||
{/* ================= INTEGRATED STUDIO HEADER ================= */}
|
{/* ================= INTEGRATED STUDIO HEADER ================= */}
|
||||||
<div className="space-y-4 border-b border-rule pb-8">
|
<div className="space-y-4 border-b border-rule pb-8">
|
||||||
{/* Breadcrumb row */}
|
{/* 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>Studio Directory</span>
|
||||||
<span>/</span>
|
<span>/</span>
|
||||||
{activeCategoryItem ? (
|
{activeCategoryItem ? (
|
||||||
@@ -815,7 +798,7 @@ export function ToolGridSection({
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => handleSelectCategory('all')}
|
onClick={() => handleSelectCategory('all')}
|
||||||
className="hover:text-ink hover:underline cursor-pointer"
|
className="hover:text-slate-900 hover:underline cursor-pointer"
|
||||||
>
|
>
|
||||||
All Vision Workspaces
|
All Vision Workspaces
|
||||||
</button>
|
</button>
|
||||||
@@ -845,12 +828,12 @@ export function ToolGridSection({
|
|||||||
{resolveLocalised(activeCategoryItem.category?.name, locale)}
|
{resolveLocalised(activeCategoryItem.category?.name, locale)}
|
||||||
</KineticText>
|
</KineticText>
|
||||||
</h1>
|
</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}{' '}
|
||||||
{activeCategoryItem.tools.length === 1 ? 'tool' : 'tools'}
|
{activeCategoryItem.tools.length === 1 ? 'tool' : 'tools'}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</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)}
|
{resolveLocalised(activeCategoryItem.category?.description, locale)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -859,7 +842,7 @@ export function ToolGridSection({
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => handleSelectCategory('all')}
|
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>
|
<span>Show all {tools.length} tools</span>
|
||||||
<ArrowRight className="w-3.5 h-3.5 text-accent" />
|
<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'}
|
{resolveLocalised(title, locale) || 'AI Photo & Vision Tools Studio'}
|
||||||
</KineticText>
|
</KineticText>
|
||||||
</h1>
|
</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) ||
|
{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.'}
|
'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>
|
</p>
|
||||||
@@ -884,41 +867,41 @@ export function ToolGridSection({
|
|||||||
{/* ================= SEARCH RESULTS ACTIVE VIEW ================= */}
|
{/* ================= SEARCH RESULTS ACTIVE VIEW ================= */}
|
||||||
{searchResults ? (
|
{searchResults ? (
|
||||||
<div className="space-y-6">
|
<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>
|
<div>
|
||||||
<h3 className="text-lg sm:text-xl font-display font-bold text-ink">
|
<h3 className="text-lg sm:text-xl font-display font-bold text-ink">
|
||||||
Search results for "{searchQuery}"
|
Search results for "{searchQuery}"
|
||||||
</h3>
|
</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
|
Found {searchResults.length} matching {searchResults.length === 1 ? 'tool' : 'tools'} in catalog
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
onClick={() => setSearchQuery('')}
|
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
|
Clear search
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{searchResults.length > 0 ? (
|
{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) => (
|
{searchResults.map((tool) => (
|
||||||
<ToolCard key={tool.id} tool={tool} locale={locale} />
|
<ToolCard key={tool.id} tool={tool} locale={locale} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</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">
|
<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-ink text-base">
|
<p className="font-bold text-slate-900 text-base">
|
||||||
No studio tools found matching "{searchQuery}"
|
No studio tools found matching "{searchQuery}"
|
||||||
</p>
|
</p>
|
||||||
<p className="text-xs text-muted">
|
<p className="text-xs text-slate-500">
|
||||||
Try searching for "blemish", "restoration",
|
Try searching for "blemish", "restoration",
|
||||||
"background", or "avatar".
|
"background", or "avatar".
|
||||||
</p>
|
</p>
|
||||||
<button
|
<button
|
||||||
onClick={() => setSearchQuery('')}
|
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
|
View all tools directory
|
||||||
</button>
|
</button>
|
||||||
@@ -926,9 +909,9 @@ export function ToolGridSection({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
) : activeCategoryItem ? (
|
) : activeCategoryItem ? (
|
||||||
/* ================= SINGLE CATEGORY FOCUSED WORKSPACE ================= */
|
/* ================= SINGLE CATEGORY FOCUSED WORKSPACE (SHOWS ALL TOOLS IN CATEGORY) ================= */
|
||||||
<div className="space-y-6">
|
<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) => (
|
{activeCategoryItem.tools.map((tool) => (
|
||||||
<ToolCard
|
<ToolCard
|
||||||
key={tool.id}
|
key={tool.id}
|
||||||
@@ -940,7 +923,7 @@ export function ToolGridSection({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
/* ================= CATEGORIZED TOOLS GALLERY ================= */
|
/* ================= CATEGORIZED TOOLS GALLERY (2 ROWS PER CATEGORY + SEE MORE) ================= */
|
||||||
<div className="space-y-12 sm:space-y-16">
|
<div className="space-y-12 sm:space-y-16">
|
||||||
{/* Displayed Categories */}
|
{/* Displayed Categories */}
|
||||||
{categorizedTools.map((group) => {
|
{categorizedTools.map((group) => {
|
||||||
@@ -950,6 +933,10 @@ export function ToolGridSection({
|
|||||||
: group.id;
|
: group.id;
|
||||||
const catDesc = group.category ? resolveLocalised(group.category.description, locale) : '';
|
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 (
|
return (
|
||||||
<div
|
<div
|
||||||
key={group.id}
|
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">
|
<h3 className="text-xl sm:text-2xl font-display font-bold text-ink tracking-tight">
|
||||||
<KineticText>{catName}</KineticText>
|
<KineticText>{catName}</KineticText>
|
||||||
</h3>
|
</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}{' '}
|
||||||
{group.tools.length === 1 ? 'tool' : 'tools'}
|
{group.tools.length === 1 ? 'tool' : 'tools'}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{catDesc && (
|
{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}
|
{catDesc}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
@@ -984,18 +971,23 @@ export function ToolGridSection({
|
|||||||
{selectedCategory === 'all' && (
|
{selectedCategory === 'all' && (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => handleSelectCategory(group.id)}
|
onClick={() => {
|
||||||
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"
|
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" />
|
<ChevronRight className="w-3.5 h-3.5" />
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Tool Cards Grid: Spacious 3-Column Layout on Desktop */}
|
{/* Tool Cards Grid: 4 items in a row, at most 2 rows (8 tools) visible */}
|
||||||
<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">
|
||||||
{group.tools.map((tool) => (
|
{displayedTools.map((tool) => (
|
||||||
<ToolCard
|
<ToolCard
|
||||||
key={tool.id}
|
key={tool.id}
|
||||||
tool={tool}
|
tool={tool}
|
||||||
@@ -1004,6 +996,25 @@ export function ToolGridSection({
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</div>
|
</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>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
Reference in New Issue
Block a user