'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 */}
); } // 2. Centered Directory Hero (for /tools, /apps, /pricing, /trust) if (variant === 'centered') { const resolvedTitle = resolveLocalised(title, locale) || 'Creative studio'; const resolvedSubtitle = resolveLocalised(subtitle, locale); const isTrustOrPrivacy = resolvedTitle.toLowerCase().includes('trust') || resolvedTitle.toLowerCase().includes('privacy') || resolvedTitle.toLowerCase().includes('security'); return (
{/* Layered Studio Lighting Ambient Glow */}
); } // 3. Front Page Hero (Pure Website Intro, UI, and Animations — NO IMAGE FUNCTIONS, NO OPERATIONS) return (
{/* Background Layer 1: High-Resolution Responsive Background Image */}
CRE Innovations Photo Studio {/* Dynamic Studio Gradient Feathering (Light Theme Porcelain Scrims) */} {/* Left Side Scrim for Desktop: Ensures 100% typography contrast while keeping the photography vibrant */}
{/* Ultra-Deep Soft Bottom Fade: Seamlessly dissolves into pure white/porcelain theme */}
{/* Background Layer 2: Magic UI Atmospheric Light Rays */} {/* Background Layer 3: Fine Dot Matrix Pattern */}
); }