feat: rebrand to CRE Innovations, enhance ultra-smooth UI and mobile responsiveness
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import React, { useState, useMemo } from 'react';
|
||||
import Link from 'next/link';
|
||||
import { Search, Sparkles, ArrowRight, Wand2, Scissors, Smile, Palette } from 'lucide-react';
|
||||
import { Search, Sparkles, ArrowRight, Wand2, Scissors, Smile, Palette, RefreshCcw } from 'lucide-react';
|
||||
import { ToolItem, CategoryItem, AppItem, resolveLocalised } from '@/types';
|
||||
|
||||
interface ToolGridSectionProps {
|
||||
@@ -53,19 +53,34 @@ export function ToolGridSection({
|
||||
return list;
|
||||
}, [tools, selectedCategory, searchQuery, limit, locale]);
|
||||
|
||||
const getCategoryIcon = (catId: string) => {
|
||||
switch (catId) {
|
||||
case 'portrait-retouch':
|
||||
return <Smile className="w-4 h-4 text-rose-500" />;
|
||||
case 'restoration':
|
||||
return <RefreshCcw className="w-4 h-4 text-amber-500" />;
|
||||
case 'background-cutout':
|
||||
return <Scissors className="w-4 h-4 text-emerald-500" />;
|
||||
case 'creative-art':
|
||||
return <Palette className="w-4 h-4 text-purple-500" />;
|
||||
default:
|
||||
return <Wand2 className="w-4 h-4 text-blue-500" />;
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<section className="py-12 lg:py-16">
|
||||
<section className="py-12 sm:py-16 lg:py-20">
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
{/* Section Heading */}
|
||||
{(title || subtitle) && (
|
||||
<div className="text-center max-w-3xl mx-auto mb-10 space-y-3">
|
||||
{title && (
|
||||
<h2 className="text-3xl sm:text-4xl font-bold text-slate-900 dark:text-white">
|
||||
<h2 className="text-3xl sm:text-4xl font-black text-slate-900 dark:text-white tracking-tight">
|
||||
{resolveLocalised(title, locale)}
|
||||
</h2>
|
||||
)}
|
||||
{subtitle && (
|
||||
<p className="text-base text-slate-600 dark:text-slate-400">
|
||||
<p className="text-sm sm:text-base text-slate-600 dark:text-slate-400">
|
||||
{resolveLocalised(subtitle, locale)}
|
||||
</p>
|
||||
)}
|
||||
@@ -74,14 +89,14 @@ export function ToolGridSection({
|
||||
|
||||
{/* Search & Filters */}
|
||||
{(showSearch || showCategoryFilter) && (
|
||||
<div className="mb-8 flex flex-col md:flex-row items-center justify-between gap-4">
|
||||
<div className="mb-10 flex flex-col md:flex-row items-stretch md:items-center justify-between gap-4">
|
||||
{showCategoryFilter && categories.length > 0 && (
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<button
|
||||
onClick={() => setSelectedCategory('all')}
|
||||
className={`px-3.5 py-1.5 rounded-full text-xs font-semibold transition-colors ${
|
||||
className={`px-4 py-2 rounded-xl text-xs font-bold transition-all duration-200 ${
|
||||
selectedCategory === 'all'
|
||||
? 'bg-blue-600 text-white'
|
||||
? 'bg-blue-600 text-white shadow-md shadow-blue-500/25 scale-105'
|
||||
: 'bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-700'
|
||||
}`}
|
||||
>
|
||||
@@ -91,27 +106,28 @@ export function ToolGridSection({
|
||||
<button
|
||||
key={cat.id}
|
||||
onClick={() => setSelectedCategory(cat.id)}
|
||||
className={`px-3.5 py-1.5 rounded-full text-xs font-semibold transition-colors ${
|
||||
className={`flex items-center space-x-1.5 px-3.5 py-2 rounded-xl text-xs font-bold transition-all duration-200 ${
|
||||
selectedCategory === cat.id
|
||||
? 'bg-blue-600 text-white'
|
||||
? 'bg-blue-600 text-white shadow-md shadow-blue-500/25 scale-105'
|
||||
: 'bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-700'
|
||||
}`}
|
||||
>
|
||||
{resolveLocalised(cat.name, locale)}
|
||||
<span>{getCategoryIcon(cat.id)}</span>
|
||||
<span>{resolveLocalised(cat.name, locale)}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{showSearch && (
|
||||
<div className="relative w-full md:w-72">
|
||||
<Search className="w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-slate-400" />
|
||||
<div className="relative w-full md:w-80">
|
||||
<Search className="w-4 h-4 absolute left-3.5 top-1/2 -translate-y-1/2 text-slate-400" />
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Search AI photo tools..."
|
||||
value={searchQuery}
|
||||
onChange={(e) => setSearchQuery(e.target.value)}
|
||||
className="w-full pl-9 pr-4 py-2 rounded-xl text-sm border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 text-slate-900 dark:text-white placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500"
|
||||
className="w-full pl-10 pr-4 py-2.5 rounded-2xl text-xs sm:text-sm border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 text-slate-900 dark:text-white placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 shadow-sm"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -119,26 +135,26 @@ export function ToolGridSection({
|
||||
)}
|
||||
|
||||
{/* Tools Cards Grid */}
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6">
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
|
||||
{filteredTools.map((tool) => {
|
||||
const homeApp = appMap.get(tool.homeApp);
|
||||
return (
|
||||
<div
|
||||
key={tool.id}
|
||||
className="group relative bg-white dark:bg-slate-900 rounded-2xl p-6 border border-slate-200 dark:border-slate-800 shadow-sm hover:shadow-xl hover:border-blue-500/50 transition-all flex flex-col justify-between"
|
||||
className="group relative bg-white dark:bg-slate-900/90 rounded-3xl p-6 border border-slate-200/80 dark:border-slate-800/80 shadow-sm hover:shadow-2xl hover:shadow-blue-500/10 hover:border-blue-500/40 hover:-translate-y-1 transition-all duration-300 flex flex-col justify-between"
|
||||
>
|
||||
<div>
|
||||
{/* Category Tag & Icon */}
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<span className="text-[11px] font-semibold tracking-wider uppercase text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-950/60 px-2.5 py-1 rounded-md">
|
||||
<span className="text-[11px] font-bold tracking-wider uppercase text-blue-600 dark:text-cyan-400 bg-blue-50 dark:bg-blue-950/60 px-3 py-1 rounded-lg border border-blue-100 dark:border-blue-900/40">
|
||||
{tool.category}
|
||||
</span>
|
||||
<div className="w-8 h-8 rounded-lg bg-slate-100 dark:bg-slate-800 flex items-center justify-center text-slate-600 dark:text-slate-300 group-hover:scale-110 group-hover:text-blue-600 transition-all">
|
||||
<Wand2 className="w-4 h-4" />
|
||||
<div className="w-9 h-9 rounded-xl bg-slate-100 dark:bg-slate-800 flex items-center justify-center text-slate-600 dark:text-slate-300 group-hover:scale-110 group-hover:bg-blue-50 dark:group-hover:bg-blue-950 group-hover:text-blue-600 transition-all duration-200">
|
||||
{getCategoryIcon(tool.category)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 className="text-lg font-bold text-slate-900 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors">
|
||||
<h3 className="text-lg font-bold text-slate-900 dark:text-white group-hover:text-blue-600 dark:group-hover:text-cyan-400 transition-colors">
|
||||
{resolveLocalised(tool.name, locale)}
|
||||
</h3>
|
||||
|
||||
@@ -148,11 +164,10 @@ export function ToolGridSection({
|
||||
</div>
|
||||
|
||||
<div className="mt-6 pt-4 border-t border-slate-100 dark:border-slate-800/80 space-y-3">
|
||||
{/* Home App Attribution (PRD §1.2, §9 APP-01) */}
|
||||
{homeApp && (
|
||||
<div className="text-[11px] text-slate-500 dark:text-slate-400 flex items-center justify-between">
|
||||
<span>Home App:</span>
|
||||
<span className="font-semibold text-slate-700 dark:text-slate-300">
|
||||
<span className="font-medium">Home App:</span>
|
||||
<span className="font-bold text-slate-700 dark:text-slate-300 truncate max-w-[140px]">
|
||||
{resolveLocalised(homeApp.name, locale)}
|
||||
</span>
|
||||
</div>
|
||||
@@ -160,10 +175,10 @@ export function ToolGridSection({
|
||||
|
||||
<Link
|
||||
href={`/tools/${tool.slug}`}
|
||||
className="w-full inline-flex items-center justify-center space-x-2 py-2.5 rounded-xl text-xs font-semibold text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-950/40 hover:bg-blue-600 hover:text-white dark:hover:bg-blue-600 dark:hover:text-white transition-all shadow-sm"
|
||||
className="w-full inline-flex items-center justify-center space-x-2 py-3 rounded-2xl text-xs font-bold text-blue-600 dark:text-cyan-400 bg-blue-50 dark:bg-blue-950/40 hover:bg-blue-600 hover:text-white dark:hover:bg-blue-600 dark:hover:text-white transition-all duration-200 shadow-sm group-hover:shadow-md"
|
||||
>
|
||||
<span>Try Free Online</span>
|
||||
<ArrowRight className="w-3.5 h-3.5" />
|
||||
<ArrowRight className="w-3.5 h-3.5 group-hover:translate-x-1 transition-transform" />
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
@@ -172,8 +187,9 @@ export function ToolGridSection({
|
||||
</div>
|
||||
|
||||
{filteredTools.length === 0 && (
|
||||
<div className="text-center py-12 text-slate-500 dark:text-slate-400">
|
||||
No photo tools found matching your filter.
|
||||
<div className="text-center py-16 text-slate-500 dark:text-slate-400 space-y-2">
|
||||
<p className="font-bold">No photo tools found matching "{searchQuery}"</p>
|
||||
<p className="text-xs">Try searching for "blemish", "background", "photo", or clear filters.</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user