2026-11-03 12:24:43 +05:30
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import React, { useState, useEffect } from 'react';
|
|
|
|
|
import QRCode from 'qrcode';
|
2026-11-05 10:26:19 +05:30
|
|
|
import {
|
|
|
|
|
Smartphone,
|
|
|
|
|
QrCode,
|
|
|
|
|
Copy,
|
|
|
|
|
Check,
|
|
|
|
|
Gift,
|
|
|
|
|
ExternalLink,
|
|
|
|
|
Sparkles,
|
|
|
|
|
Zap,
|
|
|
|
|
ShieldCheck,
|
|
|
|
|
Star
|
|
|
|
|
} from 'lucide-react';
|
2026-11-03 12:24:43 +05:30
|
|
|
import { AppItem, ToolItem, resolveLocalised } from '@/types';
|
|
|
|
|
|
|
|
|
|
interface AppHandoffSectionProps {
|
|
|
|
|
app?: AppItem;
|
|
|
|
|
tool?: ToolItem | null;
|
|
|
|
|
locale?: string;
|
|
|
|
|
showBonus?: boolean;
|
|
|
|
|
showQr?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function AppHandoffSection({
|
|
|
|
|
app,
|
|
|
|
|
tool,
|
|
|
|
|
locale = 'en',
|
|
|
|
|
showBonus = true,
|
|
|
|
|
showQr = true,
|
|
|
|
|
}: AppHandoffSectionProps) {
|
|
|
|
|
const [qrDataUrl, setQrDataUrl] = useState<string>('');
|
2026-11-05 10:26:19 +05:30
|
|
|
const [copiedPromo, setCopiedPromo] = useState(false);
|
|
|
|
|
const [copiedLink, setCopiedLink] = useState(false);
|
|
|
|
|
const [origin, setOrigin] = useState<string>('');
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (typeof window !== 'undefined') {
|
|
|
|
|
setOrigin(window.location.origin);
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
2026-11-03 12:24:43 +05:30
|
|
|
|
|
|
|
|
if (!app) return null;
|
|
|
|
|
|
|
|
|
|
const bonusCode = app.welcomeBonus?.code || 'TRYWEB50';
|
2026-11-05 10:26:19 +05:30
|
|
|
const baseHost = origin || 'http://localhost:3000';
|
2026-11-03 12:24:43 +05:30
|
|
|
const targetUrl = tool
|
2026-11-05 10:26:19 +05:30
|
|
|
? `${baseHost}/go/${tool.slug}/${app.slug}?promo=${bonusCode}`
|
|
|
|
|
: `${baseHost}/apps/${app.slug}?promo=${bonusCode}`;
|
2026-11-03 12:24:43 +05:30
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (showQr) {
|
|
|
|
|
QRCode.toDataURL(targetUrl, {
|
2026-11-05 10:26:19 +05:30
|
|
|
width: 240,
|
2026-11-03 12:24:43 +05:30
|
|
|
margin: 1,
|
|
|
|
|
color: {
|
2026-11-05 10:26:19 +05:30
|
|
|
dark: '#020617',
|
2026-11-03 12:24:43 +05:30
|
|
|
light: '#ffffff',
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
.then(setQrDataUrl)
|
|
|
|
|
.catch(console.error);
|
|
|
|
|
}
|
|
|
|
|
}, [targetUrl, showQr]);
|
|
|
|
|
|
|
|
|
|
const copyPromo = () => {
|
|
|
|
|
navigator.clipboard.writeText(bonusCode);
|
2026-11-05 10:26:19 +05:30
|
|
|
setCopiedPromo(true);
|
|
|
|
|
setTimeout(() => setCopiedPromo(false), 2000);
|
2026-11-03 12:24:43 +05:30
|
|
|
};
|
|
|
|
|
|
2026-11-05 10:26:19 +05:30
|
|
|
const copyTargetUrl = () => {
|
|
|
|
|
navigator.clipboard.writeText(targetUrl);
|
|
|
|
|
setCopiedLink(true);
|
|
|
|
|
setTimeout(() => setCopiedLink(false), 2000);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const appName = resolveLocalised(app.name, locale);
|
|
|
|
|
const appTagline = resolveLocalised(app.tagline, locale);
|
|
|
|
|
|
2026-11-03 12:24:43 +05:30
|
|
|
return (
|
2026-11-05 10:26:19 +05:30
|
|
|
<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" />
|
|
|
|
|
|
2026-11-03 13:02:29 +05:30
|
|
|
<div className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
|
2026-11-05 10:26:19 +05:30
|
|
|
<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>
|
|
|
|
|
)}
|
2026-11-03 12:24:43 +05:30
|
|
|
</div>
|
|
|
|
|
|
2026-11-05 10:26:19 +05:30
|
|
|
{/* 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>
|
2026-11-03 12:24:43 +05:30
|
|
|
|
2026-11-05 10:26:19 +05:30
|
|
|
{/* 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>
|
2026-11-03 12:24:43 +05:30
|
|
|
|
|
|
|
|
{/* Welcome Bonus Promo Banner */}
|
|
|
|
|
{showBonus && (
|
2026-11-05 10:26:19 +05:30
|
|
|
<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">
|
2026-11-03 13:02:29 +05:30
|
|
|
<div className="flex items-center gap-3.5">
|
2026-11-05 10:26:19 +05:30
|
|
|
<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">
|
2026-11-03 12:24:43 +05:30
|
|
|
<Gift className="w-5 h-5" />
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
2026-11-03 13:16:16 +05:30
|
|
|
<p className="text-xs sm:text-sm font-display font-bold text-slate-900">
|
2026-11-05 10:26:19 +05:30
|
|
|
{app.welcomeBonus?.title || '50 Free 4K HD Export Credits'}
|
2026-11-03 12:24:43 +05:30
|
|
|
</p>
|
2026-11-03 13:16:16 +05:30
|
|
|
<p className="text-[11px] font-mono text-slate-600">
|
2026-11-03 13:02:29 +05:30
|
|
|
Claim promo code on first mobile launch
|
2026-11-03 12:24:43 +05:30
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<button
|
2026-11-05 10:26:19 +05:30
|
|
|
type="button"
|
2026-11-03 12:24:43 +05:30
|
|
|
onClick={copyPromo}
|
2026-11-05 10:26:19 +05:30
|
|
|
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"
|
2026-11-03 12:24:43 +05:30
|
|
|
>
|
2026-11-05 10:26:19 +05:30
|
|
|
{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>
|
2026-11-03 12:24:43 +05:30
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-11-05 10:26:19 +05:30
|
|
|
{/* 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>
|
2026-11-03 12:24:43 +05:30
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Disclaimer */}
|
2026-11-05 10:26:19 +05:30
|
|
|
<p className="text-[11px] font-mono text-slate-400 italic">
|
2026-11-03 12:24:43 +05:30
|
|
|
{resolveLocalised(app.creditsNote, locale, 'Credits and in-app purchases are specific to this app.')}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-11-05 10:26:19 +05:30
|
|
|
{/* Right Column: High-Tech Futuristic QR Code Scanner Card */}
|
2026-11-03 12:24:43 +05:30
|
|
|
{showQr && qrDataUrl && (
|
2026-11-05 10:26:19 +05:30
|
|
|
<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]">
|
2026-11-03 12:24:43 +05:30
|
|
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
2026-11-05 10:26:19 +05:30
|
|
|
<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"
|
|
|
|
|
/>
|
2026-11-03 12:24:43 +05:30
|
|
|
</div>
|
2026-11-05 10:26:19 +05:30
|
|
|
|
|
|
|
|
{/* 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>
|
2026-11-03 12:24:43 +05:30
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2026-11-05 10:26:19 +05:30
|
|
|
|
2026-11-03 12:24:43 +05:30
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
);
|
|
|
|
|
}
|