'use client'; import React, { useState, useEffect } from 'react'; import Link from 'next/link'; import dynamic from 'next/dynamic'; import { Sparkles, ArrowRight, Smartphone, ShieldCheck, Cpu, Zap, Layers } from 'lucide-react'; import { ToolItem, VariantSpec, resolveLocalised } from '@/types'; import { TryItWidget } from './TryItWidget'; import { CardBeforeAfterSlider } from '@/components/ui/CardBeforeAfterSlider'; import { BorderBeam } from '@/components/magicui/border-beam'; import { LightRays } from '@/components/magicui/light-rays'; import { RainbowButton } from '@/components/magicui/rainbow-button'; import { InteractiveHoverButton } from '@/components/magicui/interactive-hover-button'; import { BlurFade } from '@/components/magicui/blur-fade'; import { KineticText } from '@/components/magicui/kinetic-text'; import { AnimatedShinyText } from '@/components/magicui/animated-shiny-text'; import { TextAnimate } from '@/components/magicui/text-animate'; import { cn } from '@/lib/utils'; /** * Interactive Hero Headline Item: * - At first: Magic UI TextAnimate character entrance (blurInUp stagger) * - After hovering: Magic UI AnimatedShinyText specular shimmer reflection * - 0% text shift: unified single DOM node with zero layout jitter */ function HeroHeadlineItem({ text, delay = 0, }: { text: string; delay?: number; }) { const [isEntranceDone, setIsEntranceDone] = useState(false); useEffect(() => { const timer = setTimeout(() => { setIsEntranceDone(true); }, (delay + 0.75) * 1000); return () => clearTimeout(timer); }, [delay]); return ( {isEntranceDone ? ( {text} ) : ( {text} )} ); } interface HeroSectionProps { title?: Record | string; badge?: Record | string; subtitle?: Record | string; primaryCta?: { label?: Record | string; href?: string }; secondaryCta?: { label?: Record | string; href?: string }; variant?: string; tool?: ToolItem; homeApp?: any; variants?: VariantSpec[]; locale?: string; } export function HeroSection({ title, badge, subtitle, primaryCta, secondaryCta, variant = 'frontpage', tool, homeApp, variants = [], locale = 'en', }: HeroSectionProps) { const primaryCtaLabel = resolveLocalised(primaryCta?.label, locale, 'Explore our tools'); const primaryCtaHref = primaryCta?.href || '#our-tools'; const secondaryCtaLabel = resolveLocalised(secondaryCta?.label, locale, 'Mobile studio apps'); const secondaryCtaHref = secondaryCta?.href || '#recommended-apps'; // 1. Tool Detail Page Hero (/tools/[slug]) — Where actual operations live if (variant === 'toolHero' && tool) { 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 ( {/* Subtle Ambient Studio Background */} {/* Breadcrumb Navigation */} Home / Tools / {resolveLocalised(tool.name, locale)} {/* Heading Block */} Studio neural vision {resolveLocalised(tool.name, locale)} {resolveLocalised(tool.summary, locale)} {/* Studio Workspace: Upload Studio on Left, Comparison on Right */} {/* Upload Studio */} Interactive tool studio Zero server retention {/* Specimen View */} Transformation specimen Drag slider to inspect details Full 4K batch processing available in the {homeApp ? resolveLocalised(homeApp.name, locale) : 'mobile app'}. ); } // 2. Centered Directory Hero (for /tools, /apps, /pricing, /trust) if (variant === 'centered') { const resolvedTitle = resolveLocalised(title, locale) || 'Creative studio'; const resolvedSubtitle = resolveLocalised(subtitle, locale); return ( {/* Layered Studio Lighting Ambient Glow */} {/* Layered Light Rays */} Studio Neural Directory Direct browser trials {resolvedTitle} {resolvedSubtitle && ( {resolvedSubtitle} )} {/* Studio Capability Highlights */} 12 neural models Zero server storage Live comparison sliders Browse all tools ); } // 3. Front Page Hero (Pure Website Intro, UI, and Animations — NO IMAGE FUNCTIONS, NO OPERATIONS) return ( {/* Background Layer 1: High-Resolution Responsive Background Image */} {/* Dynamic Studio Gradient Feathering (Light Theme Porcelain Scrims) */} {/* Top Edge Feathering */} {/* Left Side Scrim for Desktop: Ensures 100% typography contrast while keeping the photography vibrant */} {/* Mobile Scrim: Studio porcelain gradient covering headline, subtitle, and action buttons (top 70%), transitioning smoothly into vibrant photography */} {/* Soft Bottom Fade */} {/* Background Layer 2: Magic UI Atmospheric Light Rays */} {/* Background Layer 3: Fine Dot Matrix Pattern */} {/* Content Container (Website Introduction, Visual Hierarchy, Kinetic Motion) */} {/* Masterpiece 3-Line Headline: Line 1: Imagine. -> Magic UI TextAnimate on first, AnimatedShinyText on hover Line 2: Transform. -> Magic UI TextAnimate on first, AnimatedShinyText on hover Line 3: Create Impossible -> Simple bluish-purple accent */} Imagine. Transform. Create Impossible. {/* Line 1 - Imagine. with Magic UI TextAnimate (black) -> AnimatedShinyText on hover */} {/* Line 2 - Transform. with Magic UI TextAnimate (black) -> AnimatedShinyText on hover */} {/* Line 3 - Create Impossible: Simple bluish-purple accent text */} Create Impossible {/* Subtitle */} Turn ordinary moments into extraordinary visual art. Instant and private photo transformation right in your browser with hardware acceleration. {/* Action Buttons: Redesigned with RainbowButton & InteractiveHoverButton */} {primaryCtaLabel} ); }
{resolveLocalised(tool.summary, locale)}
{resolvedSubtitle}
Turn ordinary moments into extraordinary visual art. Instant and private photo transformation right in your browser with hardware acceleration.