fix: resolve homepage and tools hero inversion, remove acne references, restore centered directory heroes across all routes

This commit is contained in:
2026-11-05 11:01:09 +05:30
parent 6300cd9cc9
commit 3390175f0d
12 changed files with 75 additions and 37 deletions
+1 -11
View File
@@ -1,6 +1,5 @@
import React from 'react';
import { getPageConfig, getAllTools, getAllApps, getAllCategories, getToolById, getAppById, getSiteConfig } from '@/lib/config/loader';
import { getEndpointById } from '@/lib/catalog/loader';
import { getPageConfig, getAllTools, getAllApps, getAllCategories, getSiteConfig } from '@/lib/config/loader';
import { SectionRenderer } from '@/components/sections/SectionRenderer';
import { notFound } from 'next/navigation';
@@ -16,20 +15,11 @@ export default function HomePage() {
const categories = getAllCategories();
const siteUrl = (process.env.SITE_URL || getSiteConfig().seo.siteUrl || 'http://localhost:3000').replace(/\/$/, '');
// Find hero tool and variants
const heroTool = getToolById('face.blemish.remove') || tools[0];
const heroApp = heroTool ? getAppById(heroTool.homeApp) : null;
const endpoint = heroTool?.tryIt?.endpointRef?.id ? getEndpointById(heroTool.tryIt.endpointRef.id) : undefined;
const variants = endpoint?.variants || [];
const context = {
page,
tools,
apps,
categories,
tool: heroTool,
homeApp: heroApp,
variants,
locale: 'en',
};
+1 -1
View File
@@ -24,7 +24,7 @@ export function AppPickerSection({
{
id: 'portrait',
title: 'Portraits, Selfies & Skin Beauty',
desc: 'Acne, blemish removal, teeth whitening, eye redness',
desc: 'Skin retouching, blemish removal, teeth whitening, eye refinement',
icon: Smile,
appSlug: 'portrait-app',
},
+52 -3
View File
@@ -41,6 +41,7 @@ export function HeroSection({
subtitle,
primaryCta,
secondaryCta,
variant = 'frontpage',
tool,
homeApp,
variants = [],
@@ -54,8 +55,8 @@ export function HeroSection({
const secondaryCtaLabel = resolveLocalised(secondaryCta?.label, locale, 'Mobile App Studio');
const secondaryCtaHref = secondaryCta?.href || '#recommended-apps';
// Dedicated Tool Detail Page Hero (when viewing a specific tool page like /tools/[slug])
if (tool) {
// 1. Dedicated Tool Detail Page Hero (when viewing /tools/[slug] with variant='toolHero')
if (variant === 'toolHero' && tool) {
const appName = homeApp ? resolveLocalised(homeApp.name, locale) : 'Mobile App';
const toolMedia = (tool as any).media;
const primaryExample = tool.content?.examples?.[0] || {
@@ -207,8 +208,56 @@ export function HeroSection({
);
}
// 2. Centered Directory & Info Page Hero (for /tools, /apps, /pricing, /trust, /privacy, /terms)
if (variant === 'centered') {
const resolvedTitle = resolveLocalised(title, locale) || 'Creative Studio';
const resolvedSubtitle = resolveLocalised(subtitle, locale);
return (
<section className="relative overflow-hidden pt-28 pb-16 sm:pt-36 sm:pb-20 text-center bg-[#FAF8F5] border-b border-slate-900/[0.07]">
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-full max-w-7xl h-96 bg-gradient-to-b from-blue-500/[0.04] to-transparent blur-3xl pointer-events-none -z-10" />
<div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 space-y-6 relative z-10">
{resolvedBadge && (
<div className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-blue-50 border border-blue-200 text-xs font-mono font-semibold text-blue-700 shadow-sm">
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
<span>{resolvedBadge}</span>
</div>
)}
<h1 className="text-4xl sm:text-5xl lg:text-6xl font-display font-black text-slate-900 tracking-tight leading-tight">
{resolvedTitle}
</h1>
{resolvedSubtitle && (
<p className="text-base sm:text-lg text-slate-600 max-w-2xl mx-auto leading-relaxed font-sans">
{resolvedSubtitle}
</p>
)}
<div className="flex flex-wrap items-center justify-center gap-4 pt-3">
<Link
href="/#our-tools"
className="inline-flex items-center gap-2 px-6 py-3 rounded-full font-bold text-xs sm:text-sm text-white bg-slate-950 hover:bg-blue-600 shadow-sm transition-all hover:scale-105 active:scale-95"
>
<span>Explore Studio Suite</span>
<ArrowRight className="w-4 h-4" />
</Link>
<Link
href="/apps"
className="inline-flex items-center gap-2 px-6 py-3 rounded-full font-bold text-xs sm:text-sm text-slate-700 bg-white border border-slate-200 hover:bg-slate-50 transition-colors shadow-sm"
>
<Smartphone className="w-4 h-4 text-blue-600" />
<span>Mobile Apps Suite</span>
</Link>
</div>
</div>
</section>
);
}
// -------------------------------------------------------------
// Pure Front Page Hero View:
// 3. Pure Front Page Hero View (for homepage /):
// ONLY Animated Text, 3D WebGL Prism, Particles, Radiant Colors & Effects
// Zero tool names, zero tool selection, zero feature lists
// -------------------------------------------------------------
@@ -51,7 +51,7 @@ const flagshipBanners: FlagshipBanner[] = [
latency: '< 380ms Stream',
title: 'Sub-Pore Skin Retouching & Blemish Removal',
tagline: 'Natural texture preservation without artificial plastic smoothing.',
description: 'Unlike standard beauty filters that smear your face into plastic, RetouchGAN operates at the dermal level—erasing acne, blemishes, and under-eye redness while reconstructing microscopic skin pore geometry.',
description: 'Unlike standard beauty filters that smear your face into plastic, RetouchGAN operates at the dermal level—erasing blemishes, redness, and discoloration while reconstructing microscopic skin pore geometry.',
toolSlug: 'blemish-remover',
appSlug: 'portrait-app',
appName: 'Portrait Studio AI',
@@ -59,7 +59,7 @@ const flagshipBanners: FlagshipBanner[] = [
afterUrl: '/management/pages/home/media/showcase_02_portrait_after.jpg',
benefits: [
'Microscopic skin pore texture retained',
'Instant acne, scar & discoloration repair',
'Instant blemish, scar & discoloration repair',
'Authentic skin tone & micro-pore retention',
],
align: 'right',
@@ -18,7 +18,7 @@ const REVIEWS_ROW_1 = [
role: 'Editorial Portrait Photographer',
rating: 5,
avatar: 'ER',
body: 'The blemish remover is lightyears ahead of typical automated tools. It removes red spots and acne while keeping real pores and skin texture intact.',
body: 'The blemish remover is lightyears ahead of typical automated tools. It removes red spots and imperfections while keeping real pores and skin texture intact.',
tool: 'Blemish Remover',
},
{
+1 -2
View File
@@ -77,12 +77,11 @@ function SectionContent({ section, context }: SectionRendererProps) {
switch (section.type) {
case 'hero': {
const isHomePage = (context.page?.slug === 'home' || context.page?.id === 'home') && !context.tool;
return (
<HeroSection
{...resolvedProps}
variant={section.variant}
tool={isHomePage ? undefined : (context.tool || undefined)}
tool={context.tool || undefined}
homeApp={context.homeApp || undefined}
variants={context.variants}
locale={locale}
@@ -31,7 +31,7 @@ export const DEFAULT_TOOL_ITEMS: ToolMediaItem[] = [
{
id: 'tool-blemish',
slug: 'blemish-remover',
title: 'Blemish & Acne Remover',
title: 'Skin & Blemish Retoucher',
mediaType: 'comparison',
beforeUrl: '/management/pages/home/media/landscape_blemish_before.jpg',
afterUrl: '/management/pages/home/media/landscape_blemish_after.jpg',
@@ -31,7 +31,7 @@ const useCases: UseCaseCard[] = [
{
title: 'Studio Portraits & Beauty Retouching',
category: 'Headshots & Beauty',
desc: 'Remove blemishes, acne, scars, and under-eye discoloration while safeguarding natural skin pore texture without the artificial plastic blur.',
desc: 'Remove blemishes, spots, scars, and under-eye discoloration while safeguarding natural skin pore texture without the artificial plastic blur.',
toolSlug: 'blemish-remover',
toolName: 'AI Blemish Remover',
icon: Camera,