feat(ui): refine homepage and improve core interactions

This commit is contained in:
2026-11-03 18:30:13 +05:30
parent 561718870b
commit f9c98a87b4
3 changed files with 71 additions and 102 deletions
+37 -97
View File
@@ -2,14 +2,13 @@
import React from 'react';
import Link from 'next/link';
import { Sparkles, ArrowRight, Smartphone, Layers, Zap } from 'lucide-react';
import { Sparkles, ArrowRight, Smartphone, Layers, ShieldCheck, LockKeyhole, ImagePlus } from 'lucide-react';
import { resolveLocalised, ToolItem, AppItem, VariantSpec } from '@/types';
import { TryItWidget } from './TryItWidget';
import { Hero3DCanvas } from '@/components/3d/Hero3DCanvas';
import { Kinetic3DText } from '@/components/ui/Kinetic3DText';
import { ShimmerBadge } from '@/components/animate-ui/ShimmerBadge';
import { BorderBeam } from '@/components/animate-ui/BorderBeam';
import { MorphingText } from '@/components/animate-ui/MorphingText';
interface HeroSectionProps {
title?: any;
@@ -41,108 +40,49 @@ export function HeroSection({
if (variant === 'tryit' && tool) {
return (
<section className="relative overflow-hidden pt-24 pb-20 sm:pt-32 sm:pb-28 lg:pt-36 lg:pb-32 bg-[#FAF8F5]">
{/* Ambient Radial Lighting Glow */}
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-full max-w-7xl h-[450px] bg-gradient-to-b from-blue-500/[0.04] via-indigo-500/[0.03] to-transparent blur-3xl pointer-events-none -z-10" />
<section className="relative isolate overflow-hidden pt-28 pb-16 sm:pt-36 sm:pb-24 lg:pt-40 lg:pb-28 bg-[#FAF8F5]">
<div className="absolute inset-x-0 top-0 h-[620px] bg-[radial-gradient(ellipse_at_72%_18%,rgba(87,132,220,0.14),transparent_48%),radial-gradient(ellipse_at_12%_0%,rgba(208,182,142,0.12),transparent_36%)] pointer-events-none" />
<div className="absolute right-[4%] top-12 w-[360px] h-[360px] opacity-35 pointer-events-none hidden lg:block" aria-hidden="true">
<Hero3DCanvas className="w-full h-full" />
</div>
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
{/* Subtle Massive 3D Background Typographic Watermark (Enigma Style) */}
<div
className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-max select-none pointer-events-none opacity-[0.04] -z-20 preserve-3d"
style={{ transform: 'perspective(1000px) rotateX(10deg)' }}
aria-hidden="true"
>
<span className="text-[14vw] font-display font-black tracking-tighter text-slate-950 uppercase leading-none block">
CRE INNOVATIONS // NEURAL VISION
</span>
</div>
<div className="relative z-10 max-w-[1440px] mx-auto px-4 sm:px-6 lg:px-10">
<div className="grid lg:grid-cols-[0.82fr_1.18fr] gap-10 xl:gap-16 items-center">
<div className="max-w-xl">
<div className="inline-flex items-center gap-2 rounded-full border border-blue-200/80 bg-white/75 px-3.5 py-2 text-[11px] font-semibold tracking-[0.12em] uppercase text-blue-800 shadow-sm backdrop-blur">
<Sparkles className="w-3.5 h-3.5" />
<span>{resolvedBadge || 'A calmer way to create'}</span>
</div>
{/* 3D Ambient Kinetic Prism Floating Behind Header */}
<div className="absolute top-12 left-1/2 -translate-x-1/2 w-[320px] h-[320px] pointer-events-none -z-10 opacity-70 hidden md:block">
<Hero3DCanvas className="w-full h-full" />
</div>
<Kinetic3DText
primaryText="Make every photo"
highlightText="feel finished."
subtitle={resolvedSubtitle}
className="mt-7 text-left [&_h1]:text-left [&_h1]:text-[2.7rem] sm:[&_h1]:text-6xl lg:[&_h1]:text-[4.25rem] [&_h1]:leading-[1.02] [&_p]:mx-0 [&_p]:mt-5 [&_p]:max-w-lg [&_p]:text-base [&_p]:sm:text-lg"
/>
{/* Main Hero Header */}
<div className="text-center max-w-4xl mx-auto space-y-6 mb-10 sm:mb-14 relative z-10">
{/* Live Core Status & Animate UI Shimmer Badge */}
<div className="flex flex-wrap items-center justify-center gap-2.5">
<ShimmerBadge>
<span className="relative flex h-2 w-2 mr-1">
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-blue-500 opacity-75"></span>
<span className="relative inline-flex rounded-full h-2 w-2 bg-blue-600"></span>
</span>
<span>{resolvedBadge || 'NEXT-GEN NEURAL STUDIO v4.2'}</span>
</ShimmerBadge>
<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>
<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>
</div>
<div className="hidden sm:inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-amber-50/80 border border-amber-200/60 text-[11px] font-mono font-bold text-amber-800 shadow-sm">
<span>FP16 LOSSLESS PIPELINE</span>
<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>
</div>
</div>
{/* 3D Kinetic Interactive Typography */}
<Kinetic3DText
primaryText="Transform Photos with"
highlightText="Next-Gen Neural AI"
subtitle={resolvedSubtitle}
/>
{/* Pixelcut-Style Dynamic Morphing Capability Bar */}
<div className="flex flex-wrap items-center justify-center gap-2 pt-1 pb-1">
<span className="text-xs font-mono text-slate-500 font-semibold mr-1">Live Engine Focus:</span>
<span className="inline-flex items-center px-3 py-1 rounded-full bg-white border border-blue-200 text-blue-700 text-xs font-mono font-bold shadow-sm">
<MorphingText
texts={[
'Sub-Pore Skin Texture Retouching ✦',
'0.02px Flyaway Hair Strand Matting ✦',
'4K Generative Facial Super-Resolution ✦',
'Historical Emulsion Tear Inpainting ✦',
'Manga Vector Dynamic Cel Shading ✦',
'64-Channel Deep Spectral Colorization ✦',
]}
interval={2600}
/>
</span>
</div>
{/* Pixelcut-Style Interactive Tool Chips */}
<div className="flex flex-wrap items-center justify-center gap-2 pt-1">
<Link
href="/tools/blemish-remover"
className="px-3.5 py-1.5 rounded-full bg-white hover:bg-blue-50 border border-slate-200 hover:border-blue-300 text-xs font-semibold text-slate-700 hover:text-blue-700 shadow-sm transition-all duration-200 hover:-translate-y-0.5 active:translate-y-0 flex items-center gap-1.5"
>
<span>✨ Retouch Skin</span>
</Link>
<Link
href="/tools/background-remover"
className="px-3.5 py-1.5 rounded-full bg-white hover:bg-blue-50 border border-slate-200 hover:border-blue-300 text-xs font-semibold text-slate-700 hover:text-blue-700 shadow-sm transition-all duration-200 hover:-translate-y-0.5 active:translate-y-0 flex items-center gap-1.5"
>
<span>✂️ Cut Out Hair</span>
</Link>
<Link
href="/tools/photo-enhancer"
className="px-3.5 py-1.5 rounded-full bg-white hover:bg-blue-50 border border-slate-200 hover:border-blue-300 text-xs font-semibold text-slate-700 hover:text-blue-700 shadow-sm transition-all duration-200 hover:-translate-y-0.5 active:translate-y-0 flex items-center gap-1.5"
>
<span>🔍 4K Upscale</span>
</Link>
<Link
href="/tools/colorization"
className="px-3.5 py-1.5 rounded-full bg-white hover:bg-blue-50 border border-slate-200 hover:border-blue-300 text-xs font-semibold text-slate-700 hover:text-blue-700 shadow-sm transition-all duration-200 hover:-translate-y-0.5 active:translate-y-0 flex items-center gap-1.5"
>
<span>🎨 Colorize B&W</span>
</Link>
</div>
</div>
{/* Embedded Interactive Free Try-It Widget wrapped with Animate UI Border Beam */}
<div className="max-w-4xl mx-auto relative z-10">
<div className="relative rounded-3xl overflow-hidden p-1 bg-gradient-to-b from-blue-500/20 via-slate-900/[0.04] to-transparent shadow-2xl">
<BorderBeam duration={12} size={300} borderWidth={2} colorFrom="#3b82f6" colorTo="#8b5cf6" />
<TryItWidget
tool={tool}
homeApp={homeApp}
variants={variants}
locale={locale}
/>
<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-white/80 bg-white/55 p-1.5 shadow-[0_35px_100px_-38px_rgba(32,49,84,0.32)] backdrop-blur-sm sm:p-2">
<div className="absolute inset-0 rounded-[1.8rem] overflow-hidden pointer-events-none"><BorderBeam duration={16} size={240} borderWidth={1.5} colorFrom="#6b8bd6" colorTo="#c7a979" /></div>
<TryItWidget tool={tool} homeApp={homeApp} variants={variants} locale={locale} />
</div>
</div>
</div>
</div>
+16
View File
@@ -61,6 +61,12 @@ export function TryItWidget({
const handleFileChange = (file: File) => {
const maxMB = tool.tryIt?.limits?.maxMB || 12;
const acceptedTypes = ['image/jpeg', 'image/png', 'image/webp'];
if (!acceptedTypes.includes(file.type)) {
setStatus('error');
setErrorMessage('Choose a JPG, PNG, or WebP image.');
return;
}
if (file.size > maxMB * 1024 * 1024) {
setStatus('error');
setErrorMessage(`File exceeds ${maxMB}MB limit.`);
@@ -210,6 +216,15 @@ export function TryItWidget({
}}
onDragLeave={() => setIsDragOver(false)}
onClick={() => fileInputRef.current?.click()}
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
fileInputRef.current?.click();
}
}}
role="button"
tabIndex={0}
aria-label="Choose a JPG, PNG, or WebP photo to edit"
className={`border-2 border-dashed rounded-3xl p-8 sm:p-14 text-center cursor-pointer transition-all duration-300 group ${
isDragOver
? 'border-blue-500 bg-blue-50/50 scale-[1.01]'
@@ -220,6 +235,7 @@ export function TryItWidget({
ref={fileInputRef}
type="file"
accept="image/jpeg,image/png,image/webp"
accept="image/jpeg,image/png,image/webp"
className="hidden"
onChange={(e) => e.target.files?.[0] && handleFileChange(e.target.files[0])}
/>