Lead Magnet

This commit is contained in:
Timo Knuth
2026-01-16 12:44:13 +01:00
parent 83ea141230
commit be54d388bb
20 changed files with 1211 additions and 21 deletions

View File

@@ -11,6 +11,7 @@ import { Features } from '@/components/marketing/Features';
import { Pricing } from '@/components/marketing/Pricing';
import { FAQ } from '@/components/marketing/FAQ';
import { Button } from '@/components/ui/Button';
import { ReprintCalculatorTeaser } from '@/components/marketing/ReprintCalculatorTeaser';
import { ScrollToTop } from '@/components/ui/ScrollToTop';
import { FreeToolsGrid } from '@/components/marketing/FreeToolsGrid';
import en from '@/i18n/en.json';
@@ -40,8 +41,11 @@ export default function HomePageClient() {
{/* Free Tools Grid */}
<FreeToolsGrid />
<StaticVsDynamic t={t} />
<Features t={t} />
<React.Fragment>
<StaticVsDynamic t={t} />
<ReprintCalculatorTeaser />
<Features t={t} />
</React.Fragment>
{/* Pricing Section */}
<Pricing t={t} />

View File

@@ -0,0 +1,62 @@
'use client';
import React from 'react';
import Link from 'next/link';
import { Button } from '@/components/ui/Button';
import { ArrowRight, Calculator, TrendingUp } from 'lucide-react';
export const ReprintCalculatorTeaser: React.FC = () => {
return (
<section className="py-24 bg-white relative overflow-hidden">
<div className="container mx-auto px-4 relative z-10">
<div className="bg-gradient-to-br from-indigo-50 to-white border border-indigo-100 rounded-3xl p-8 md:p-12 lg:p-16 flex flex-col md:flex-row items-center justify-between gap-12 shadow-sm hover:shadow-md transition-shadow duration-500">
<div className="flex-1 text-center md:text-left">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-indigo-100 text-indigo-700 text-sm font-medium mb-6">
<TrendingUp className="w-4 h-4" />
<span>ROI Calculator</span>
</div>
<h2 className="text-3xl md:text-4xl lg:text-5xl font-bold text-slate-900 mb-6 leading-tight">
Are you burning budget on <br />
<span className="text-transparent bg-clip-text bg-gradient-to-r from-indigo-600 to-blue-600">Static Reprints?</span>
</h2>
<p className="text-slate-600 text-lg md:text-xl max-w-xl mx-auto md:mx-0 leading-relaxed mb-8">
Find out exactly how much you can save by switching to dynamic QR codes. Our calculator reveals your savings potential in seconds.
</p>
<Link href="/reprint-calculator">
<Button
size="lg"
variant="primary"
className="h-14 px-8 text-lg hover:translate-x-1 transition-transform"
>
Calculate Savings <ArrowRight className="w-5 h-5 ml-2" />
</Button>
</Link>
</div>
<div className="flex-shrink-0 w-full md:w-auto flex justify-center md:justify-end">
<div className="relative group">
<div className="absolute -inset-1 bg-gradient-to-r from-indigo-500 to-blue-500 rounded-2xl blur opacity-20 group-hover:opacity-40 transition duration-1000 group-hover:duration-200"></div>
<div className="relative bg-white rounded-xl p-8 border border-slate-100 w-full max-w-xs text-center shadow-lg">
<div className="w-16 h-16 bg-indigo-50 rounded-2xl flex items-center justify-center mx-auto mb-6 text-indigo-600">
<Calculator className="w-8 h-8" />
</div>
<h3 className="text-lg font-bold text-slate-900 mb-2">Cost Analysis</h3>
<p className="text-slate-500 text-sm mb-6">
Enter your print volume and update frequency to see your hidden costs.
</p>
<div className="h-1.5 w-full bg-slate-100 rounded-full overflow-hidden">
<div className="h-full w-2/3 bg-indigo-500 rounded-full animate-pulse"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
);
};

View File

@@ -0,0 +1,430 @@
'use client';
import React, { useState, useMemo } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import Link from 'next/link';
import { Button } from '@/components/ui/Button';
import { AlertTriangle, CheckCircle, TrendingDown, ArrowRight, RefreshCcw, FileDown, X, Loader2, Mail } from 'lucide-react';
import { generateSavingsReport } from '@/lib/generateSavingsReport';
interface CalculatorResults {
annualWaste: number;
withQRMaster: number;
savings: number;
savingsPercent: number;
monthsPaidFor: number;
}
export const ReprintSavingsCalculator: React.FC = () => {
const [reprintCost, setReprintCost] = useState<string>('');
const [updatesPerYear, setUpdatesPerYear] = useState<string>('');
const [showResults, setShowResults] = useState(false);
const [showEmailModal, setShowEmailModal] = useState(false);
const [email, setEmail] = useState('');
const [isSubmitting, setIsSubmitting] = useState(false);
const [submitError, setSubmitError] = useState('');
// QR Master Pro yearly cost
const qrMasterYearlyCost = 108; // €9/month * 12
const results = useMemo((): CalculatorResults | null => {
const cost = parseFloat(reprintCost);
const updates = parseFloat(updatesPerYear);
if (!cost || !updates || cost <= 0 || updates <= 0) {
return null;
}
const annualWaste = cost * updates;
const withQRMaster = qrMasterYearlyCost;
const savings = annualWaste - withQRMaster;
const savingsPercent = Math.round((savings / annualWaste) * 100);
const monthsPaidFor = Math.round(annualWaste / (qrMasterYearlyCost / 12));
return {
annualWaste,
withQRMaster,
savings: Math.max(0, savings),
savingsPercent: Math.max(0, savingsPercent),
monthsPaidFor,
};
}, [reprintCost, updatesPerYear]);
const handleCalculate = () => {
if (results) {
setShowResults(true);
}
};
const handleReset = () => {
setShowResults(false);
setReprintCost('');
setUpdatesPerYear('');
};
const handleDownloadReport = async () => {
setShowEmailModal(true);
};
const handleEmailSubmit = async (e: React.FormEvent) => {
e.preventDefault();
if (!email || !email.includes('@') || !results) return;
setIsSubmitting(true);
setSubmitError('');
try {
// Save lead to database
const response = await fetch('/api/leads', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
email,
source: 'reprint-calculator',
reprintCost: parseFloat(reprintCost),
updatesPerYear: parseInt(updatesPerYear),
annualSavings: results.savings,
}),
});
if (!response.ok) {
throw new Error('Failed to save');
}
// Generate and download PDF
generateSavingsReport({
reprintCost: parseFloat(reprintCost),
updatesPerYear: parseInt(updatesPerYear),
annualWaste: results.annualWaste,
qrMasterCost: results.withQRMaster,
savings: results.savings,
savingsPercent: results.savingsPercent,
});
// Close modal and reset
setShowEmailModal(false);
setEmail('');
} catch (error) {
setSubmitError('Something went wrong. Please try again.');
} finally {
setIsSubmitting(false);
}
};
const formatCurrency = (value: number) => {
return new Intl.NumberFormat('de-DE', {
style: 'currency',
currency: 'EUR',
minimumFractionDigits: 0,
maximumFractionDigits: 0,
}).format(value);
};
return (
<>
<section className="py-20 bg-gradient-to-br from-slate-50 to-white relative overflow-hidden">
{/* Background decoration */}
<div className="absolute top-0 left-0 w-full h-full overflow-hidden pointer-events-none opacity-40">
<div className="absolute -top-[20%] -right-[10%] w-[600px] h-[600px] bg-primary-100/50 rounded-full blur-3xl" />
<div className="absolute bottom-[0%] -left-[10%] w-[500px] h-[500px] bg-indigo-50/50 rounded-full blur-3xl" />
</div>
<div className="container mx-auto px-4 sm:px-6 lg:px-8 max-w-4xl relative z-10">
<motion.div
initial={{ opacity: 0, y: 30 }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true }}
transition={{ duration: 0.6 }}
className="bg-white rounded-3xl shadow-xl border border-slate-100 overflow-hidden"
>
<div className="grid md:grid-cols-5 h-full">
{/* Left Side: Form */}
<div className={`p-8 md:p-10 ${showResults ? 'md:col-span-2 bg-slate-50 border-r border-slate-100' : 'md:col-span-5'}`}>
<AnimatePresence mode="wait">
{!showResults ? (
<motion.div
key="form-intro"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
className="max-w-2xl mx-auto md:max-w-none text-center md:text-left"
>
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-red-50 text-red-600 text-sm font-medium mb-6">
<AlertTriangle className="w-4 h-4" />
Stop wasting budget
</div>
<h2 className="text-3xl font-bold text-slate-900 mb-4 leading-tight">
Calculate your Reprint Waste
</h2>
<p className="text-slate-600 mb-8">
Enter your printing costs to see exactly how much static QR codes are costing you annually.
</p>
</motion.div>
) : (
<motion.div
key="form-minimized"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
>
<h3 className="font-bold text-slate-900 mb-6 flex items-center gap-2">
<RefreshCcw className="w-4 h-4 text-slate-400" />
Parameters
</h3>
</motion.div>
)}
</AnimatePresence>
<div className="space-y-6">
<div>
<label htmlFor="reprintCost" className="block text-sm font-semibold text-slate-700 mb-2">
Reprint cost per batch
</label>
<div className="relative group">
<span className="absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 font-medium text-lg transition-colors group-hover:text-primary-600"></span>
<input
type="number"
id="reprintCost"
value={reprintCost}
onChange={(e) => setReprintCost(e.target.value)}
placeholder="500"
min="0"
className="w-full pl-10 pr-4 py-3.5 text-lg border border-slate-200 rounded-xl focus:ring-2 focus:ring-primary-500 focus:border-primary-500 transition-all shadow-sm group-hover:border-primary-300 bg-white"
/>
</div>
</div>
<div>
<label htmlFor="updatesPerYear" className="block text-sm font-semibold text-slate-700 mb-2">
URL updates per year
</label>
<input
type="number"
id="updatesPerYear"
value={updatesPerYear}
onChange={(e) => setUpdatesPerYear(e.target.value)}
placeholder="3"
min="0"
className="w-full px-4 py-3.5 text-lg border border-slate-200 rounded-xl focus:ring-2 focus:ring-primary-500 focus:border-primary-500 transition-all shadow-sm hover:border-primary-300 bg-white"
/>
</div>
{!showResults && (
<Button
onClick={handleCalculate}
disabled={!reprintCost || !updatesPerYear}
variant="primary"
size="lg"
className="w-full text-lg py-4 shadow-lg shadow-primary-500/20 hover:shadow-primary-500/40 transition-all transform hover:-translate-y-0.5"
>
Calculate Savings <ArrowRight className="ml-2 w-5 h-5" />
</Button>
)}
{showResults && (
<button
onClick={handleCalculate} // Recalculate if changed
className="text-sm text-primary-600 font-medium hover:text-primary-700 underline decoration-2 decoration-transparent hover:decoration-primary-200 transition-all"
>
Update Calculation
</button>
)}
</div>
</div>
{/* Right Side: Results */}
<div className={`bg-white p-8 md:p-10 flex flex-col justify-center transition-all duration-500 ${showResults ? 'md:col-span-3 opacity-100 translate-x-0' : 'hidden md:flex md:col-span-0 opacity-0 translate-x-10 w-0 p-0 overflow-hidden'}`}>
{results && showResults && (
<motion.div
initial={{ opacity: 0, scale: 0.95 }}
animate={{ opacity: 1, scale: 1 }}
transition={{ duration: 0.4, delay: 0.1 }}
className="h-full flex flex-col"
>
<div className="flex-1">
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full bg-green-50 text-green-700 text-sm font-medium mb-6">
<TrendingDown className="w-4 h-4" />
Potential Savings Found
</div>
<div className="mb-8">
<p className="text-slate-500 text-sm font-medium uppercase tracking-wide mb-1">Annual Waste Identified</p>
<div className="flex items-baseline gap-2">
<span className="text-5xl lg:text-6xl font-black text-slate-900 tracking-tight">
{formatCurrency(results.annualWaste)}
</span>
</div>
<p className="text-red-500 text-sm mt-2 font-medium flex items-center gap-1">
<AlertTriangle className="w-3 h-3" /> Money currently lost to static reprints
</p>
</div>
{/* Comparison Bars */}
<div className="space-y-6 mb-10">
<div className="relative">
<div className="flex justify-between text-sm mb-2">
<span className="font-semibold text-slate-700">Static QR Code Cost</span>
<span className="font-bold text-red-600">{formatCurrency(results.annualWaste)}</span>
</div>
<div className="h-3 bg-slate-100 rounded-full w-full overflow-hidden">
<motion.div
initial={{ width: 0 }}
animate={{ width: "100%" }}
transition={{ duration: 1, ease: "easeOut" }}
className="h-full bg-red-500 rounded-full"
/>
</div>
</div>
<div className="relative">
<div className="flex justify-between text-sm mb-2">
<span className="font-semibold text-slate-700">QR Master Cost</span>
<span className="font-bold text-emerald-600">{formatCurrency(results.withQRMaster)}</span>
</div>
<div className="h-3 bg-slate-100 rounded-full w-full overflow-hidden">
<motion.div
initial={{ width: 0 }}
animate={{ width: `${(results.withQRMaster / results.annualWaste) * 100}%` }}
transition={{ duration: 1, ease: "easeOut", delay: 0.5 }}
className="h-full bg-emerald-500 rounded-full"
/>
</div>
</div>
</div>
<div className="bg-emerald-50/50 border border-emerald-100 rounded-2xl p-6 mb-8">
<div className="flex items-start gap-4">
<div className="p-3 bg-emerald-100 rounded-xl text-emerald-600 shrink-0">
<CheckCircle className="w-6 h-6" />
</div>
<div>
<h4 className="text-lg font-bold text-emerald-900 mb-1">
You save {results.savingsPercent}% instantly
</h4>
<p className="text-emerald-800/80 leading-relaxed">
That's <strong className="text-emerald-900">{formatCurrency(results.savings)}</strong> extra budget per year.
Effectively getting <strong className="text-emerald-900">{results.monthsPaidFor} months</strong> of service for free compared to just one single reprint.
</p>
</div>
</div>
</div>
</div>
<div className="mt-auto space-y-3">
<Link href="/signup" className="block">
<Button variant="primary" size="lg" className="w-full text-lg py-4 shadow-xl shadow-primary-500/20 hover:shadow-primary-500/30">
Start Saving Now
</Button>
</Link>
<button
onClick={handleDownloadReport}
className="w-full flex items-center justify-center gap-2 py-3 px-4 text-sm font-medium text-slate-700 bg-slate-100 hover:bg-slate-200 rounded-xl transition-colors"
>
<FileDown className="w-4 h-4" />
Download Your Savings Report (PDF)
</button>
<p className="text-center text-xs text-slate-400">
Based on QR Master Pro annual plan. No credit card required to start.
</p>
</div>
</motion.div>
)}
</div>
</div>
</motion.div>
</div>
</section>
{/* Email Capture Modal */}
<AnimatePresence>
{showEmailModal && (
<motion.div
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
className="fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4"
onClick={() => setShowEmailModal(false)}
>
<motion.div
initial={{ opacity: 0, scale: 0.95, y: 20 }}
animate={{ opacity: 1, scale: 1, y: 0 }}
exit={{ opacity: 0, scale: 0.95, y: 20 }}
className="bg-white rounded-2xl shadow-2xl max-w-md w-full p-8 relative"
onClick={(e) => e.stopPropagation()}
>
<button
onClick={() => setShowEmailModal(false)}
className="absolute top-4 right-4 p-2 text-slate-400 hover:text-slate-600 rounded-lg hover:bg-slate-100 transition-colors"
>
<X className="w-5 h-5" />
</button>
<div className="text-center mb-6">
<div className="w-16 h-16 bg-gradient-to-br from-primary-100 to-indigo-100 rounded-2xl flex items-center justify-center mx-auto mb-4">
<FileDown className="w-8 h-8 text-primary-600" />
</div>
<h3 className="text-2xl font-bold text-slate-900 mb-2">
Get Your Savings Report
</h3>
<p className="text-slate-600">
Enter your email to receive your personalized PDF report with detailed cost analysis.
</p>
</div>
<form onSubmit={handleEmailSubmit} className="space-y-4">
<div>
<label htmlFor="emailInput" className="block text-sm font-medium text-slate-700 mb-2">
Business Email
</label>
<div className="relative">
<Mail className="absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400" />
<input
type="email"
id="emailInput"
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="you@company.com"
required
className="w-full pl-12 pr-4 py-3.5 text-lg border border-slate-200 rounded-xl focus:ring-2 focus:ring-primary-500 focus:border-primary-500 transition-all"
/>
</div>
</div>
{submitError && (
<p className="text-sm text-red-600">{submitError}</p>
)}
<Button
type="submit"
disabled={isSubmitting || !email}
variant="primary"
size="lg"
className="w-full text-lg py-4"
>
{isSubmitting ? (
<>
<Loader2 className="w-5 h-5 mr-2 animate-spin" />
Generating...
</>
) : (
<>
<FileDown className="w-5 h-5 mr-2" />
Download Report
</>
)}
</Button>
<p className="text-xs text-slate-400 text-center">
We respect your privacy. Your email will only be used for QR Master updates.
</p>
</form>
</motion.div>
</motion.div>
)}
</AnimatePresence>
</>
);
};
export default ReprintSavingsCalculator;

View File

@@ -45,6 +45,8 @@ export function Footer({ variant = 'marketing', t }: FooterProps) {
<li><Link href="/bulk-qr-code-generator" className={isDashboard ? 'hover:text-primary-600' : 'hover:text-white'}>Bulk QR Generator</Link></li>
<li><Link href="/signup" className={isDashboard ? 'hover:text-primary-600' : 'hover:text-white'}>{translations.get_started}</Link></li>
<li><Link href="/reprint-calculator" className={isDashboard ? 'hover:text-primary-600' : 'hover:text-white'}>Reprint Cost Calculator</Link></li>
<li><Link href="/qr-code-tracking" className={isDashboard ? 'hover:text-primary-600' : 'hover:text-white'}>Our Analytics</Link></li>
</ul>
</div>