190 lines
8.4 KiB
TypeScript
190 lines
8.4 KiB
TypeScript
'use client';
|
|
|
|
import React from 'react';
|
|
import Link from 'next/link';
|
|
import { Smartphone, Star, ArrowRight, Download, Sparkles, CheckCircle2 } from 'lucide-react';
|
|
import { TextAnimate } from '@/components/magicui/text-animate';
|
|
import { AppItem, resolveLocalised } from '@/types';
|
|
|
|
interface RecommendedAppsSectionProps {
|
|
title?: string;
|
|
badge?: string;
|
|
subtitle?: string;
|
|
apps?: AppItem[];
|
|
locale?: string;
|
|
}
|
|
|
|
const DEFAULT_RECOMMENDED_APPS = [
|
|
{
|
|
id: 'app-portrait',
|
|
slug: 'portrait-app',
|
|
name: 'Portrait Studio AI',
|
|
tagline: 'Sub-pore facial retouching & blemish cleaner',
|
|
category: 'Portrait & Beauty',
|
|
rating: '4.9',
|
|
reviews: '48K+ reviews',
|
|
gradient: 'from-blue-600 to-indigo-600',
|
|
platforms: ['iOS', 'Android'],
|
|
features: ['Real-time 4K export', 'Sub-pore texture', '50 Free credits on install'],
|
|
storeUrl: '/apps/portrait-app',
|
|
},
|
|
{
|
|
id: 'app-enhancer',
|
|
slug: 'photo-enhancer-pro',
|
|
name: 'Enhance Ultra AI',
|
|
tagline: 'Generative 4K super-resolution & restoration',
|
|
category: 'Super Resolution',
|
|
rating: '4.9',
|
|
reviews: '62K+ reviews',
|
|
gradient: 'from-purple-600 to-indigo-600',
|
|
platforms: ['iOS', 'Android'],
|
|
features: ['Generative eye reconstruction', 'Old archival restore', 'No compression artifacts'],
|
|
storeUrl: '/apps/photo-enhancer-pro',
|
|
},
|
|
{
|
|
id: 'app-cutout',
|
|
slug: 'bg-cleaner-app',
|
|
name: 'Magic Cutout Studio',
|
|
tagline: 'Sub-pixel P3M alpha matting & cutouts',
|
|
category: 'Background Cutout',
|
|
rating: '4.8',
|
|
reviews: '34K+ reviews',
|
|
gradient: 'from-teal-600 to-cyan-600',
|
|
platforms: ['iOS', 'Android'],
|
|
features: ['0.02px edge trim', 'Hair-strand boundary separation', 'E-commerce white studio'],
|
|
storeUrl: '/apps/bg-cleaner-app',
|
|
},
|
|
{
|
|
id: 'app-toonify',
|
|
slug: 'art-studio-app',
|
|
name: 'Toonify & Anime Studio',
|
|
tagline: 'Stylized CartoonGAN illustrations & avatars',
|
|
category: 'Creative Art',
|
|
rating: '4.9',
|
|
reviews: '29K+ reviews',
|
|
gradient: 'from-pink-600 to-rose-600',
|
|
platforms: ['iOS', 'Android'],
|
|
features: ['30+ Anime art styles', 'Dynamic comic shading', 'Instant HD export'],
|
|
storeUrl: '/apps/art-studio-app',
|
|
},
|
|
];
|
|
|
|
export function RecommendedAppsSection({
|
|
title = 'Recommended Mobile Apps',
|
|
badge = 'DEDICATED NATIVE APPS',
|
|
subtitle = 'Get unlimited batch processing, offline inference, and full 4K output on iOS and Android.',
|
|
apps,
|
|
locale = 'en',
|
|
}: RecommendedAppsSectionProps) {
|
|
const displayApps = apps && apps.length > 0 ? apps : DEFAULT_RECOMMENDED_APPS;
|
|
|
|
return (
|
|
<section id="recommended-apps" className="py-14 sm:py-20 px-4 sm:px-6 md:px-8 lg:px-10 bg-[#FAF8F5] relative overflow-hidden border-t border-slate-900/[0.06]">
|
|
{/* Symbolic Elemental Ambient Highlights */}
|
|
<div
|
|
className="absolute inset-0 pointer-events-none -z-10"
|
|
style={{
|
|
background: 'radial-gradient(circle at 10% 20%, rgba(16,185,129,0.06) 0%, transparent 50%), radial-gradient(circle at 90% 80%, rgba(37,99,235,0.06) 0%, transparent 50%)',
|
|
}}
|
|
/>
|
|
<div className="max-w-[1640px] mx-auto space-y-10">
|
|
{/* Section Header with MagicUI TextAnimate */}
|
|
<div className="text-center max-w-3xl mx-auto space-y-4">
|
|
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full text-xs font-mono font-semibold tracking-wider uppercase text-blue-700 bg-blue-50 border border-blue-200">
|
|
<Smartphone className="w-3.5 h-3.5 text-blue-600" />
|
|
<span>{badge}</span>
|
|
</div>
|
|
|
|
<h2 className="text-3xl sm:text-5xl font-display font-extrabold text-slate-900 tracking-tight">
|
|
<TextAnimate animation="slideLeft" by="word">
|
|
{title}
|
|
</TextAnimate>
|
|
</h2>
|
|
|
|
<p className="text-sm sm:text-base text-slate-600 font-sans text-pretty">
|
|
<TextAnimate animation="fadeIn" by="word" delay={0.08}>
|
|
{subtitle}
|
|
</TextAnimate>
|
|
</p>
|
|
</div>
|
|
|
|
{/* 4 App Cards Grid */}
|
|
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 sm:gap-8">
|
|
{displayApps.map((app: any) => {
|
|
const name = typeof app.name === 'string' ? app.name : resolveLocalised(app.name, locale);
|
|
const tagline = typeof app.tagline === 'string' ? app.tagline : resolveLocalised(app.tagline, locale);
|
|
const slug = app.slug || app.id;
|
|
const gradient = app.gradient || 'from-blue-600 to-indigo-600';
|
|
const ratingValue = typeof app.rating === 'object' && app.rating !== null ? app.rating.value : app.rating || '4.9';
|
|
|
|
return (
|
|
<div
|
|
key={slug}
|
|
className="group relative flex flex-col justify-between rounded-3xl bg-white border border-slate-200/90 p-7 shadow-cream-sm transition-[transform,border-color] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] hover:-translate-y-1 hover:border-blue-400/60 will-change-transform transform-gpu"
|
|
>
|
|
{/* GPU Shadow Elevation Layer */}
|
|
<div
|
|
className="absolute -inset-px rounded-3xl shadow-cream-lg opacity-0 group-hover:opacity-100 transition-opacity duration-500 ease-[cubic-bezier(0.16,1,0.3,1)] pointer-events-none"
|
|
aria-hidden="true"
|
|
/>
|
|
<div>
|
|
{/* Top App Icon & Rating */}
|
|
<div className="flex items-center justify-between mb-5">
|
|
<div className={`w-12 h-12 rounded-2xl bg-gradient-to-br ${gradient} flex items-center justify-center text-white shadow-md shadow-blue-500/20 group-hover:scale-110 transition-transform`}>
|
|
<Smartphone className="w-6 h-6 text-white" />
|
|
</div>
|
|
<div className="flex items-center gap-1 px-3 py-1 rounded-full bg-amber-50 border border-amber-200/80 text-amber-800 text-xs font-bold">
|
|
<Star className="w-3.5 h-3.5 fill-amber-400 text-amber-400" />
|
|
<span>{ratingValue}</span>
|
|
</div>
|
|
</div>
|
|
|
|
{/* Name & Tagline */}
|
|
<h3 className="text-lg font-display font-bold text-slate-900 group-hover:text-blue-600 transition-colors">
|
|
{name}
|
|
</h3>
|
|
<p className="mt-1.5 text-xs text-slate-500 leading-relaxed min-h-[34px]">
|
|
{tagline}
|
|
</p>
|
|
|
|
{/* Platforms & Free bonus badge */}
|
|
<div className="mt-4 flex flex-wrap items-center gap-2 text-[11px] font-mono text-slate-600">
|
|
<span className="px-2.5 py-0.5 rounded-md bg-slate-100 font-semibold text-slate-700">iOS</span>
|
|
<span className="px-2.5 py-0.5 rounded-md bg-slate-100 font-semibold text-slate-700">Android</span>
|
|
<span className="px-2.5 py-0.5 rounded-md bg-emerald-50 text-emerald-700 font-semibold border border-emerald-200">
|
|
50 Credits Bonus
|
|
</span>
|
|
</div>
|
|
|
|
{/* Bullet Highlights */}
|
|
{app.features && (
|
|
<ul className="mt-5 space-y-2 text-xs text-slate-600 border-t border-slate-100 pt-4">
|
|
{app.features.map((feat: string, fIdx: number) => (
|
|
<li key={fIdx} className="flex items-center gap-2">
|
|
<CheckCircle2 className="w-3.5 h-3.5 text-blue-600 flex-shrink-0" />
|
|
<span>{feat}</span>
|
|
</li>
|
|
))}
|
|
</ul>
|
|
)}
|
|
</div>
|
|
|
|
{/* Bottom Action Button */}
|
|
<div className="pt-6 mt-5 border-t border-slate-100">
|
|
<Link
|
|
href={`/apps/${slug}`}
|
|
className="w-full flex items-center justify-center gap-2 py-3.5 rounded-xl text-xs font-bold text-white bg-slate-950 group-hover:bg-blue-600 transition-colors duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] shadow-sm"
|
|
>
|
|
<span>Get App & QR Code</span>
|
|
<ArrowRight className="w-3.5 h-3.5 transition-transform duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] group-hover:translate-x-1" />
|
|
</Link>
|
|
</div>
|
|
</div>
|
|
);
|
|
})}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
);
|
|
}
|