feat: restore QR code handoff, clickable app store buttons, and tool studio on dedicated tool page

This commit is contained in:
2026-11-05 10:26:19 +05:30
parent 51afbf573b
commit 6300cd9cc9
8 changed files with 534 additions and 75 deletions
+198 -58
View File
@@ -2,7 +2,18 @@
import React, { useState, useEffect } from 'react';
import QRCode from 'qrcode';
import { Smartphone, QrCode, Copy, Check, Gift, ExternalLink } from 'lucide-react';
import {
Smartphone,
QrCode,
Copy,
Check,
Gift,
ExternalLink,
Sparkles,
Zap,
ShieldCheck,
Star
} from 'lucide-react';
import { AppItem, ToolItem, resolveLocalised } from '@/types';
interface AppHandoffSectionProps {
@@ -21,22 +32,31 @@ export function AppHandoffSection({
showQr = true,
}: AppHandoffSectionProps) {
const [qrDataUrl, setQrDataUrl] = useState<string>('');
const [copied, setCopied] = useState(false);
const [copiedPromo, setCopiedPromo] = useState(false);
const [copiedLink, setCopiedLink] = useState(false);
const [origin, setOrigin] = useState<string>('');
useEffect(() => {
if (typeof window !== 'undefined') {
setOrigin(window.location.origin);
}
}, []);
if (!app) return null;
const bonusCode = app.welcomeBonus?.code || 'TRYWEB50';
const baseHost = origin || 'http://localhost:3000';
const targetUrl = tool
? `http://localhost:3000/go/${tool.slug}/${app.slug}?promo=${bonusCode}`
: `http://localhost:3000/apps/${app.slug}?promo=${bonusCode}`;
? `${baseHost}/go/${tool.slug}/${app.slug}?promo=${bonusCode}`
: `${baseHost}/apps/${app.slug}?promo=${bonusCode}`;
useEffect(() => {
if (showQr) {
QRCode.toDataURL(targetUrl, {
width: 200,
width: 240,
margin: 1,
color: {
dark: '#0f172a',
dark: '#020617',
light: '#ffffff',
},
})
@@ -47,41 +67,100 @@ export function AppHandoffSection({
const copyPromo = () => {
navigator.clipboard.writeText(bonusCode);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
setCopiedPromo(true);
setTimeout(() => setCopiedPromo(false), 2000);
};
const copyTargetUrl = () => {
navigator.clipboard.writeText(targetUrl);
setCopiedLink(true);
setTimeout(() => setCopiedLink(false), 2000);
};
const appName = resolveLocalised(app.name, locale);
const appTagline = resolveLocalised(app.tagline, locale);
return (
<section className="py-20 sm:py-28 bg-[#FAF8F5] border-t border-slate-900/[0.08] relative overflow-hidden">
<section
id="app-handoff"
className="py-16 sm:py-24 bg-gradient-to-b from-[#FAF8F5] via-white to-[#FAF8F5] border-t border-slate-900/[0.08] relative overflow-hidden scroll-mt-24"
>
{/* Ambient background glow */}
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-7xl h-96 bg-gradient-to-r from-blue-500/[0.04] via-indigo-500/[0.05] to-teal-500/[0.04] blur-3xl pointer-events-none -z-10" />
<div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
<div className="bg-white rounded-3xl p-8 sm:p-12 border border-slate-900/[0.08] shadow-cream-md flex flex-col md:flex-row items-center justify-between gap-8 sm:gap-12">
{/* Left Column: Copy & Store CTA */}
<div className="space-y-5 max-w-xl">
<div className="inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-blue-50 border border-blue-200 text-xs font-mono font-semibold text-blue-700">
<Smartphone className="w-3.5 h-3.5 text-blue-600" />
<span>NATIVE IOS & ANDROID APPS</span>
<div className="bg-white rounded-[2.5rem] p-8 sm:p-12 lg:p-14 border border-slate-900/[0.09] shadow-cinematic-3d flex flex-col lg:flex-row items-center justify-between gap-10 lg:gap-14">
{/* Left Column: Copy, Bonus & Clickable Store Buttons */}
<div className="space-y-6 max-w-xl">
{/* Header Badge */}
<div className="flex flex-wrap items-center gap-2.5">
<span className="inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-blue-50 border border-blue-200/80 text-xs font-mono font-bold text-blue-700 shadow-2xs">
<Smartphone className="w-3.5 h-3.5 text-blue-600" />
<span>NATIVE IOS & ANDROID APP</span>
</span>
{app.rating && (
<span className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-amber-50 border border-amber-200 text-xs font-bold text-amber-800 shadow-2xs">
<Star className="w-3.5 h-3.5 fill-amber-400 text-amber-400" />
<span>{app.rating.value}</span>
<span className="text-[11px] font-mono text-amber-700 font-normal">
({(app.rating.count / 1000).toFixed(0)}k+ creators)
</span>
</span>
)}
</div>
<h3 className="text-2xl sm:text-3xl lg:text-4xl font-display font-black text-slate-900 tracking-tight">
{tool
? `Continue in ${resolveLocalised(app.name, locale)} with 4K Lossless Export`
: `Download ${resolveLocalised(app.name, locale)}`}
</h3>
{/* Main Headline */}
<div>
<h2 className="text-2xl sm:text-3xl lg:text-4xl font-display font-black text-slate-900 tracking-tight leading-snug">
{tool
? `Continue in ${appName} with 4K Lossless Export`
: `Download ${appName}`}
</h2>
<p className="mt-2 text-xs sm:text-sm text-slate-600 font-normal leading-relaxed">
Experience zero-latency hardware-accelerated neural processing, batch photoshoot enhancement, fine-tuning sliders, and uncompressed 4K export directly on your phone.
</p>
</div>
<p className="text-xs sm:text-sm text-slate-600 leading-relaxed font-normal">
Experience zero-latency hardware-accelerated neural processing, batch photoshoot enhancement, and professional fine-tuning sliders on your phone.
</p>
{/* Key Feature Perks List */}
<div className="grid grid-cols-1 sm:grid-cols-2 gap-2.5 pt-1 text-xs text-slate-700">
<div className="flex items-center gap-2">
<div className="w-5 h-5 rounded-full bg-emerald-50 border border-emerald-200 flex items-center justify-center shrink-0">
<Check className="w-3 h-3 text-emerald-600" />
</div>
<span className="font-medium">4K Lossless Uncompressed Export</span>
</div>
<div className="flex items-center gap-2">
<div className="w-5 h-5 rounded-full bg-blue-50 border border-blue-200 flex items-center justify-center shrink-0">
<Zap className="w-3 h-3 text-blue-600" />
</div>
<span className="font-medium">On-Device Neural Engine Acceleration</span>
</div>
<div className="flex items-center gap-2">
<div className="w-5 h-5 rounded-full bg-indigo-50 border border-indigo-200 flex items-center justify-center shrink-0">
<Sparkles className="w-3 h-3 text-indigo-600" />
</div>
<span className="font-medium">Batch Multi-Photo Enhancement</span>
</div>
<div className="flex items-center gap-2">
<div className="w-5 h-5 rounded-full bg-emerald-50 border border-emerald-200 flex items-center justify-center shrink-0">
<ShieldCheck className="w-3 h-3 text-emerald-600" />
</div>
<span className="font-medium">Offline Private Mode (100% Private)</span>
</div>
</div>
{/* Welcome Bonus Promo Banner */}
{showBonus && (
<div className="p-4 sm:p-5 rounded-2xl bg-amber-50/70 border border-amber-200 flex items-center justify-between shadow-sm">
<div className="p-4 sm:p-5 rounded-2xl bg-gradient-to-r from-amber-500/10 via-amber-400/5 to-amber-500/10 border border-amber-300/80 flex items-center justify-between gap-4 shadow-sm">
<div className="flex items-center gap-3.5">
<div className="w-11 h-11 rounded-xl bg-amber-100 border border-amber-300 flex items-center justify-center text-amber-700 shrink-0">
<div className="w-11 h-11 rounded-2xl bg-amber-100 border border-amber-300 flex items-center justify-center text-amber-700 shrink-0 shadow-sm">
<Gift className="w-5 h-5" />
</div>
<div>
<p className="text-xs sm:text-sm font-display font-bold text-slate-900">
{app.welcomeBonus?.title || '50 Free HD Export Credits'}
{app.welcomeBonus?.title || '50 Free 4K HD Export Credits'}
</p>
<p className="text-[11px] font-mono text-slate-600">
Claim promo code on first mobile launch
@@ -90,57 +169,118 @@ export function AppHandoffSection({
</div>
<button
type="button"
onClick={copyPromo}
className="inline-flex items-center gap-1.5 px-3.5 py-2 rounded-xl text-xs font-mono font-bold bg-white border border-amber-300 text-amber-900 hover:bg-amber-100 shadow-sm transition-all active:scale-95"
className="inline-flex items-center gap-1.5 px-3.5 py-2 rounded-xl text-xs font-mono font-bold bg-white border border-amber-300 text-amber-900 hover:bg-amber-100 shadow-sm transition-all active:scale-95 shrink-0"
title="Click to copy promo code"
>
{copied ? <Check className="w-3.5 h-3.5 text-emerald-600" /> : <Copy className="w-3.5 h-3.5 text-amber-700" />}
<span>{bonusCode}</span>
{copiedPromo ? <Check className="w-3.5 h-3.5 text-emerald-600" /> : <Copy className="w-3.5 h-3.5 text-amber-700" />}
<span>{copiedPromo ? 'COPIED!' : bonusCode}</span>
</button>
</div>
)}
{/* Store Download Buttons */}
<div className="flex flex-wrap items-center gap-3 pt-2">
<a
href={app.stores.android?.url || '#'}
target="_blank"
rel="noreferrer"
className="px-6 py-3 rounded-full text-xs font-bold text-white bg-slate-900 hover:bg-slate-800 shadow-sm transition-all flex items-center gap-2 hover:scale-105 active:scale-95"
>
<span>Google Play</span>
<ExternalLink className="w-3.5 h-3.5 opacity-60" />
</a>
<a
href={app.stores.ios?.url || '#'}
target="_blank"
rel="noreferrer"
className="px-6 py-3 rounded-full text-xs font-bold text-slate-900 bg-slate-100 border border-slate-300 hover:bg-slate-200 shadow-sm transition-all flex items-center gap-2 hover:scale-105 active:scale-95"
>
<span>Apple App Store</span>
<ExternalLink className="w-3.5 h-3.5 opacity-60" />
</a>
{/* Official Clickable App Store & Google Play Buttons */}
<div className="pt-2 space-y-2">
<p className="text-[11px] font-mono uppercase tracking-wider text-slate-500 font-semibold">
Available now for instant install:
</p>
<div className="flex flex-wrap items-center gap-3.5">
{/* Apple App Store Official Badge Button */}
<a
href={app.stores?.ios?.url || `/go/${tool?.slug || 'explore'}/${app.slug}`}
target="_blank"
rel="noopener noreferrer"
className="px-6 py-3 rounded-2xl text-white bg-slate-950 hover:bg-black border border-slate-800 shadow-md hover:shadow-xl hover:-translate-y-0.5 active:translate-y-0 transition-all flex items-center gap-3.5 group"
>
<svg className="w-6 h-6 fill-white group-hover:scale-110 transition-transform" viewBox="0 0 24 24">
<path d="M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M15.97 6.37c.62-.75 1.04-1.8 0.92-2.87-.9.04-2 .6-2.65 1.36-.58.67-1.08 1.74-.95 2.78 1.01.08 2.05-.52 2.68-1.27z" />
</svg>
<div className="text-left leading-tight">
<span className="block text-[9.5px] uppercase font-mono tracking-wider text-slate-400">Download on the</span>
<span className="block text-sm font-bold text-white font-display">Apple App Store</span>
</div>
<ExternalLink className="w-3.5 h-3.5 text-slate-400 group-hover:text-white transition-colors ml-1" />
</a>
{/* Google Play Store Official Badge Button */}
<a
href={app.stores?.android?.url || `/go/${tool?.slug || 'explore'}/${app.slug}`}
target="_blank"
rel="noopener noreferrer"
className="px-6 py-3 rounded-2xl text-white bg-slate-950 hover:bg-black border border-slate-800 shadow-md hover:shadow-xl hover:-translate-y-0.5 active:translate-y-0 transition-all flex items-center gap-3.5 group"
>
<svg className="w-5 h-5 group-hover:scale-110 transition-transform" viewBox="0 0 24 24">
<path fill="#4285F4" d="M3.609 1.814L13.792 12 3.61 22.186c-.378-.344-.61-.853-.61-1.436V3.25c0-.583.232-1.092.61-1.436z" />
<path fill="#FBBC04" d="M17.156 8.636l-3.364 3.364 3.364 3.364 3.805-2.174c.773-.442.773-1.162 0-1.604l-3.805-2.95z" />
<path fill="#EA4335" d="M13.792 12L3.609 1.814c.31-.282.72-.454 1.171-.454.407 0 .807.14 1.157.34l11.219 6.936-3.364 3.364z" />
<path fill="#34A853" d="M13.792 12l3.364 3.364-11.219 6.936c-.35.2-.75.34-1.157.34-.451 0-.861-.172-1.171-.454L13.792 12z" />
</svg>
<div className="text-left leading-tight">
<span className="block text-[9.5px] uppercase font-mono tracking-wider text-slate-400">GET IT ON</span>
<span className="block text-sm font-bold text-white font-display">Google Play</span>
</div>
<ExternalLink className="w-3.5 h-3.5 text-slate-400 group-hover:text-white transition-colors ml-1" />
</a>
</div>
</div>
{/* Disclaimer */}
<p className="text-[11px] font-mono text-slate-500 italic">
<p className="text-[11px] font-mono text-slate-400 italic">
{resolveLocalised(app.creditsNote, locale, 'Credits and in-app purchases are specific to this app.')}
</p>
</div>
{/* Right Column: QR Code Handoff */}
{/* Right Column: High-Tech Futuristic QR Code Scanner Card */}
{showQr && qrDataUrl && (
<div className="text-center p-6 sm:p-8 rounded-3xl bg-[#FAF8F5] border border-slate-200 shadow-inner shrink-0">
<div className="p-3 bg-white rounded-2xl shadow-md inline-block border border-slate-100">
<div className="relative group text-center p-6 sm:p-8 rounded-3xl bg-slate-950 border border-slate-800 shadow-2xl shrink-0 overflow-hidden w-full sm:w-auto flex flex-col items-center">
{/* Ambient Glow */}
<div className="absolute -inset-1 bg-gradient-to-tr from-blue-600/30 via-indigo-600/25 to-teal-500/30 rounded-3xl blur-2xl opacity-40 group-hover:opacity-70 transition-opacity pointer-events-none" />
{/* Animated Futuristic Laser Reticle Corners */}
<span className="absolute top-3 left-3 w-4 h-4 border-t-2 border-l-2 border-blue-400 rounded-tl-sm pointer-events-none" />
<span className="absolute top-3 right-3 w-4 h-4 border-t-2 border-r-2 border-blue-400 rounded-tr-sm pointer-events-none" />
<span className="absolute bottom-3 left-3 w-4 h-4 border-b-2 border-l-2 border-blue-400 rounded-bl-sm pointer-events-none" />
<span className="absolute bottom-3 right-3 w-4 h-4 border-b-2 border-r-2 border-blue-400 rounded-br-sm pointer-events-none" />
{/* QR Code Presentation Canvas */}
<div className="relative z-10 p-3.5 bg-white rounded-2xl shadow-xl inline-block border border-white/20 transition-transform duration-300 group-hover:scale-[1.02]">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={qrDataUrl} alt="Scan QR code to install app" className="w-36 h-36 sm:w-40 sm:h-40" />
<img
src={qrDataUrl}
alt="Scan QR code to install app"
className="w-40 h-40 sm:w-44 sm:h-44 object-contain rounded-lg"
/>
</div>
<div className="mt-4 flex items-center justify-center gap-2 text-xs font-mono font-bold text-slate-800">
<QrCode className="w-4 h-4 text-blue-600" />
<span>Scan with phone camera</span>
{/* Status Beacon & Camera Target */}
<div className="relative z-10 mt-4 flex items-center justify-center gap-2">
<span className="relative flex h-2 w-2">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-emerald-500"></span>
</span>
<span className="text-xs font-mono font-bold tracking-wider uppercase text-slate-200">
Point Camera to Scan
</span>
</div>
<p className="relative z-10 text-[11px] font-mono text-slate-400 mt-1 max-w-[210px] mx-auto">
Opens app store listing instantly with promo code pre-applied
</p>
{/* Quick Copy Link Action */}
<div className="relative z-10 mt-3 pt-3 border-t border-slate-800/80 w-full flex justify-center">
<button
type="button"
onClick={copyTargetUrl}
className="inline-flex items-center gap-1.5 px-3.5 py-1.5 rounded-lg text-[11px] font-mono text-slate-400 hover:text-white bg-slate-900 border border-slate-800 hover:border-slate-700 transition-colors shadow-2xs active:scale-95"
>
{copiedLink ? <Check className="w-3.5 h-3.5 text-emerald-400" /> : <Copy className="w-3.5 h-3.5" />}
<span>{copiedLink ? 'Copied Link!' : 'Copy Mobile Link'}</span>
</button>
</div>
<p className="text-[10px] font-mono text-slate-500 mt-1">Instant redirect to store listing</p>
</div>
)}
</div>
</div>
</section>
+129 -16
View File
@@ -11,11 +11,16 @@ import {
ShieldCheck,
LockKeyhole,
Check,
Zap
Zap,
SlidersHorizontal,
UploadCloud,
QrCode
} from 'lucide-react';
import { ToolItem, VariantSpec, resolveLocalised } from '@/types';
import { TextAnimate } from '@/components/magicui/text-animate';
import { Particles } from '@/components/magicui/particles';
import { TryItWidget } from './TryItWidget';
import { GrainTransformShowcase } from '@/components/ui/GrainTransformShowcase';
interface HeroSectionProps {
title?: Record<string, string> | string;
@@ -37,9 +42,11 @@ export function HeroSection({
primaryCta,
secondaryCta,
tool,
homeApp,
variants = [],
locale = 'en',
}: HeroSectionProps) {
const [mobileTab, setMobileTab] = useState<'upload' | 'compare'>('upload');
const resolvedBadge = resolveLocalised(badge, locale) || 'Next-Gen Creative Vision AI';
const primaryCtaLabel = resolveLocalised(primaryCta?.label, locale, 'Explore the Magic');
const primaryCtaHref = primaryCta?.href || '#our-tools';
@@ -49,9 +56,18 @@ export function HeroSection({
// Dedicated Tool Detail Page Hero (when viewing a specific tool page like /tools/[slug])
if (tool) {
const appName = homeApp ? resolveLocalised(homeApp.name, locale) : 'Mobile App';
const toolMedia = (tool as any).media;
const primaryExample = tool.content?.examples?.[0] || {
before: toolMedia?.before || `/management/pages/tools/${tool.slug}/media/before.jpg`,
after: toolMedia?.after || `/management/pages/tools/${tool.slug}/media/after.jpg`,
caption: 'Sub-pixel neural transformation details',
};
return (
<section className="relative overflow-hidden bg-white border-b border-slate-900/[0.08] pt-24 sm:pt-28 pb-12 sm:pb-16 px-4 sm:px-6 lg:px-10">
<section className="relative overflow-hidden bg-[#FAF8F5] border-b border-slate-900/[0.08] pt-24 sm:pt-28 pb-14 sm:pb-20 px-4 sm:px-6 lg:px-10">
<div className="max-w-[1640px] mx-auto">
{/* Breadcrumb Navigation */}
<nav className="flex items-center gap-2 text-xs font-mono text-slate-500 mb-8">
<Link href="/" className="hover:text-blue-700 transition-colors">Home</Link>
<span>/</span>
@@ -60,8 +76,9 @@ export function HeroSection({
<span className="text-slate-900 font-semibold">{resolveLocalised(tool.name, locale)}</span>
</nav>
{/* Heading & Subtitle */}
<div className="text-center max-w-4xl mx-auto mb-10 sm:mb-12">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-mono font-semibold tracking-wider uppercase text-blue-700 bg-blue-50 border border-blue-200">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-mono font-semibold tracking-wider uppercase text-blue-700 bg-blue-50 border border-blue-200 shadow-2xs">
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
<span>Studio Neural Tool</span>
</div>
@@ -74,21 +91,117 @@ export function HeroSection({
<TextAnimate animation="fadeIn" by="word" delay={0.15}>{resolveLocalised(tool.summary, locale)}</TextAnimate>
</p>
<div className="mt-6 flex flex-wrap items-center justify-center gap-2 sm:gap-3 text-xs font-medium text-slate-600">
<span className="inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-slate-100">
<ShieldCheck className="h-3.5 w-3.5 text-emerald-600" />
<span>Zero Storage</span>
</span>
<span className="inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-slate-100">
<LockKeyhole className="h-3.5 w-3.5 text-blue-600" />
<span>Client-Side Processing</span>
</span>
<span className="inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-slate-100">
<Check className="h-3.5 w-3.5 text-indigo-600" />
<span>Lossless Quality</span>
</span>
{/* Mobile Tab Switcher */}
<div className="mt-7 flex lg:hidden items-center justify-center">
<div className="inline-flex p-1.5 rounded-2xl bg-slate-200/80 border border-slate-300 shadow-inner">
<button
type="button"
onClick={() => setMobileTab('upload')}
className={`flex items-center gap-2 px-5 py-2.5 rounded-xl text-xs font-bold transition-all ${
mobileTab === 'upload'
? 'bg-white text-blue-600 shadow-sm'
: 'text-slate-600 hover:text-slate-900'
}`}
>
<UploadCloud className="w-3.5 h-3.5" />
<span>Upload Photo</span>
</button>
<button
type="button"
onClick={() => setMobileTab('compare')}
className={`flex items-center gap-2 px-5 py-2.5 rounded-xl text-xs font-bold transition-all ${
mobileTab === 'compare'
? 'bg-blue-600 text-white shadow-sm'
: 'text-slate-600 hover:text-slate-900'
}`}
>
<SlidersHorizontal className="w-3.5 h-3.5" />
<span>Transform Result</span>
</button>
</div>
</div>
</div>
{/* Intelligent Side-by-Side Tool Studio */}
<div className="grid grid-cols-1 lg:grid-cols-12 gap-8 items-stretch max-w-7xl mx-auto" id="tool-studio">
{/* Column 1: Spacious, Prominent Upload Studio (lg:col-span-7) */}
<div className={`lg:col-span-7 flex flex-col ${mobileTab === 'upload' ? 'block' : 'hidden lg:flex'}`}>
<TryItWidget
tool={tool}
homeApp={homeApp}
variants={variants}
locale={locale}
className="h-full flex flex-col justify-between"
onSwitchToCompare={() => setMobileTab('compare')}
/>
</div>
{/* Column 2: Sleeker, Focused Neural Transformation Preview (lg:col-span-5) */}
<div className={`lg:col-span-5 flex flex-col ${mobileTab === 'compare' ? 'block' : 'hidden lg:flex'}`}>
<div className="h-full rounded-3xl overflow-hidden border border-slate-900/[0.1] shadow-cinematic-3d bg-slate-950 flex flex-col justify-between min-h-[380px] sm:min-h-[460px]">
<GrainTransformShowcase
beforeUrl={primaryExample.before}
afterUrl={primaryExample.after}
beforeLabel="BEFORE"
afterLabel="AFTER"
/>
</div>
{/* Mobile Jump to Upload (Only on small screens) */}
<div className="mt-3 lg:hidden">
<button
type="button"
onClick={() => setMobileTab('upload')}
className="w-full py-3 px-4 rounded-xl text-xs font-bold text-white bg-blue-600 hover:bg-blue-700 flex items-center justify-center gap-2 shadow-sm"
>
<UploadCloud className="w-4 h-4" />
<span>Upload Your Photo to Try</span>
</button>
</div>
</div>
</div>
{/* Clean Trust Indicators & Clickable App Links */}
<div className="mt-10 flex flex-wrap items-center justify-center gap-3 sm:gap-4 text-xs font-medium text-slate-600">
<span className="inline-flex items-center gap-1.5 px-3.5 py-2 rounded-full bg-slate-100 text-slate-700">
<ShieldCheck className="h-3.5 w-3.5 text-emerald-600" />
<span>Zero Storage</span>
</span>
<span className="inline-flex items-center gap-1.5 px-3.5 py-2 rounded-full bg-slate-100 text-slate-700">
<LockKeyhole className="h-3.5 w-3.5 text-blue-600" />
<span>Private Processing</span>
</span>
<span className="inline-flex items-center gap-1.5 px-3.5 py-2 rounded-full bg-slate-100 text-slate-700">
<Check className="h-3.5 w-3.5 text-indigo-600" />
<span>Lossless Quality</span>
</span>
{/* Clickable Mobile App Button Link */}
{homeApp && (
<a
href="#app-handoff"
className="inline-flex items-center gap-2 px-4 py-2 rounded-full bg-blue-50 hover:bg-blue-100 border border-blue-200 text-blue-700 font-bold shadow-2xs hover:scale-105 active:scale-95 transition-all group"
>
<Smartphone className="h-4 w-4 text-blue-600 group-hover:scale-110 transition-transform" />
<span>Available in {appName} App</span>
<span className="text-[10px] font-mono bg-blue-600 text-white px-2 py-0.5 rounded-full font-bold">
50 Bonus Credits &amp; 4K ↗
</span>
</a>
)}
{/* Clickable QR Code Trigger Pill */}
{homeApp && (
<a
href="#app-handoff"
className="inline-flex items-center gap-1.5 text-xs font-mono font-semibold text-slate-700 hover:text-slate-950 bg-white hover:bg-slate-50 border border-slate-200 px-3.5 py-2 rounded-full shadow-2xs transition-all hover:scale-105 active:scale-95"
title="Scan QR Code to install mobile app"
>
<QrCode className="w-3.5 h-3.5 text-blue-600" />
<span>Scan QR</span>
</a>
)}
</div>
</div>
</section>
);
+1 -1
View File
@@ -77,7 +77,7 @@ function SectionContent({ section, context }: SectionRendererProps) {
switch (section.type) {
case 'hero': {
const isHomePage = context.page?.slug === 'home' || context.page?.id === 'home' || !context.page?.slug;
const isHomePage = (context.page?.slug === 'home' || context.page?.id === 'home') && !context.tool;
return (
<HeroSection
{...resolvedProps}
+2
View File
@@ -27,6 +27,7 @@ interface TryItWidgetProps {
className?: string;
samplePresets?: Array<{ label: string; url: string; resultUrl?: string }>;
ctaText?: string;
onSwitchToCompare?: () => void;
}
export function TryItWidget({
@@ -37,6 +38,7 @@ export function TryItWidget({
className = '',
samplePresets,
ctaText,
onSwitchToCompare,
}: TryItWidgetProps) {
const [selectedFile, setSelectedFile] = useState<File | null>(null);
const [previewUrl, setPreviewUrl] = useState<string | null>(null);
+4
View File
@@ -167,6 +167,10 @@ export function getAllCategories(): CategoryItem[] {
}
export function getTemplate(name: string): any {
const mgmtPath = path.join(MANAGEMENT_DIR, 'templates', `${name}.json`);
if (fs.existsSync(mgmtPath)) {
return readJsonFile(mgmtPath);
}
const filePath = path.join(CONTENT_DIR, 'templates', `${name}.json`);
return readJsonFile(filePath);
}