diff --git a/content/templates/tool.json b/content/templates/tool.json index e49908f..4ec24c7 100644 --- a/content/templates/tool.json +++ b/content/templates/tool.json @@ -10,6 +10,71 @@ "subtitle": "{{tool.summary}}", "breadcrumbs": true } + }, + { + "id": "tool-handoff", + "type": "appHandoff", + "props": { + "toolRef": "{{tool.id}}", + "appRef": "{{tool.homeApp}}", + "showBonus": true, + "showQr": true + } + }, + { + "id": "tool-steps", + "type": "steps", + "props": { + "title": { + "en": "How It Works", + "hi": "यह कैसे काम करता है" + }, + "items": "{{tool.content.steps}}" + } + }, + { + "id": "tool-availability", + "type": "availability", + "props": { + "toolRef": "{{tool.id}}" + } + }, + { + "id": "tool-faq", + "type": "faq", + "props": { + "title": { + "en": "Frequently Asked Questions", + "hi": "अक्सर पूछे जाने वाले प्रश्न" + }, + "items": "{{tool.content.faqs}}" + } + }, + { + "id": "tool-related", + "type": "relatedTools", + "props": { + "toolRef": "{{tool.id}}", + "limit": 4 + } + }, + { + "id": "tool-cta", + "type": "ctaBanner", + "props": { + "title": { + "en": "Ready for 4K Lossless Processing?", + "hi": "क्या आप 4K लॉसलेस प्रोसेसिंग के लिए तैयार हैं?" + }, + "subtitle": { + "en": "Open {{tool.name}} in {{tool.homeApp.name}} on your phone.", + "hi": "अपने फोन पर {{tool.homeApp.name}} में {{tool.name}} खोलें।" + }, + "primaryCta": { + "label": { "en": "Open in Mobile App", "hi": "मोबाइल ऐप में खोलें" }, + "href": "/go/{{tool.slug}}/{{tool.homeApp.slug}}" + } + } } ] } diff --git a/management/templates/app.json b/management/templates/app.json new file mode 100644 index 0000000..dcd1265 --- /dev/null +++ b/management/templates/app.json @@ -0,0 +1,55 @@ +{ + "id": "app-template", + "sections": [ + { + "id": "app-hero", + "type": "hero", + "variant": "appHero", + "props": { + "title": "{{app.name}}", + "subtitle": "{{app.tagline}}", + "badge": "Rating: {{app.rating.value}} ★ ({{app.rating.count}} reviews)" + } + }, + { + "id": "app-handoff-main", + "type": "appHandoff", + "props": { + "appRef": "{{app.id}}", + "showBonus": true, + "showQr": true + } + }, + { + "id": "app-features", + "type": "featureList", + "props": { + "title": { + "en": "Pro Features Included", + "hi": "प्रो विशेषताएं शामिल हैं" + }, + "items": "{{app.features}}" + } + }, + { + "id": "app-tools-grid", + "type": "toolGrid", + "props": { + "title": { + "en": "Tools Included in this App", + "hi": "इस ऐप में शामिल टूल्स" + }, + "source": "appTools", + "appRef": "{{app.id}}" + } + }, + { + "id": "app-pricing-notice", + "type": "notice", + "props": { + "text": "{{app.creditsNote}}", + "level": "info" + } + } + ] +} diff --git a/management/templates/tool.json b/management/templates/tool.json new file mode 100644 index 0000000..4ec24c7 --- /dev/null +++ b/management/templates/tool.json @@ -0,0 +1,80 @@ +{ + "id": "tool-template", + "sections": [ + { + "id": "tool-hero", + "type": "hero", + "variant": "toolHero", + "props": { + "title": "{{tool.name}}", + "subtitle": "{{tool.summary}}", + "breadcrumbs": true + } + }, + { + "id": "tool-handoff", + "type": "appHandoff", + "props": { + "toolRef": "{{tool.id}}", + "appRef": "{{tool.homeApp}}", + "showBonus": true, + "showQr": true + } + }, + { + "id": "tool-steps", + "type": "steps", + "props": { + "title": { + "en": "How It Works", + "hi": "यह कैसे काम करता है" + }, + "items": "{{tool.content.steps}}" + } + }, + { + "id": "tool-availability", + "type": "availability", + "props": { + "toolRef": "{{tool.id}}" + } + }, + { + "id": "tool-faq", + "type": "faq", + "props": { + "title": { + "en": "Frequently Asked Questions", + "hi": "अक्सर पूछे जाने वाले प्रश्न" + }, + "items": "{{tool.content.faqs}}" + } + }, + { + "id": "tool-related", + "type": "relatedTools", + "props": { + "toolRef": "{{tool.id}}", + "limit": 4 + } + }, + { + "id": "tool-cta", + "type": "ctaBanner", + "props": { + "title": { + "en": "Ready for 4K Lossless Processing?", + "hi": "क्या आप 4K लॉसलेस प्रोसेसिंग के लिए तैयार हैं?" + }, + "subtitle": { + "en": "Open {{tool.name}} in {{tool.homeApp.name}} on your phone.", + "hi": "अपने फोन पर {{tool.homeApp.name}} में {{tool.name}} खोलें।" + }, + "primaryCta": { + "label": { "en": "Open in Mobile App", "hi": "मोबाइल ऐप में खोलें" }, + "href": "/go/{{tool.slug}}/{{tool.homeApp.slug}}" + } + } + } + ] +} diff --git a/src/components/sections/AppHandoffSection.tsx b/src/components/sections/AppHandoffSection.tsx index ce226cd..055d2e9 100644 --- a/src/components/sections/AppHandoffSection.tsx +++ b/src/components/sections/AppHandoffSection.tsx @@ -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(''); - const [copied, setCopied] = useState(false); + const [copiedPromo, setCopiedPromo] = useState(false); + const [copiedLink, setCopiedLink] = useState(false); + const [origin, setOrigin] = useState(''); + + 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 ( -
+
+ {/* Ambient background glow */} +
+
-
- {/* Left Column: Copy & Store CTA */} -
-
- - NATIVE IOS & ANDROID APPS +
+ + {/* Left Column: Copy, Bonus & Clickable Store Buttons */} +
+ {/* Header Badge */} +
+ + + NATIVE IOS & ANDROID APP + + + {app.rating && ( + + + {app.rating.value} + + ({(app.rating.count / 1000).toFixed(0)}k+ creators) + + + )}
-

- {tool - ? `Continue in ${resolveLocalised(app.name, locale)} with 4K Lossless Export` - : `Download ${resolveLocalised(app.name, locale)}`} -

+ {/* Main Headline */} +
+

+ {tool + ? `Continue in ${appName} with 4K Lossless Export` + : `Download ${appName}`} +

+

+ Experience zero-latency hardware-accelerated neural processing, batch photoshoot enhancement, fine-tuning sliders, and uncompressed 4K export directly on your phone. +

+
-

- Experience zero-latency hardware-accelerated neural processing, batch photoshoot enhancement, and professional fine-tuning sliders on your phone. -

+ {/* Key Feature Perks List */} +
+
+
+ +
+ 4K Lossless Uncompressed Export +
+
+
+ +
+ On-Device Neural Engine Acceleration +
+
+
+ +
+ Batch Multi-Photo Enhancement +
+
+
+ +
+ Offline Private Mode (100% Private) +
+
{/* Welcome Bonus Promo Banner */} {showBonus && ( -
+
-
+

- {app.welcomeBonus?.title || '50 Free HD Export Credits'} + {app.welcomeBonus?.title || '50 Free 4K HD Export Credits'}

Claim promo code on first mobile launch @@ -90,57 +169,118 @@ export function AppHandoffSection({

)} - {/* Store Download Buttons */} -
- - Google Play - - - - Apple App Store - - + {/* Official Clickable App Store & Google Play Buttons */} +
+

+ Available now for instant install: +

+
+ {/* Apple App Store Official Badge Button */} + + + + +
+ Download on the + Apple App Store +
+ +
+ + {/* Google Play Store Official Badge Button */} + + + + + + + +
+ GET IT ON + Google Play +
+ +
+
{/* Disclaimer */} -

+

{resolveLocalised(app.creditsNote, locale, 'Credits and in-app purchases are specific to this app.')}

- {/* Right Column: QR Code Handoff */} + {/* Right Column: High-Tech Futuristic QR Code Scanner Card */} {showQr && qrDataUrl && ( -
-
+
+ {/* Ambient Glow */} +
+ + {/* Animated Futuristic Laser Reticle Corners */} + + + + + + {/* QR Code Presentation Canvas */} +
{/* eslint-disable-next-line @next/next/no-img-element */} - Scan QR code to install app + Scan QR code to install app
-
- - Scan with phone camera + + {/* Status Beacon & Camera Target */} +
+ + + + + + Point Camera to Scan + +
+

+ Opens app store listing instantly with promo code pre-applied +

+ + {/* Quick Copy Link Action */} +
+
-

Instant redirect to store listing

)} +
diff --git a/src/components/sections/HeroSection.tsx b/src/components/sections/HeroSection.tsx index b854468..369473e 100644 --- a/src/components/sections/HeroSection.tsx +++ b/src/components/sections/HeroSection.tsx @@ -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; @@ -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 ( -
+
+ {/* Breadcrumb Navigation */} + {/* Heading & Subtitle */}
-
+
Studio Neural Tool
@@ -74,21 +91,117 @@ export function HeroSection({ {resolveLocalised(tool.summary, locale)}

-
- - - Zero Storage - - - - Client-Side Processing - - - - Lossless Quality - + {/* Mobile Tab Switcher */} +
+
+ + +
+ + {/* Intelligent Side-by-Side Tool Studio */} +
+ {/* Column 1: Spacious, Prominent Upload Studio (lg:col-span-7) */} +
+ setMobileTab('compare')} + /> +
+ + {/* Column 2: Sleeker, Focused Neural Transformation Preview (lg:col-span-5) */} +
+
+ +
+ + {/* Mobile Jump to Upload (Only on small screens) */} +
+ +
+
+
+ + {/* Clean Trust Indicators & Clickable App Links */} +
+ + + Zero Storage + + + + Private Processing + + + + Lossless Quality + + + {/* Clickable Mobile App Button Link */} + {homeApp && ( + + + Available in {appName} App + + 50 Bonus Credits & 4K ↗ + + + )} + + {/* Clickable QR Code Trigger Pill */} + {homeApp && ( + + + Scan QR + + )} +
); diff --git a/src/components/sections/SectionRenderer.tsx b/src/components/sections/SectionRenderer.tsx index 90c5879..0d89da0 100644 --- a/src/components/sections/SectionRenderer.tsx +++ b/src/components/sections/SectionRenderer.tsx @@ -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 ( ; ctaText?: string; + onSwitchToCompare?: () => void; } export function TryItWidget({ @@ -37,6 +38,7 @@ export function TryItWidget({ className = '', samplePresets, ctaText, + onSwitchToCompare, }: TryItWidgetProps) { const [selectedFile, setSelectedFile] = useState(null); const [previewUrl, setPreviewUrl] = useState(null); diff --git a/src/lib/config/loader.ts b/src/lib/config/loader.ts index 4e3e058..61bc54b 100644 --- a/src/lib/config/loader.ts +++ b/src/lib/config/loader.ts @@ -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); }