feat: make tryIt presets, limits, badges and buttons completely dynamic from JSON configs

This commit is contained in:
2026-11-04 15:36:30 +05:30
parent de20dd4c7e
commit e5c318099d
21 changed files with 881 additions and 250 deletions
+2 -1
View File
@@ -3,7 +3,8 @@ import { getEndpointById } from '@/lib/catalog/loader';
import { SectionRenderer } from '@/components/sections/SectionRenderer';
import { notFound } from 'next/navigation';
export const revalidate = 600; // ISR 10 minutes fallback per PRD §4.2
export const dynamic = 'force-dynamic';
export const revalidate = 0;
export default function HomePage() {
const page = getPageConfig('home');
+7 -3
View File
@@ -9,6 +9,9 @@ interface ToolPageProps {
params: { slug: string };
}
export const dynamic = 'force-dynamic';
export const revalidate = 0;
export async function generateStaticParams() {
const tools = getAllTools();
return tools.map((t) => ({ slug: t.slug }));
@@ -21,22 +24,23 @@ export async function generateMetadata({ params }: ToolPageProps): Promise<Metad
const name = resolveLocalised(tool.name, 'en');
const summary = resolveLocalised(tool.summary, 'en');
const exampleImg = tool.content?.examples?.[0]?.after || '/brand/og-default.png';
const cleanTitle = (tool.seo?.title || `${name} Free Online`).replace(/ \| CRE Innovations$/, '');
return {
title: tool.seo?.title || `${name} Free Online | CRE Innovations`,
title: cleanTitle,
description: tool.seo?.description || summary,
alternates: {
canonical: `/tools/${tool.slug}`,
},
openGraph: {
title: `${name} Free Online | CRE Innovations`,
title: `${cleanTitle} | CRE Innovations`,
description: summary,
type: 'website',
images: [{ url: exampleImg, width: 800, height: 600, alt: name }],
},
twitter: {
card: 'summary_large_image',
title: `${name} Free Online | CRE Innovations`,
title: `${cleanTitle} | CRE Innovations`,
description: summary,
images: [exampleImg],
},
+3
View File
@@ -3,6 +3,9 @@ import { getPageConfig, getAllTools, getAllApps, getAllCategories } from '@/lib/
import { SectionRenderer } from '@/components/sections/SectionRenderer';
import { notFound } from 'next/navigation';
export const dynamic = 'force-dynamic';
export const revalidate = 0;
export const metadata: Metadata = {
title: 'All AI Photo Tools | Free Online Directory',
description: 'Browse all free online AI photo editing tools: blemish remover, background cutout, photo enhancer, old photo restorer, and anime avatars.',
+23
View File
@@ -0,0 +1,23 @@
'use client';
import React, { createContext, useContext } from 'react';
export interface EditorContextType {
isEditor: boolean;
openInspector: (sectionId?: string, tab?: 'content' | 'items' | 'media' | 'settings') => void;
openToolModal: () => void;
openShowcaseModal: () => void;
updateSectionProps: (sectionId: string, newProps: Record<string, any>) => void;
availableTools: any[];
}
export const EditorContext = createContext<EditorContextType>({
isEditor: false,
openInspector: () => {},
openToolModal: () => {},
openShowcaseModal: () => {},
updateSectionProps: () => {},
availableTools: [],
});
export const useEditor = () => useContext(EditorContext);
@@ -3,7 +3,7 @@
import React, { useRef, useState, useEffect, useCallback } from 'react';
import Link from 'next/link';
import { ArrowRight, Check, Smartphone, ChevronLeft, ChevronRight } from 'lucide-react';
import { DeferredComparison } from '@/components/ui/DeferredComparison';
import { CardBeforeAfterSlider } from '@/components/ui/CardBeforeAfterSlider';
export interface ShowcaseItem {
id: string;
@@ -31,6 +31,7 @@ interface CinematicHorizontalProps {
badge?: string;
subtitle?: string;
items?: ShowcaseItem[];
animationMode?: 'horizontal' | 'vertical';
}
export function CinematicHorizontalScrollSection({
@@ -38,6 +39,7 @@ export function CinematicHorizontalScrollSection({
badge = 'FLAGSHIP TRANSFORMATION MODELS',
subtitle = 'Browse the flagship tools with native cinematic pan controls.',
items = [],
animationMode = 'horizontal',
}: CinematicHorizontalProps) {
const containerRef = useRef<HTMLElement>(null);
const trackRef = useRef<HTMLDivElement>(null);
@@ -180,6 +182,28 @@ export function CinematicHorizontalScrollSection({
if (!items.length) return null;
// Clean fluid vertical stack when horizontal scroll animation is disabled
if (animationMode === 'vertical') {
return (
<section id="flagship-models" className="py-16 sm:py-24 border-y border-slate-900/[0.08] bg-[#FAF8F5]">
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 mb-8 sm:mb-12">
<div className="max-w-2xl">
<p className="eyebrow">{badge}</p>
<h2 className="mt-1 text-2xl font-display font-bold tracking-tight text-slate-900 sm:text-3xl lg:text-4xl">
{title}
</h2>
<p className="mt-1 text-xs text-slate-600 sm:text-sm">{subtitle}</p>
</div>
</div>
<div className="mx-auto max-w-5xl px-4 sm:px-6 lg:px-8 space-y-8">
{items.map((item) => (
<ShowcaseCard key={item.id} item={item} isVertical />
))}
</div>
</section>
);
}
// Fluid vertical scroll distance: 100vh base + 85vh per additional card
const containerHeightVh = 100 + (items.length - 1) * 85;
@@ -261,28 +285,34 @@ export function CinematicHorizontalScrollSection({
);
}
function ShowcaseCard({ item }: { item: ShowcaseItem }) {
function ShowcaseCard({ item, isVertical }: { item: ShowcaseItem; isVertical?: boolean }) {
const comparison = item.variant !== 'banner' && item.beforeUrl && item.afterUrl;
return (
<article className="w-[88vw] shrink-0 overflow-hidden rounded-3xl border border-slate-900/[0.09] bg-white shadow-cream-md sm:w-[680px] lg:w-[780px]">
<article
className={`${
isVertical
? 'w-full'
: 'w-[88vw] shrink-0 sm:w-[680px] lg:w-[780px]'
} overflow-hidden rounded-3xl border border-slate-900/[0.09] bg-white shadow-cream-md`}
>
<div className="grid lg:grid-cols-[1.1fr_.9fr]">
<div className="min-h-[260px] sm:min-h-[290px] bg-slate-100">
<div className="relative min-h-[280px] sm:min-h-[320px] lg:min-h-full h-full bg-slate-950 overflow-hidden">
{comparison ? (
<DeferredComparison
<CardBeforeAfterSlider
beforeUrl={item.beforeUrl!}
afterUrl={item.afterUrl!}
beforeLabel="Original"
afterLabel="CRE result"
aspectRatio="aspect-[4/3] lg:aspect-auto lg:h-full"
beforeLabel="BEFORE"
afterLabel="AI RESULT"
aspectRatio="aspect-[4/3] sm:aspect-[16/10] lg:aspect-auto lg:h-full"
/>
) : (
<div className="relative h-full min-h-[260px] sm:min-h-[290px] overflow-hidden bg-slate-950">
<div className="relative h-full min-h-[280px] sm:min-h-[320px] overflow-hidden bg-slate-950">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
src={item.bannerImage || item.beforeUrl || ''}
alt={item.title}
loading="lazy"
loading="eager"
decoding="async"
className="h-full w-full object-cover"
/>
+42 -57
View File
@@ -31,8 +31,13 @@ interface HeroSectionProps {
variant?: string;
badge?: any;
tryIt?: {
toolRef: string;
toolRef?: string;
ctaText?: string;
samplePresets?: Array<{ label: string; url: string; resultUrl?: string }>;
};
trustBadges?: Array<{ text: string; icon?: string }>;
primaryCta?: { label?: any; href?: string };
secondaryCta?: { label?: any; href?: string };
tool?: ToolItem | null;
homeApp?: AppItem | null;
variants?: VariantSpec[];
@@ -44,17 +49,31 @@ export function HeroSection({
subtitle,
variant = 'centered',
badge,
tryIt,
trustBadges,
primaryCta,
secondaryCta,
tool,
homeApp,
variants = [],
locale = 'en',
}: HeroSectionProps) {
const [mobileTab, setMobileTab] = useState<'upload' | 'compare'>('upload');
const [grainActive, setGrainActive] = useState<boolean>(true);
const resolvedTitle = resolveLocalised(title, locale);
const resolvedSubtitle = resolveLocalised(subtitle, locale);
const resolvedBadge = resolveLocalised(badge, locale);
const primaryCtaLabel = resolveLocalised(primaryCta?.label, locale, 'Explore the tools');
const primaryCtaHref = primaryCta?.href || '/tools';
const secondaryCtaLabel = resolveLocalised(secondaryCta?.label, locale, 'Our apps');
const secondaryCtaHref = secondaryCta?.href || '/apps';
const activeTrustBadges = trustBadges && trustBadges.length > 0 ? trustBadges : [
{ text: 'No account needed' },
{ text: "Photos aren't stored" },
{ text: 'Try with a sample' },
];
if (variant === 'tryit' && tool) {
return (
<section className="relative isolate overflow-hidden pt-28 pb-16 sm:pt-36 sm:pb-24 lg:pt-40 lg:pb-28 bg-[#FAF8F5]">
@@ -78,25 +97,34 @@ export function HeroSection({
/>
<div className="mt-8 flex flex-wrap gap-3">
<Link href="/tools" className="group inline-flex items-center gap-2.5 rounded-full bg-slate-950 px-6 py-3.5 text-sm font-semibold text-white shadow-lg shadow-slate-900/10 transition-all hover:-translate-y-0.5 hover:bg-blue-700 hover:shadow-xl">
Explore the tools <ArrowRight className="h-4 w-4 transition-transform group-hover:translate-x-1" />
<Link href={primaryCtaHref} className="group inline-flex items-center gap-2.5 rounded-full bg-slate-950 px-6 py-3.5 text-sm font-semibold text-white shadow-lg shadow-slate-900/10 transition-all hover:-translate-y-0.5 hover:bg-blue-700 hover:shadow-xl">
{primaryCtaLabel} <ArrowRight className="h-4 w-4 transition-transform group-hover:translate-x-1" />
</Link>
<Link href="/apps" className="inline-flex items-center gap-2 rounded-full border border-slate-300/80 bg-white/75 px-5 py-3.5 text-sm font-semibold text-slate-800 shadow-sm transition-all hover:-translate-y-0.5 hover:border-slate-400 hover:bg-white">
<Smartphone className="h-4 w-4 text-blue-700" /> Our apps
<Link href={secondaryCtaHref} className="inline-flex items-center gap-2 rounded-full border border-slate-300/80 bg-white/75 px-5 py-3.5 text-sm font-semibold text-slate-800 shadow-sm transition-all hover:-translate-y-0.5 hover:border-slate-400 hover:bg-white">
<Smartphone className="h-4 w-4 text-blue-700" /> {secondaryCtaLabel}
</Link>
</div>
<div className="mt-9 flex flex-wrap gap-x-5 gap-y-2 text-xs font-medium text-slate-600">
<span className="inline-flex items-center gap-1.5"><ShieldCheck className="h-4 w-4 text-emerald-700" /> No account needed</span>
<span className="inline-flex items-center gap-1.5"><LockKeyhole className="h-4 w-4 text-emerald-700" /> Photos aren’t stored</span>
<span className="inline-flex items-center gap-1.5"><ImagePlus className="h-4 w-4 text-emerald-700" /> Try with a sample</span>
{activeTrustBadges.map((badgeItem, bIdx) => (
<span key={bIdx} className="inline-flex items-center gap-1.5">
<ShieldCheck className="h-4 w-4 text-emerald-700" /> {badgeItem.text}
</span>
))}
</div>
</div>
<div className="relative min-w-0">
<div className="absolute -inset-4 rounded-[2.25rem] bg-gradient-to-br from-blue-200/50 via-white/30 to-amber-100/60 blur-2xl" />
<div className="relative rounded-[1.8rem] border border-slate-200/90 bg-white/88 p-1.5 shadow-[0_35px_100px_-38px_rgba(32,49,84,0.32)] sm:p-2">
<TryItWidget tool={tool} homeApp={homeApp} variants={variants} locale={locale} />
<TryItWidget
tool={tool}
homeApp={homeApp}
variants={variants}
locale={locale}
samplePresets={tryIt?.samplePresets}
ctaText={tryIt?.ctaText}
/>
</div>
</div>
</div>
@@ -163,52 +191,21 @@ export function HeroSection({
</div>
</div>
{/* Intelligent Mobile Tab Switcher (Visible ONLY on Mobile < 1024px) */}
<div className="flex lg:hidden items-center justify-center mb-6">
<div className="inline-flex rounded-2xl bg-white p-1 border border-slate-200/90 shadow-2xs">
<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-blue-600 text-white shadow-sm'
: 'text-slate-600 hover:text-slate-900'
}`}
>
<UploadCloud className="w-3.5 h-3.5" />
<span>Upload &amp; Try</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>
{/* Intelligent Side-by-Side Tool Studio */}
{/* Unified Tool Studio on Same Page (Upload Studio + Live Transformation Preview) */}
<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 - Made Bigger!) */}
<div className={`lg:col-span-7 flex flex-col ${mobileTab === 'upload' ? 'block' : 'hidden lg:flex'}`}>
{/* Column 1: Spacious, Prominent Upload Studio (lg:col-span-7) */}
<div className="lg:col-span-7 flex flex-col">
<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="lg:col-span-5 flex flex-col" id="transformation-preview">
<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}
@@ -217,18 +214,6 @@ export function HeroSection({
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>
+22 -32
View File
@@ -25,7 +25,8 @@ interface TryItWidgetProps {
variants?: VariantSpec[];
locale?: string;
className?: string;
onSwitchToCompare?: () => void;
samplePresets?: Array<{ label: string; url: string; resultUrl?: string }>;
ctaText?: string;
}
export function TryItWidget({
@@ -34,7 +35,8 @@ export function TryItWidget({
variants = [],
locale = 'en',
className = '',
onSwitchToCompare,
samplePresets,
ctaText,
}: TryItWidgetProps) {
const [selectedFile, setSelectedFile] = useState<File | null>(null);
const [previewUrl, setPreviewUrl] = useState<string | null>(null);
@@ -48,20 +50,22 @@ export function TryItWidget({
const [isDragOver, setIsDragOver] = useState<boolean>(false);
const fileInputRef = useRef<HTMLInputElement>(null);
const samplePresets = [
{
label: 'Sample Photo',
url: (tool as any).media?.before || '/management/pages/home/media/sample_portrait_1.jpg',
},
{
label: 'Natural Studio Model',
url: '/management/pages/home/media/sample_portrait_2.jpg',
},
{
label: 'Vintage Archival Shot',
url: '/management/pages/home/media/sample_portrait_3.jpg',
},
];
const activePresets = samplePresets && samplePresets.length > 0
? samplePresets
: [
{
label: 'Sample Photo',
url: (tool as any).media?.before || '/management/pages/home/media/sample_portrait_1.jpg',
},
{
label: 'Natural Studio Model',
url: '/management/pages/home/media/sample_portrait_2.jpg',
},
{
label: 'Vintage Archival Shot',
url: '/management/pages/home/media/sample_portrait_3.jpg',
},
];
const handleFileChange = (file: File) => {
const maxMB = tool.tryIt?.limits?.maxMB || 12;
@@ -250,7 +254,7 @@ export function TryItWidget({
Or test instantly with a sample photo:
</p>
<div className="flex flex-wrap gap-2.5">
{samplePresets.map((preset, idx) => (
{activePresets.map((preset, idx) => (
<button
key={idx}
onClick={() => loadSamplePreset(preset.url)}
@@ -262,20 +266,6 @@ export function TryItWidget({
))}
</div>
</div>
{/* Mobile Link to Preview Comparison */}
{onSwitchToCompare && (
<div className="pt-2 md:hidden">
<button
type="button"
onClick={onSwitchToCompare}
className="w-full py-2.5 px-3 rounded-xl text-xs font-semibold text-slate-600 bg-slate-50 hover:bg-slate-100 border border-slate-200 flex items-center justify-center gap-2 transition-colors"
>
<SlidersHorizontal className="w-3.5 h-3.5 text-blue-600" />
<span>View Model Transformation Preview</span>
</button>
</div>
)}
</div>
)}
@@ -341,7 +331,7 @@ export function TryItWidget({
className="w-full py-4 px-6 rounded-2xl font-bold text-xs sm:text-sm text-white bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 shadow-md shadow-blue-500/25 transition-all flex items-center justify-center gap-2 active:scale-98"
>
<Sparkles className="w-4 h-4 text-white" />
<span>Run {resolveLocalised(tool.name, locale)}</span>
<span>{ctaText || `Run ${resolveLocalised(tool.name, locale)}`}</span>
</button>
</div>
</div>
+169 -47
View File
@@ -15,73 +15,195 @@ export function BrandLogo({
asLink = true,
}: BrandLogoProps) {
const iconDimensions = {
sm: { w: 32, h: 32, textScale: 'text-base', subText: 'text-[7px]' },
md: { w: 40, h: 40, textScale: 'text-xl', subText: 'text-[9px]' },
lg: { w: 52, h: 52, textScale: 'text-2xl', subText: 'text-[11px]' },
sm: { w: 34, h: 34, textScale: 'text-base', subText: 'text-[7px]' },
md: { w: 42, h: 42, textScale: 'text-xl', subText: 'text-[9px]' },
lg: { w: 54, h: 54, textScale: 'text-2xl', subText: 'text-[11px]' },
}[size];
const content = (
<div className={`group flex items-center gap-3 select-none ${className}`}>
{/* Precision Geometric Aperture Emblem */}
{/* Animated Bright Quantum Prism Emblem */}
<div
className="relative flex items-center justify-center shrink-0 transition-transform duration-300 group-hover:scale-105"
style={{ width: iconDimensions.w, height: iconDimensions.h }}
>
{/* Subtle Ambient Hover Glow */}
<div className="absolute inset-0 rounded-full bg-gradient-to-tr from-blue-500/10 via-cyan-500/10 to-indigo-500/10 blur-md opacity-0 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none" />
{/* Dynamic Multi-Color Neon Ambient Glow */}
<div className="absolute -inset-1 rounded-2xl bg-gradient-to-tr from-cyan-400 via-blue-500 to-fuchsia-500 opacity-45 blur-md group-hover:opacity-90 group-hover:blur-lg transition-all duration-500 animate-pulse pointer-events-none" />
<svg
viewBox="0 0 100 100"
fill="none"
className="w-full h-full drop-shadow-[0_2px_8px_rgba(37,99,235,0.25)]"
>
<defs>
<linearGradient id="bl-blue-cyan" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#2563EB" />
<stop offset="100%" stopColor="#0284C7" />
</linearGradient>
<linearGradient id="bl-purple-pink" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#7C3AED" />
<stop offset="100%" stopColor="#EC4899" />
</linearGradient>
<linearGradient id="bl-teal-emerald" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#059669" />
<stop offset="100%" stopColor="#0284C7" />
</linearGradient>
<radialGradient id="bl-core-light" cx="50%" cy="50%" r="50%">
<stop offset="0%" stopColor="#FFFFFF" />
<stop offset="45%" stopColor="#38BDF8" stopOpacity="0.9" />
<stop offset="100%" stopColor="#0284C7" stopOpacity="0" />
</radialGradient>
</defs>
{/* Glossy Bezel Container */}
<div className="relative w-full h-full rounded-2xl overflow-hidden bg-slate-950 p-[1.5px] shadow-[0_4px_20px_-4px_rgba(56,189,248,0.5)] border border-white/30 group-hover:border-cyan-400/80 transition-all duration-300">
<svg
viewBox="0 0 100 100"
fill="none"
className="w-full h-full"
xmlns="http://www.w3.org/2000/svg"
>
<defs>
{/* Vibrant Prismatic Gradients */}
<linearGradient id="cre-bright-cyan" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#00F5FF" />
<stop offset="100%" stopColor="#2563EB" />
</linearGradient>
{/* Precision outer neural ring */}
<circle cx="50" cy="50" r="44" stroke="rgba(15, 23, 42, 0.12)" strokeWidth="1.5" strokeDasharray="3 5" />
<linearGradient id="cre-bright-purple" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#A855F7" />
<stop offset="100%" stopColor="#EC4899" />
</linearGradient>
{/* Aperture Tri-blade Geometry */}
<path d="M 50 14 C 68 14, 82 26, 84 44 C 74 38, 62 38, 50 44 C 42 34, 46 22, 50 14 Z" fill="url(#bl-blue-cyan)" opacity="0.95" />
<path d="M 84 56 C 80 74, 66 84, 50 86 C 54 74, 50 62, 40 54 C 52 48, 66 48, 84 56 Z" fill="url(#bl-purple-pink)" opacity="0.95" />
<path d="M 38 82 C 22 76, 14 62, 16 44 C 26 50, 38 48, 48 42 C 46 56, 44 70, 38 82 Z" fill="url(#bl-teal-emerald)" opacity="0.95" />
<linearGradient id="cre-bright-gold" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#F59E0B" />
<stop offset="100%" stopColor="#FACC15" />
</linearGradient>
{/* Neural Ray Intersections */}
<path d="M 50 20 L 76 68 L 24 68 Z" stroke="#FFFFFF" strokeWidth="1.5" fill="none" opacity="0.8" />
<linearGradient id="cre-bright-teal" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#10B981" />
<stop offset="100%" stopColor="#06B6D4" />
</linearGradient>
{/* Glowing Optical Core */}
<circle cx="50" cy="52" r="13" fill="url(#bl-core-light)" />
<circle cx="50" cy="52" r="4" fill="#FFFFFF" />
{/* Core Star Bloom Flare */}
<radialGradient id="cre-star-bloom" cx="50%" cy="50%" r="50%">
<stop offset="0%" stopColor="#FFFFFF" />
<stop offset="35%" stopColor="#38BDF8" stopOpacity="0.95" />
<stop offset="70%" stopColor="#818CF8" stopOpacity="0.4" />
<stop offset="100%" stopColor="#0284C7" stopOpacity="0" />
</radialGradient>
{/* Apex Nodes */}
<circle cx="50" cy="20" r="2.5" fill="#0284C7" />
<circle cx="76" cy="68" r="2.5" fill="#7C3AED" />
<circle cx="24" cy="68" r="2.5" fill="#059669" />
</svg>
{/* Diagonal Light Shimmer Sweep */}
<linearGradient id="cre-shimmer-sweep" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stopColor="#FFFFFF" stopOpacity="0" />
<stop offset="50%" stopColor="#FFFFFF" stopOpacity="0.75" />
<stop offset="100%" stopColor="#FFFFFF" stopOpacity="0" />
</linearGradient>
{/* Deep Space Radial Base */}
<radialGradient id="cre-bg-cosmic" cx="50%" cy="50%" r="50%">
<stop offset="0%" stopColor="#1E293B" />
<stop offset="60%" stopColor="#0F172A" />
<stop offset="100%" stopColor="#020617" />
</radialGradient>
</defs>
<style>{`
@keyframes cre-orbit-cw {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@keyframes cre-orbit-ccw {
from { transform: rotate(360deg); }
to { transform: rotate(0deg); }
}
@keyframes cre-pulse-star {
0%, 100% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(56,189,248,0.9)); }
50% { transform: scale(1.08); filter: drop-shadow(0 0 14px rgba(236,72,153,1)); }
}
@keyframes cre-shimmer-slide {
0%, 20% { transform: translate(-80px, -80px) rotate(45deg); opacity: 0; }
40% { opacity: 0.9; }
60%, 100% { transform: translate(80px, 80px) rotate(45deg); opacity: 0; }
}
.cre-anim-orbit {
transform-origin: 50px 50px;
animation: cre-orbit-cw 14s linear infinite;
}
.cre-anim-orbit-reverse {
transform-origin: 50px 50px;
animation: cre-orbit-ccw 10s linear infinite;
}
.cre-anim-core {
transform-origin: 50px 50px;
animation: cre-pulse-star 3s ease-in-out infinite;
}
.cre-anim-shimmer {
animation: cre-shimmer-slide 4.5s ease-in-out infinite;
}
`}</style>
{/* Cosmic Background Disc */}
<circle cx="50" cy="50" r="48" fill="url(#cre-bg-cosmic)" />
{/* Outer Orbiting Energy Ring (Clockwise) */}
<g className="cre-anim-orbit">
<circle
cx="50"
cy="50"
r="41"
stroke="rgba(56, 189, 248, 0.45)"
strokeWidth="1.5"
strokeDasharray="4 6"
/>
{/* Orbiting Photon Nodes */}
<circle cx="50" cy="9" r="3" fill="#00F5FF" filter="drop-shadow(0 0 4px #00F5FF)" />
<circle cx="91" cy="50" r="2.5" fill="#EC4899" filter="drop-shadow(0 0 4px #EC4899)" />
<circle cx="15" cy="70" r="2.5" fill="#FACC15" filter="drop-shadow(0 0 4px #FACC15)" />
</g>
{/* Inner Counter-Orbiting Quantum Track */}
<g className="cre-anim-orbit-reverse">
<circle
cx="50"
cy="50"
r="33"
stroke="rgba(168, 85, 247, 0.35)"
strokeWidth="1"
strokeDasharray="2 4"
/>
<circle cx="73" cy="27" r="2" fill="#38BDF8" />
<circle cx="27" cy="73" r="2" fill="#A855F7" />
</g>
{/* Faceted Quantum Crystal Prism (8-Point Isometric Star) */}
<g className="cre-anim-core">
{/* North Facet: Electric Cyan */}
<polygon points="50,16 62,38 50,50 38,38" fill="url(#cre-bright-cyan)" opacity="0.95" />
{/* East Facet: Electric Purple / Magenta */}
<polygon points="84,50 62,62 50,50 62,38" fill="url(#cre-bright-purple)" opacity="0.95" />
{/* South Facet: Solar Amber / Gold */}
<polygon points="50,84 38,62 50,50 62,62" fill="url(#cre-bright-gold)" opacity="0.95" />
{/* West Facet: Vibrant Emerald / Teal */}
<polygon points="16,50 38,38 50,50 38,62" fill="url(#cre-bright-teal)" opacity="0.95" />
{/* Diagonal Crystalline Diamond Corner Facets */}
<polygon points="50,50 62,38 72,28 62,28" fill="#38BDF8" opacity="0.8" />
<polygon points="50,50 62,62 72,72 72,62" fill="#EC4899" opacity="0.8" />
<polygon points="50,50 38,62 28,72 38,72" fill="#FACC15" opacity="0.8" />
<polygon points="50,50 38,38 28,28 28,38" fill="#10B981" opacity="0.8" />
{/* Geometric Fine Crystal Ridge Wireframe */}
<line x1="50" y1="16" x2="50" y2="84" stroke="#FFFFFF" strokeWidth="1.2" opacity="0.85" />
<line x1="16" y1="50" x2="84" y2="50" stroke="#FFFFFF" strokeWidth="1.2" opacity="0.85" />
<line x1="26" y1="26" x2="74" y2="74" stroke="#FFFFFF" strokeWidth="0.8" opacity="0.6" />
<line x1="74" y1="26" x2="26" y2="74" stroke="#FFFFFF" strokeWidth="0.8" opacity="0.6" />
{/* Radiant Supernova Core Bloom */}
<circle cx="50" cy="50" r="14" fill="url(#cre-star-bloom)" />
<circle cx="50" cy="50" r="5" fill="#FFFFFF" filter="drop-shadow(0 0 5px #FFFFFF)" />
{/* Central 4-Point Micro Diamond Glint */}
<polygon points="50,42 52,50 50,58 48,50" fill="#FFFFFF" />
<polygon points="42,50 50,52 58,50 50,48" fill="#FFFFFF" />
</g>
{/* Sweeping Specular Caustic Glint */}
<rect
x="20"
y="-40"
width="60"
height="20"
fill="url(#cre-shimmer-sweep)"
className="cre-anim-shimmer pointer-events-none"
/>
</svg>
</div>
</div>
{/* Typographic Wordmark */}
{showWordmark && (
<div className="flex flex-col">
<div className="flex items-center tracking-tight leading-none">
<span className={`font-display font-black text-transparent bg-clip-text bg-gradient-to-r from-blue-700 to-indigo-600 tracking-[0.1em] text-3d-gradient ${iconDimensions.textScale}`}>
<span className={`font-display font-black text-transparent bg-clip-text bg-gradient-to-r from-blue-700 via-indigo-600 to-cyan-600 tracking-[0.1em] text-3d-gradient ${iconDimensions.textScale}`}>
CRE
</span>
<span className={`font-display font-bold text-slate-900 tracking-[0.16em] ml-1.5 text-3d-chiseled ${iconDimensions.textScale}`}>
+2 -2
View File
@@ -157,7 +157,7 @@ export function CardBeforeAfterSlider({
<img
src={afterUrl}
alt="AI enhanced result"
loading="lazy"
loading="eager"
decoding="async"
className="absolute inset-0 h-full w-full object-cover pointer-events-none"
/>
@@ -171,7 +171,7 @@ export function CardBeforeAfterSlider({
<img
src={beforeUrl}
alt="Original input"
loading="lazy"
loading="eager"
decoding="async"
className="absolute inset-0 h-full w-full object-cover"
/>
+3
View File
@@ -67,6 +67,9 @@ export function isSectionVisible(
section: SectionConfig,
currentContext: { device?: 'mobile' | 'desktop'; locale?: string; flags?: Record<string, boolean> }
): boolean {
if ((section as any).disabled === true || (section as any).enabled === false) {
return false;
}
if (!section.visibleWhen) return true;
const { device, locale, flag } = section.visibleWhen;
+2
View File
@@ -50,6 +50,7 @@ export function getPageConfig(slug: string): PageConfig | null {
}
export function getAllTools(): ToolItem[] {
toolsCache.clear();
// 1. Prioritize management/pages/tools/[slug]/tool.config.json
const mgmtToolsDir = path.join(MANAGEMENT_DIR, 'pages', 'tools');
if (fs.existsSync(mgmtToolsDir)) {
@@ -103,6 +104,7 @@ export function getToolById(id: string): ToolItem | null {
}
export function getAllApps(): AppItem[] {
appsCache.clear();
// 1. Prioritize management/apps/[slug]/app.config.json
const mgmtAppsDir = path.join(MANAGEMENT_DIR, 'apps');
if (fs.existsSync(mgmtAppsDir)) {
+2
View File
@@ -83,6 +83,8 @@ export interface SectionConfig {
id: string;
type: string;
variant?: string;
disabled?: boolean;
enabled?: boolean;
props: Record<string, any>;
visibleWhen?: {
device?: 'mobile' | 'desktop';