feat(tools): add category-wise vertical tools stack with interactive sliders
This commit is contained in:
@@ -22,6 +22,7 @@ import { NoticeSection } from './NoticeSection';
|
||||
import { TransformationReelSection } from './TransformationReelSection';
|
||||
import { VisualUseCasesSection } from './VisualUseCasesSection';
|
||||
import { WorkflowVisualizerSection } from './WorkflowVisualizerSection';
|
||||
import { VerticalToolStackSection } from './VerticalToolStackSection';
|
||||
|
||||
interface SectionRendererProps {
|
||||
section: SectionConfig;
|
||||
@@ -74,6 +75,17 @@ export function SectionRenderer({ section, context }: SectionRendererProps) {
|
||||
case 'workflowVisualizer':
|
||||
return <WorkflowVisualizerSection />;
|
||||
|
||||
case 'verticalToolStack':
|
||||
return (
|
||||
<VerticalToolStackSection
|
||||
context={{
|
||||
tools: context.tools || [],
|
||||
categories: context.categories || [],
|
||||
locale,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
case 'toolGrid':
|
||||
return (
|
||||
<ToolGridSection
|
||||
|
||||
@@ -0,0 +1,337 @@
|
||||
'use client';
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import Link from 'next/link';
|
||||
import {
|
||||
Smile,
|
||||
Sparkles,
|
||||
Scissors,
|
||||
Palette,
|
||||
Layers,
|
||||
ArrowRight,
|
||||
CheckCircle2,
|
||||
Zap,
|
||||
ShieldCheck,
|
||||
Cpu,
|
||||
Smartphone,
|
||||
ExternalLink
|
||||
} from 'lucide-react';
|
||||
import { resolveLocalised, ToolItem, CategoryItem } from '@/types';
|
||||
import { BeforeAfterSlider } from '@/components/ui/BeforeAfterSlider';
|
||||
|
||||
export interface VerticalToolStackProps {
|
||||
context: {
|
||||
tools: ToolItem[];
|
||||
categories: CategoryItem[];
|
||||
locale: string;
|
||||
};
|
||||
}
|
||||
|
||||
const ICON_MAP: Record<string, React.ElementType> = {
|
||||
Smile,
|
||||
Sparkles,
|
||||
Scissors,
|
||||
Palette,
|
||||
Layers,
|
||||
};
|
||||
|
||||
// Architecture badges mapped by tool id
|
||||
const MODEL_BADGES: Record<string, { model: string; latency: string; chip: string }> = {
|
||||
'face.blemish.remove': { model: 'RetouchGAN v2.1', latency: '< 380ms', chip: 'Sub-Pore Texture' },
|
||||
'face.teeth.whiten': { model: 'DentiClear AI', latency: '< 290ms', chip: 'Enamel Lustre Preservation' },
|
||||
'bg.p3m.matting': { model: 'P3M-Net Alpha', latency: '< 520ms', chip: 'Hair-Strand Precision' },
|
||||
'restore.photo.enhance': { model: 'GFPGAN + RealESRGAN', latency: '< 460ms', chip: '4K Super-Resolution' },
|
||||
'restore.photo.old': { model: 'ScratchDeNet Pro', latency: '< 490ms', chip: 'Crack & Tear Inpainting' },
|
||||
'restore.photo.colorize': { model: 'DeOldify Chroma', latency: '< 420ms', chip: 'Historical Palette AI' },
|
||||
'art.cartoon.caricature': { model: 'AnimeGAN v3 Core', latency: '< 350ms', chip: 'Vector Line Art' },
|
||||
'art.polaroid.fx': { model: 'AnalogFilm Studio', latency: '< 240ms', chip: 'Halide Grain Synthesis' },
|
||||
};
|
||||
|
||||
export function VerticalToolStackSection({ context }: VerticalToolStackProps) {
|
||||
const { tools, categories, locale } = context;
|
||||
const [selectedCategory, setSelectedCategory] = useState<string>('all');
|
||||
|
||||
const filteredCategories = selectedCategory === 'all'
|
||||
? categories
|
||||
: categories.filter((c) => c.slug === selectedCategory);
|
||||
|
||||
return (
|
||||
<section id="tools-stack" className="py-24 lg:py-32 relative bg-[#07090E]/80 border-t border-b border-white/[0.06] overflow-hidden scroll-mt-20">
|
||||
{/* Ambient background glow accents */}
|
||||
<div className="absolute top-1/4 -left-48 w-96 h-96 bg-cyan-500/10 rounded-full blur-3xl pointer-events-none" />
|
||||
<div className="absolute bottom-1/4 -right-48 w-96 h-96 bg-purple-500/10 rounded-full blur-3xl pointer-events-none" />
|
||||
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
|
||||
{/* Section Header */}
|
||||
<div className="text-center max-w-3xl mx-auto mb-16 sm:mb-20">
|
||||
<div className="inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-cyan-950/50 border border-cyan-500/30 text-xs font-mono text-cyan-400 mb-4 shadow-sm">
|
||||
<Zap className="w-3.5 h-3.5 text-cyan-400" />
|
||||
<span>NEURAL VISION ENGINE SUITE</span>
|
||||
</div>
|
||||
<h2 className="text-3xl sm:text-4xl lg:text-5xl font-display font-extrabold text-white tracking-tight mb-5">
|
||||
Vertical <span className="text-transparent bg-clip-text bg-gradient-to-r from-cyan-400 via-teal-300 to-purple-400">Tools Stack</span>
|
||||
</h2>
|
||||
<p className="text-base sm:text-lg text-slate-400 leading-relaxed">
|
||||
Commercial-grade neural models organized by creative discipline. Test sub-millimeter pore retouching, alpha matting, and 4K super-resolution directly in your browser with zero watermark constraints.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Mobile Category Quick Rail */}
|
||||
<div className="lg:hidden flex items-center gap-2 overflow-x-auto pb-4 mb-8 no-scrollbar">
|
||||
<button
|
||||
onClick={() => setSelectedCategory('all')}
|
||||
className={`px-4 py-2 rounded-xl text-xs font-semibold whitespace-nowrap transition-all ${
|
||||
selectedCategory === 'all'
|
||||
? 'bg-cyan-500 text-black shadow-lg shadow-cyan-500/25 font-bold'
|
||||
: 'bg-white/[0.05] text-slate-300 border border-white/[0.08]'
|
||||
}`}
|
||||
>
|
||||
All Categories ({tools.length})
|
||||
</button>
|
||||
{categories.map((cat) => {
|
||||
const catTools = tools.filter((t) => t.category === cat.slug);
|
||||
const active = selectedCategory === cat.slug;
|
||||
return (
|
||||
<button
|
||||
key={cat.slug}
|
||||
onClick={() => setSelectedCategory(cat.slug)}
|
||||
className={`px-4 py-2 rounded-xl text-xs font-semibold whitespace-nowrap transition-all ${
|
||||
active
|
||||
? 'bg-cyan-500 text-black shadow-lg shadow-cyan-500/25 font-bold'
|
||||
: 'bg-white/[0.05] text-slate-300 border border-white/[0.08]'
|
||||
}`}
|
||||
>
|
||||
{resolveLocalised(cat.name, locale)} ({catTools.length})
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Main Grid: Sticky Category Sidebar (Desktop) + Vertical Stack Cards */}
|
||||
<div className="grid grid-cols-1 lg:grid-cols-12 gap-10 lg:gap-12 items-start">
|
||||
{/* Left Column: Sticky Category Selector Rail */}
|
||||
<div className="hidden lg:block lg:col-span-4 sticky top-28 space-y-4">
|
||||
<div className="glass-card rounded-3xl p-6 border border-white/[0.08] bg-[#0B0F17]/70 backdrop-blur-xl">
|
||||
<div className="flex items-center justify-between pb-4 border-b border-white/[0.08] mb-4">
|
||||
<span className="text-xs font-mono uppercase tracking-wider text-slate-400">Categories</span>
|
||||
<span className="text-xs font-mono text-cyan-400">{tools.length} Vision Tools</span>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<button
|
||||
onClick={() => setSelectedCategory('all')}
|
||||
className={`w-full flex items-center justify-between px-4 py-3 rounded-2xl text-left text-xs font-bold transition-all duration-200 ${
|
||||
selectedCategory === 'all'
|
||||
? 'bg-gradient-to-r from-cyan-500/20 to-purple-500/10 text-cyan-300 border border-cyan-500/40 shadow-sm'
|
||||
: 'text-slate-400 hover:text-white hover:bg-white/[0.04]'
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-center gap-3">
|
||||
<Layers className="w-4 h-4 text-cyan-400" />
|
||||
<span>All Neural Tools</span>
|
||||
</div>
|
||||
<span className="text-[11px] font-mono px-2 py-0.5 rounded-full bg-white/[0.08] text-slate-300">
|
||||
{tools.length}
|
||||
</span>
|
||||
</button>
|
||||
|
||||
{categories.map((cat) => {
|
||||
const catTools = tools.filter((t) => t.category === cat.slug);
|
||||
const active = selectedCategory === cat.slug;
|
||||
const Icon = ICON_MAP[cat.icon || 'Sparkles'] || Sparkles;
|
||||
|
||||
return (
|
||||
<button
|
||||
key={cat.slug}
|
||||
onClick={() => setSelectedCategory(cat.slug)}
|
||||
className={`w-full flex items-center justify-between px-4 py-3 rounded-2xl text-left text-xs font-bold transition-all duration-200 ${
|
||||
active
|
||||
? 'bg-gradient-to-r from-cyan-500/20 to-purple-500/10 text-cyan-300 border border-cyan-500/40 shadow-sm'
|
||||
: 'text-slate-400 hover:text-white hover:bg-white/[0.04]'
|
||||
}`}
|
||||
>
|
||||
<div className="flex items-center gap-3">
|
||||
<Icon className={`w-4 h-4 ${active ? 'text-cyan-400' : 'text-slate-500'}`} />
|
||||
<div>
|
||||
<p className="leading-tight">{resolveLocalised(cat.name, locale)}</p>
|
||||
</div>
|
||||
</div>
|
||||
<span className="text-[11px] font-mono px-2 py-0.5 rounded-full bg-white/[0.08] text-slate-400">
|
||||
{catTools.length}
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* Zero-Storage Guarantee Chip */}
|
||||
<div className="mt-6 pt-5 border-t border-white/[0.08] space-y-3">
|
||||
<div className="flex items-center gap-2 text-xs text-emerald-400 font-mono">
|
||||
<ShieldCheck className="w-4 h-4 text-emerald-400 shrink-0" />
|
||||
<span>Zero-Storage Guaranteed</span>
|
||||
</div>
|
||||
<p className="text-[11px] text-slate-400 leading-relaxed">
|
||||
Images stream through memory buffers and are never saved to disk or utilized for model training.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Mobile App Promotion Pill */}
|
||||
<div className="p-5 rounded-3xl bg-gradient-to-br from-purple-950/30 to-cyan-950/30 border border-purple-500/20 text-xs space-y-2">
|
||||
<div className="flex items-center gap-2 text-purple-300 font-bold">
|
||||
<Smartphone className="w-4 h-4 text-purple-400" />
|
||||
<span>Batch Processing & Offline</span>
|
||||
</div>
|
||||
<p className="text-slate-400 text-[11px] leading-relaxed">
|
||||
Need batch editing or offline neural execution? Use our iOS and Android native apps with coupon code <code className="text-cyan-300 font-mono bg-cyan-950/60 px-1 py-0.5 rounded">TRYWEB50</code>.
|
||||
</p>
|
||||
<Link
|
||||
href="/apps"
|
||||
className="inline-flex items-center gap-1.5 text-cyan-400 hover:text-cyan-300 font-semibold text-xs pt-1"
|
||||
>
|
||||
<span>Explore Mobile Apps Suite</span>
|
||||
<ArrowRight className="w-3.5 h-3.5" />
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Right Column: Vertical Stack of Tool Cards */}
|
||||
<div className="lg:col-span-8 space-y-12">
|
||||
{filteredCategories.map((category) => {
|
||||
const catTools = tools.filter((t) => t.category === category.slug);
|
||||
if (catTools.length === 0) return null;
|
||||
const Icon = ICON_MAP[category.icon || 'Sparkles'] || Sparkles;
|
||||
|
||||
return (
|
||||
<div key={category.slug} className="space-y-6">
|
||||
{/* Category Section Header */}
|
||||
<div className="flex items-center justify-between pb-3 border-b border-white/[0.08]">
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="w-8 h-8 rounded-xl bg-cyan-500/10 border border-cyan-500/20 flex items-center justify-center text-cyan-400">
|
||||
<Icon className="w-4 h-4" />
|
||||
</div>
|
||||
<div>
|
||||
<h3 className="text-lg font-display font-bold text-white">
|
||||
{resolveLocalised(category.name, locale)}
|
||||
</h3>
|
||||
<p className="text-xs text-slate-400">
|
||||
{resolveLocalised(category.description, locale)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<span className="text-xs font-mono text-cyan-400 bg-cyan-950/40 border border-cyan-500/20 px-2.5 py-1 rounded-full">
|
||||
{catTools.length} {catTools.length === 1 ? 'Tool' : 'Tools'}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* Vertical Cards for This Category */}
|
||||
<div className="space-y-8">
|
||||
{catTools.map((tool) => {
|
||||
const badgeInfo = MODEL_BADGES[tool.id] || {
|
||||
model: 'Neural Vision v2.0',
|
||||
latency: '< 450ms',
|
||||
chip: 'Commercial Precision',
|
||||
};
|
||||
const example = tool.content?.examples?.[0] || {
|
||||
before: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=800&auto=format&fit=crop&q=80',
|
||||
after: 'https://images.unsplash.com/photo-1517841905240-472988babdf9?w=800&auto=format&fit=crop&q=80',
|
||||
caption: 'Interactive Before/After Preview',
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
key={tool.id}
|
||||
className="glass-card rounded-3xl p-6 sm:p-8 border border-white/[0.08] hover:border-cyan-500/30 transition-all duration-300 relative group"
|
||||
>
|
||||
{/* Top Metadata Row */}
|
||||
<div className="flex flex-wrap items-center justify-between gap-3 mb-6">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
{/* Neural Model Tag */}
|
||||
<span className="inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-cyan-950/50 border border-cyan-500/30 text-cyan-300 font-mono text-[11px]">
|
||||
<Cpu className="w-3 h-3 text-cyan-400" />
|
||||
<span>{badgeInfo.model}</span>
|
||||
</span>
|
||||
{/* Specific Capability Chip */}
|
||||
<span className="px-2.5 py-1 rounded-full bg-white/[0.04] border border-white/[0.08] text-slate-300 text-[11px] font-mono">
|
||||
{badgeInfo.chip}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* Latency & Stream Metric */}
|
||||
<div className="flex items-center gap-1.5 text-[11px] font-mono text-emerald-400">
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse" />
|
||||
<span>{badgeInfo.latency} Stream</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Card Content Grid: Details on Left, Interactive Slider on Right */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-12 gap-6 items-center">
|
||||
{/* Left Details */}
|
||||
<div className="md:col-span-6 space-y-4">
|
||||
<h4 className="text-xl sm:text-2xl font-display font-extrabold text-white group-hover:text-cyan-300 transition-colors">
|
||||
{resolveLocalised(tool.name, locale)}
|
||||
</h4>
|
||||
<p className="text-xs sm:text-sm text-slate-400 leading-relaxed">
|
||||
{resolveLocalised(tool.summary, locale)}
|
||||
</p>
|
||||
|
||||
{/* Features List */}
|
||||
<div className="space-y-2 pt-2">
|
||||
<div className="flex items-center gap-2 text-xs text-slate-300">
|
||||
<CheckCircle2 className="w-3.5 h-3.5 text-cyan-400 shrink-0" />
|
||||
<span>Zero photo retention with RAM buffer pipeline</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 text-xs text-slate-300">
|
||||
<CheckCircle2 className="w-3.5 h-3.5 text-cyan-400 shrink-0" />
|
||||
<span>Full HD lossless output with no watermark</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 text-xs text-slate-300">
|
||||
<CheckCircle2 className="w-3.5 h-3.5 text-cyan-400 shrink-0" />
|
||||
<span>Direct handoff to native mobile application</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Action Buttons */}
|
||||
<div className="pt-4 flex flex-wrap items-center gap-3">
|
||||
<Link
|
||||
href={`/tools/${tool.slug}`}
|
||||
className="inline-flex items-center gap-2 px-5 py-2.5 rounded-xl text-xs font-bold text-black bg-gradient-to-r from-cyan-400 to-teal-300 hover:from-cyan-300 hover:to-teal-200 shadow-lg shadow-cyan-500/25 transition-all duration-200 hover:-translate-y-0.5 active:translate-y-0"
|
||||
>
|
||||
<span>Launch Tool Online</span>
|
||||
<ArrowRight className="w-3.5 h-3.5" />
|
||||
</Link>
|
||||
|
||||
<Link
|
||||
href={`/apps/${tool.homeApp}`}
|
||||
className="inline-flex items-center gap-1.5 px-4 py-2.5 rounded-xl text-xs font-semibold text-slate-300 bg-white/[0.04] border border-white/[0.08] hover:bg-white/[0.08] hover:text-white transition-colors"
|
||||
>
|
||||
<Smartphone className="w-3.5 h-3.5 text-cyan-400" />
|
||||
<span>Native App</span>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Right: Interactive Before/After Comparison Slider */}
|
||||
<div className="md:col-span-6">
|
||||
<BeforeAfterSlider
|
||||
beforeUrl={example.before}
|
||||
afterUrl={example.after}
|
||||
beforeLabel="Raw Input"
|
||||
afterLabel="CRE Result"
|
||||
aspectRatio="aspect-[4/3]"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user