feat(3d): transform website into 3d cinematic graphics with horizontal scroll and holographic comparison in light luxury theme
This commit is contained in:
@@ -71,38 +71,38 @@ export function Hero3DCanvas({ className = '' }: Hero3DCanvasProps) {
|
||||
// 1. Outer Translucent Diamond Crystal Prism (Octahedron)
|
||||
crystalGeo = new THREE.OctahedronGeometry(1.8, 0);
|
||||
crystalMat = new THREE.MeshPhysicalMaterial({
|
||||
color: 0x3b82f6, // Electric Blue
|
||||
roughness: 0.1,
|
||||
metalness: 0.1,
|
||||
transmission: 0.7,
|
||||
opacity: 0.65,
|
||||
color: 0x2563eb, // Studio Sapphire
|
||||
roughness: 0.08,
|
||||
metalness: 0.15,
|
||||
transmission: 0.85,
|
||||
opacity: 0.7,
|
||||
transparent: true,
|
||||
emissive: 0x1d4ed8,
|
||||
emissiveIntensity: 0.2,
|
||||
emissiveIntensity: 0.25,
|
||||
});
|
||||
const crystalMesh = new THREE.Mesh(crystalGeo, crystalMat);
|
||||
rootGroup.add(crystalMesh);
|
||||
|
||||
// Subtle Glowing Edge Highlights on Crystal
|
||||
// Subtle Champagne Glowing Edge Highlights on Crystal
|
||||
edgesGeo = new THREE.EdgesGeometry(crystalGeo);
|
||||
edgesMat = new THREE.LineBasicMaterial({
|
||||
color: 0x60a5fa,
|
||||
color: 0xc5a880, // Champagne Gold
|
||||
transparent: true,
|
||||
opacity: 0.8,
|
||||
opacity: 0.85,
|
||||
});
|
||||
const edgesLines = new THREE.LineSegments(edgesGeo, edgesMat);
|
||||
rootGroup.add(edgesLines);
|
||||
|
||||
// 2. Inner Nested Core Prism (Counter-rotating)
|
||||
// 2. Inner Nested Core Prism (Counter-rotating Gold Core)
|
||||
innerGeo = new THREE.OctahedronGeometry(1.0, 0);
|
||||
innerMat = new THREE.MeshPhysicalMaterial({
|
||||
color: 0x6366f1, // Indigo
|
||||
color: 0xd4af37, // Metallic Gold
|
||||
roughness: 0.2,
|
||||
metalness: 0.8,
|
||||
emissive: 0x4338ca,
|
||||
emissiveIntensity: 0.5,
|
||||
metalness: 0.85,
|
||||
emissive: 0xb45309,
|
||||
emissiveIntensity: 0.45,
|
||||
transparent: true,
|
||||
opacity: 0.8,
|
||||
opacity: 0.85,
|
||||
});
|
||||
const innerMesh = new THREE.Mesh(innerGeo, innerMat);
|
||||
rootGroup.add(innerMesh);
|
||||
@@ -112,10 +112,10 @@ export function Hero3DCanvas({ className = '' }: Hero3DCanvasProps) {
|
||||
dotGeo = new THREE.BufferGeometry();
|
||||
dotGeo.setAttribute('position', vertexPositions);
|
||||
dotMat = new THREE.PointsMaterial({
|
||||
color: 0x93c5fd,
|
||||
color: 0xfef3c7,
|
||||
size: 0.14,
|
||||
transparent: true,
|
||||
opacity: 0.9,
|
||||
opacity: 0.95,
|
||||
blending: THREE.AdditiveBlending,
|
||||
});
|
||||
const vertexPoints = new THREE.Points(dotGeo, dotMat);
|
||||
@@ -138,24 +138,24 @@ export function Hero3DCanvas({ className = '' }: Hero3DCanvasProps) {
|
||||
particlesGeo = new THREE.BufferGeometry();
|
||||
particlesGeo.setAttribute('position', new THREE.BufferAttribute(particlePositions, 3));
|
||||
particlesMat = new THREE.PointsMaterial({
|
||||
color: 0xa5b4fc,
|
||||
color: 0x93c5fd,
|
||||
size: 0.08,
|
||||
transparent: true,
|
||||
opacity: 0.7,
|
||||
opacity: 0.75,
|
||||
blending: THREE.AdditiveBlending,
|
||||
});
|
||||
const particlesMesh = new THREE.Points(particlesGeo, particlesMat);
|
||||
rootGroup.add(particlesMesh);
|
||||
|
||||
// Lights
|
||||
const ambientLight = new THREE.AmbientLight(0xffffff, 0.9);
|
||||
// Lights: Ambient + Sapphire Key + Champagne Fill
|
||||
const ambientLight = new THREE.AmbientLight(0xffffff, 1.1);
|
||||
scene.add(ambientLight);
|
||||
|
||||
const keyLight = new THREE.PointLight(0x38bdf8, 3, 10);
|
||||
const keyLight = new THREE.PointLight(0x38bdf8, 3.2, 10);
|
||||
keyLight.position.set(3, 3, 3);
|
||||
scene.add(keyLight);
|
||||
|
||||
const fillLight = new THREE.PointLight(0xa855f7, 2, 10);
|
||||
const fillLight = new THREE.PointLight(0xc5a880, 2.8, 10);
|
||||
fillLight.position.set(-3, -2, 2);
|
||||
scene.add(fillLight);
|
||||
|
||||
|
||||
@@ -0,0 +1,269 @@
|
||||
'use client';
|
||||
|
||||
import React, { useRef, useState, useEffect } from 'react';
|
||||
import Link from 'next/link';
|
||||
import { Sparkles, ArrowRight, Smartphone, Zap, Shield, Layers } from 'lucide-react';
|
||||
import { Cinematic3DComparison } from '@/components/ui/Cinematic3DComparison';
|
||||
|
||||
interface ShowcaseCard {
|
||||
id: string;
|
||||
index: string;
|
||||
category: string;
|
||||
model: string;
|
||||
latency: string;
|
||||
title: string;
|
||||
tagline: string;
|
||||
description: string;
|
||||
toolSlug: string;
|
||||
appSlug: string;
|
||||
appName: string;
|
||||
beforeUrl: string;
|
||||
afterUrl: string;
|
||||
specs: string[];
|
||||
}
|
||||
|
||||
const showcaseCards: ShowcaseCard[] = [
|
||||
{
|
||||
id: 'matting',
|
||||
index: '01 / 03',
|
||||
category: 'ALPHA MATTING ARCHIVE',
|
||||
model: 'P3M-Net Dual-Stream Alpha',
|
||||
latency: '< 520ms Stream',
|
||||
title: 'Hair-Strand Matting & Alpha Isolation',
|
||||
tagline: 'Sub-pixel edge detection with microscopic flyaway hair preservation.',
|
||||
description: 'Trained on high-resolution studio portraits, P3M-Net isolates individual flyaway hair strands, fur, and translucent fabrics without halo artifacts or jagged edges. Streams transparent alpha PNGs in real-time.',
|
||||
toolSlug: 'background-remover',
|
||||
appSlug: 'bg-cleaner-app',
|
||||
appName: 'Magic Cutout Studio',
|
||||
beforeUrl: 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=800&auto=format&fit=crop&q=80',
|
||||
afterUrl: 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=800&auto=format&fit=crop&q=80',
|
||||
specs: ['Sub-pixel flyaway detection', 'Lossless alpha PNG export', 'Zero edge halo bleeding'],
|
||||
},
|
||||
{
|
||||
id: 'retouch',
|
||||
index: '02 / 03',
|
||||
category: 'DERMAL RESTORATION',
|
||||
model: 'RetouchGAN v2.1 Micro-Pore',
|
||||
latency: '< 380ms Stream',
|
||||
title: 'Sub-Pore Skin Retouching & Blemish Removal',
|
||||
tagline: 'Authentic microscopic texture preservation without 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.',
|
||||
toolSlug: 'blemish-remover',
|
||||
appSlug: 'portrait-app',
|
||||
appName: 'Portrait Studio AI',
|
||||
beforeUrl: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=800&auto=format&fit=crop&q=80',
|
||||
afterUrl: 'https://images.unsplash.com/photo-1517841905240-472988babdf9?w=800&auto=format&fit=crop&q=80',
|
||||
specs: ['Microscopic pore geometry', 'Instant scar & redness repair', 'True-to-life dermal tones'],
|
||||
},
|
||||
{
|
||||
id: 'enhancer',
|
||||
index: '03 / 03',
|
||||
category: '4K SUPER-RESOLUTION',
|
||||
model: 'GFPGAN + RealESRGAN Ultra',
|
||||
latency: '< 460ms Stream',
|
||||
title: '4K Super-Resolution & Facial Deblurring',
|
||||
tagline: 'Transform low-resolution snapshots into crystal-clear 4K portraits.',
|
||||
description: 'Deep neural priors restore authentic iris sharpness, eyelash detail, and facial contours on blurry, out-of-focus, or highly compressed photos, yielding gallery-ready clarity with zero guesswork.',
|
||||
toolSlug: 'photo-enhancer',
|
||||
appSlug: 'photo-enhancer-pro',
|
||||
appName: 'Enhance Ultra AI',
|
||||
beforeUrl: 'https://images.unsplash.com/photo-1544005313-94ddf0286df2?w=800&auto=format&fit=crop&q=80',
|
||||
afterUrl: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=800&auto=format&fit=crop&q=80',
|
||||
specs: ['Iris & eyelash synthesis', '400% lossless super-resolution', 'Studio-grade crispness'],
|
||||
},
|
||||
];
|
||||
|
||||
export function CinematicHorizontalScrollSection() {
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
const trackRef = useRef<HTMLDivElement>(null);
|
||||
const [scrollProgress, setScrollProgress] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
let rafId: number;
|
||||
|
||||
const handleScroll = () => {
|
||||
if (!containerRef.current || !trackRef.current) return;
|
||||
const rect = containerRef.current.getBoundingClientRect();
|
||||
const totalScrollable = containerRef.current.offsetHeight - window.innerHeight;
|
||||
|
||||
if (totalScrollable <= 0) return;
|
||||
|
||||
// Calculate progress 0 to 1
|
||||
const progress = Math.min(Math.max(-rect.top / totalScrollable, 0), 1);
|
||||
setScrollProgress(progress);
|
||||
|
||||
// Translate track horizontally
|
||||
const maxTranslate = trackRef.current.scrollWidth - window.innerWidth;
|
||||
if (maxTranslate > 0) {
|
||||
trackRef.current.style.transform = `translate3d(-${progress * maxTranslate}px, 0, 0)`;
|
||||
}
|
||||
};
|
||||
|
||||
const onScroll = () => {
|
||||
cancelAnimationFrame(rafId);
|
||||
rafId = requestAnimationFrame(handleScroll);
|
||||
};
|
||||
|
||||
window.addEventListener('scroll', onScroll, { passive: true });
|
||||
window.addEventListener('touchmove', onScroll, { passive: true });
|
||||
window.addEventListener('resize', onScroll, { passive: true });
|
||||
handleScroll();
|
||||
|
||||
let boundLenis: any = null;
|
||||
const bindLenisInterval = setInterval(() => {
|
||||
const lenis = (window as any).lenis;
|
||||
if (lenis && typeof lenis.on === 'function') {
|
||||
boundLenis = lenis;
|
||||
lenis.on('scroll', onScroll);
|
||||
clearInterval(bindLenisInterval);
|
||||
}
|
||||
}, 50);
|
||||
|
||||
return () => {
|
||||
clearInterval(bindLenisInterval);
|
||||
window.removeEventListener('scroll', onScroll);
|
||||
window.removeEventListener('touchmove', onScroll);
|
||||
window.removeEventListener('resize', onScroll);
|
||||
if (boundLenis && typeof boundLenis.off === 'function') {
|
||||
boundLenis.off('scroll', onScroll);
|
||||
}
|
||||
cancelAnimationFrame(rafId);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<section
|
||||
id="flagship-models"
|
||||
ref={containerRef}
|
||||
className="relative h-[280vh] sm:h-[340vh] bg-[#FAF8F5] border-t border-slate-900/[0.08]"
|
||||
>
|
||||
{/* Sticky Fullscreen Camera Viewport */}
|
||||
<div className="sticky top-0 h-screen w-full overflow-hidden flex flex-col justify-between py-12 sm:py-16">
|
||||
{/* Background Subtle Ambient Gradients */}
|
||||
<div className="absolute top-1/4 left-1/3 w-[500px] h-[500px] bg-blue-500/[0.03] rounded-full blur-3xl pointer-events-none -z-10" />
|
||||
<div className="absolute bottom-1/4 right-1/4 w-[450px] h-[450px] bg-amber-500/[0.025] rounded-full blur-3xl pointer-events-none -z-10" />
|
||||
|
||||
{/* Section Top Header & Navigation Telemetry */}
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 w-full z-10 flex flex-col sm:flex-row sm:items-end justify-between gap-4">
|
||||
<div>
|
||||
<div className="inline-flex items-center gap-2 px-3.5 py-1 rounded-full bg-blue-50/80 border border-blue-200/80 text-[11px] font-mono font-semibold text-blue-700 mb-2">
|
||||
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
|
||||
<span>HORIZONTAL 3D CINEMATIC ARCHIVE</span>
|
||||
</div>
|
||||
<h2 className="text-2xl sm:text-4xl lg:text-5xl font-display font-black text-slate-900 tracking-tight">
|
||||
Flagship Transformations <span className="text-transparent bg-clip-text bg-gradient-to-r from-blue-700 via-indigo-600 to-amber-600">In Real-Time</span>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-3">
|
||||
<span className="text-xs font-mono font-bold text-slate-500 uppercase tracking-widest">
|
||||
SCROLL DOWN TO PAN HORIZONTALLY
|
||||
</span>
|
||||
<div className="hidden sm:flex items-center gap-1.5 px-3 py-1 rounded-lg bg-white/70 backdrop-blur-sm border border-slate-900/[0.06] text-xs font-mono font-bold text-slate-700">
|
||||
<span className="w-2 h-2 rounded-full bg-blue-600 animate-ping inline-block" />
|
||||
<span>PROGRESS {Math.round(scrollProgress * 100)}%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Horizontal Sliding Filmstrip Track */}
|
||||
<div className="relative w-full my-auto overflow-visible py-4">
|
||||
<div
|
||||
ref={trackRef}
|
||||
className="flex items-center gap-8 sm:gap-14 px-6 sm:px-12 lg:px-20 w-max will-change-transform preserve-3d transition-transform duration-75 ease-out"
|
||||
>
|
||||
{showcaseCards.map((card, idx) => (
|
||||
<div
|
||||
key={card.id}
|
||||
className="w-[85vw] sm:w-[620px] lg:w-[740px] shrink-0 bg-white/90 backdrop-blur-xl rounded-3xl p-5 sm:p-8 border border-slate-900/[0.08] shadow-cinematic-3d hover:shadow-cinematic-hover transition-all duration-300 preserve-3d group"
|
||||
style={{
|
||||
transform: `perspective(1200px) rotateY(${(scrollProgress - idx / (showcaseCards.length - 1)) * -12}deg)`,
|
||||
}}
|
||||
>
|
||||
{/* Card Top Metadata Bar */}
|
||||
<div className="flex items-center justify-between pb-4 border-b border-slate-900/[0.06] mb-5">
|
||||
<div className="flex items-center gap-3">
|
||||
<span className="font-mono text-xs font-black text-blue-700 tracking-wider">
|
||||
{card.index}
|
||||
</span>
|
||||
<span className="h-3 w-px bg-slate-300" />
|
||||
<span className="font-mono text-[10px] sm:text-xs font-bold text-slate-500 uppercase tracking-widest">
|
||||
{card.category}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="px-2.5 py-1 rounded-md bg-amber-50 border border-amber-200/60 text-[10px] font-mono font-semibold text-amber-800">
|
||||
{card.latency}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 3D Cinematic Comparison Viewport */}
|
||||
<div className="mb-6 relative z-10">
|
||||
<Cinematic3DComparison
|
||||
beforeUrl={card.beforeUrl}
|
||||
afterUrl={card.afterUrl}
|
||||
beforeLabel="RAW SOURCE"
|
||||
afterLabel={card.model}
|
||||
aspectRatio="aspect-[16/10]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Card Editorial Info */}
|
||||
<div className="space-y-3">
|
||||
<h3 className="text-xl sm:text-2xl font-display font-bold text-slate-900 tracking-tight">
|
||||
{card.title}
|
||||
</h3>
|
||||
<p className="text-sm text-slate-600 leading-relaxed font-normal">
|
||||
{card.description}
|
||||
</p>
|
||||
|
||||
{/* Specs Chips */}
|
||||
<div className="flex flex-wrap gap-2 pt-2">
|
||||
{card.specs.map((spec, i) => (
|
||||
<span
|
||||
key={i}
|
||||
className="px-2.5 py-1 rounded-lg bg-slate-100 text-slate-700 text-xs font-mono font-medium border border-slate-200/60"
|
||||
>
|
||||
✓ {spec}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Actions */}
|
||||
<div className="pt-4 flex flex-wrap items-center justify-between gap-3 border-t border-slate-900/[0.06]">
|
||||
<Link
|
||||
href={`/tools/${card.toolSlug}`}
|
||||
className="inline-flex items-center gap-2 text-xs font-bold text-blue-700 hover:text-blue-900 group/link"
|
||||
>
|
||||
<span>Launch Interactive Studio</span>
|
||||
<ArrowRight className="w-3.5 h-3.5 group-hover/link:translate-x-1 transition-transform" />
|
||||
</Link>
|
||||
|
||||
<Link
|
||||
href={`/apps/${card.appSlug}`}
|
||||
className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-slate-900 text-white text-xs font-bold hover:bg-blue-700 transition-colors shadow-sm"
|
||||
>
|
||||
<Smartphone className="w-3.5 h-3.5" />
|
||||
<span>{card.appName}</span>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Section Bottom Progress Indicator Bar */}
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 w-full z-10">
|
||||
<div className="w-full bg-slate-200/80 h-1.5 rounded-full overflow-hidden shadow-inner">
|
||||
<div
|
||||
className="h-full bg-gradient-to-r from-blue-600 via-indigo-600 to-amber-500 rounded-full transition-all duration-100 ease-out"
|
||||
style={{ width: `${Math.max(scrollProgress * 100, 3)}%` }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import { Sparkles, ArrowRight, Smartphone, Layers } from 'lucide-react';
|
||||
import { resolveLocalised, ToolItem, AppItem, VariantSpec } from '@/types';
|
||||
import { TryItWidget } from './TryItWidget';
|
||||
import { TiltCard } from '@/components/ui/TiltCard';
|
||||
import { Hero3DCanvas } from '@/components/3d/Hero3DCanvas';
|
||||
|
||||
interface HeroSectionProps {
|
||||
title?: any;
|
||||
@@ -42,23 +43,33 @@ export function HeroSection({
|
||||
<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" />
|
||||
|
||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 relative z-10">
|
||||
{/* 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>
|
||||
|
||||
{/* Main Hero Header */}
|
||||
<div className="text-center max-w-4xl mx-auto space-y-7 mb-12 sm:mb-16 relative z-10">
|
||||
{/* Live Core Status Pill */}
|
||||
{resolvedBadge && (
|
||||
<div className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-blue-50 border border-blue-200/80 text-xs font-mono font-semibold text-blue-700 shadow-sm backdrop-blur-sm">
|
||||
<span className="relative flex h-2 w-2">
|
||||
<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}</span>
|
||||
<div className="text-center max-w-4xl mx-auto space-y-6 mb-12 sm:mb-16 relative z-10">
|
||||
{/* Live Core Status & Enigma Editorial Metadata */}
|
||||
<div className="flex flex-wrap items-center justify-center gap-2.5">
|
||||
{resolvedBadge && (
|
||||
<div className="inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-blue-50/90 border border-blue-200/80 text-xs font-mono font-semibold text-blue-700 shadow-sm backdrop-blur-sm">
|
||||
<span className="relative flex h-2 w-2">
|
||||
<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}</span>
|
||||
</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">
|
||||
<span>VOL. 26 // NEURAL STUDIO</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Main Headline with Editorial Kerning and Fluid Scale */}
|
||||
<h1 className="text-4xl sm:text-5xl lg:text-6xl xl:text-7xl font-display font-black text-slate-900 tracking-tight leading-[1.08] max-w-4xl mx-auto">
|
||||
Transform Photos with <br className="hidden sm:inline" />
|
||||
<span className="text-transparent bg-clip-text bg-gradient-to-r from-blue-700 via-indigo-600 to-purple-600">
|
||||
<span className="text-transparent bg-clip-text bg-gradient-to-r from-blue-700 via-indigo-600 to-amber-600">
|
||||
Next-Gen Neural AI
|
||||
</span>
|
||||
</h1>
|
||||
|
||||
@@ -24,6 +24,7 @@ import { VisualUseCasesSection } from './VisualUseCasesSection';
|
||||
import { WorkflowVisualizerSection } from './WorkflowVisualizerSection';
|
||||
import { VerticalToolStackSection } from './VerticalToolStackSection';
|
||||
import { MajorToolBannersSection } from './MajorToolBannersSection';
|
||||
import { CinematicHorizontalScrollSection } from './CinematicHorizontalScrollSection';
|
||||
|
||||
interface SectionRendererProps {
|
||||
section: SectionConfig;
|
||||
@@ -71,7 +72,8 @@ export function SectionRenderer({ section, context }: SectionRendererProps) {
|
||||
return <TransformationReelSection />;
|
||||
|
||||
case 'majorToolBanners':
|
||||
return <MajorToolBannersSection />;
|
||||
case 'cinematicHorizontal':
|
||||
return <CinematicHorizontalScrollSection />;
|
||||
|
||||
case 'visualUseCases':
|
||||
return <VisualUseCasesSection />;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import React, { useState, useRef, useCallback, useEffect } from 'react';
|
||||
import { Eye, Sparkles } from 'lucide-react';
|
||||
import React from 'react';
|
||||
import { Cinematic3DComparison } from './Cinematic3DComparison';
|
||||
|
||||
interface BeforeAfterSliderProps {
|
||||
beforeUrl: string;
|
||||
@@ -11,172 +11,29 @@ interface BeforeAfterSliderProps {
|
||||
caption?: string;
|
||||
aspectRatio?: string;
|
||||
autoSlide?: boolean;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function BeforeAfterSlider({
|
||||
beforeUrl,
|
||||
afterUrl,
|
||||
beforeLabel = 'Original',
|
||||
afterLabel = 'CRE AI Result',
|
||||
beforeLabel,
|
||||
afterLabel,
|
||||
caption,
|
||||
aspectRatio = 'aspect-[4/3] sm:aspect-[16/10]',
|
||||
autoSlide = true,
|
||||
className = '',
|
||||
}: BeforeAfterSliderProps) {
|
||||
const [sliderPosition, setSliderPosition] = useState(50);
|
||||
const [isDragging, setIsDragging] = useState(false);
|
||||
const [isUserInteracting, setIsUserInteracting] = useState(false);
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
const animFrameRef = useRef<number | null>(null);
|
||||
const resumeTimerRef = useRef<NodeJS.Timeout | null>(null);
|
||||
const startTimeRef = useRef<number>(Date.now());
|
||||
|
||||
// Auto-slide animation loop using RAF
|
||||
useEffect(() => {
|
||||
if (!autoSlide || isDragging || isUserInteracting) {
|
||||
if (animFrameRef.current) cancelAnimationFrame(animFrameRef.current);
|
||||
return;
|
||||
}
|
||||
|
||||
const animate = () => {
|
||||
const elapsed = Date.now() - startTimeRef.current;
|
||||
// Smooth sine wave between 24% and 76% (period ~4 seconds)
|
||||
const newPos = 50 + 26 * Math.sin(elapsed * 0.0016);
|
||||
setSliderPosition(newPos);
|
||||
animFrameRef.current = requestAnimationFrame(animate);
|
||||
};
|
||||
|
||||
animFrameRef.current = requestAnimationFrame(animate);
|
||||
|
||||
return () => {
|
||||
if (animFrameRef.current) cancelAnimationFrame(animFrameRef.current);
|
||||
};
|
||||
}, [autoSlide, isDragging, isUserInteracting]);
|
||||
|
||||
const handleMove = useCallback((clientX: number) => {
|
||||
if (!containerRef.current) return;
|
||||
const rect = containerRef.current.getBoundingClientRect();
|
||||
const x = Math.max(0, Math.min(clientX - rect.left, rect.width));
|
||||
const percent = Math.max(0, Math.min(100, (x / rect.width) * 100));
|
||||
setSliderPosition(percent);
|
||||
}, []);
|
||||
|
||||
const handleTouchMove = useCallback((e: TouchEvent) => {
|
||||
if (!isDragging) return;
|
||||
handleMove(e.touches[0].clientX);
|
||||
}, [isDragging, handleMove]);
|
||||
|
||||
const handleMouseMove = useCallback((e: MouseEvent) => {
|
||||
if (!isDragging) return;
|
||||
handleMove(e.clientX);
|
||||
}, [isDragging, handleMove]);
|
||||
|
||||
const handleMouseUp = useCallback(() => {
|
||||
setIsDragging(false);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (isDragging) {
|
||||
window.addEventListener('mousemove', handleMouseMove, { passive: true });
|
||||
window.addEventListener('mouseup', handleMouseUp);
|
||||
window.addEventListener('touchmove', handleTouchMove, { passive: true });
|
||||
window.addEventListener('touchend', handleMouseUp);
|
||||
}
|
||||
return () => {
|
||||
window.removeEventListener('mousemove', handleMouseMove);
|
||||
window.removeEventListener('mouseup', handleMouseUp);
|
||||
window.removeEventListener('touchmove', handleTouchMove);
|
||||
window.removeEventListener('touchend', handleMouseUp);
|
||||
};
|
||||
}, [isDragging, handleMouseMove, handleMouseUp, handleTouchMove]);
|
||||
|
||||
const handleMouseEnter = () => {
|
||||
setIsUserInteracting(true);
|
||||
if (resumeTimerRef.current) clearTimeout(resumeTimerRef.current);
|
||||
};
|
||||
|
||||
const handleMouseLeave = () => {
|
||||
if (resumeTimerRef.current) clearTimeout(resumeTimerRef.current);
|
||||
resumeTimerRef.current = setTimeout(() => {
|
||||
setIsUserInteracting(false);
|
||||
startTimeRef.current = Date.now();
|
||||
}, 2500);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="w-full">
|
||||
<div
|
||||
ref={containerRef}
|
||||
onMouseEnter={handleMouseEnter}
|
||||
onMouseLeave={handleMouseLeave}
|
||||
onMouseDown={() => {
|
||||
setIsDragging(true);
|
||||
setIsUserInteracting(true);
|
||||
}}
|
||||
onTouchStart={() => {
|
||||
setIsDragging(true);
|
||||
setIsUserInteracting(true);
|
||||
}}
|
||||
className={`relative w-full ${aspectRatio} rounded-2xl sm:rounded-3xl overflow-hidden select-none cursor-ew-resize shadow-md border border-slate-900/[0.08] bg-slate-950 group`}
|
||||
style={{ touchAction: 'pan-y' }}
|
||||
>
|
||||
{/* After Image (Background) */}
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img
|
||||
src={afterUrl}
|
||||
alt="After result"
|
||||
loading="eager"
|
||||
className="absolute inset-0 w-full h-full object-cover pointer-events-none will-change-transform"
|
||||
/>
|
||||
|
||||
{/* Before Image (Clipped Left side) */}
|
||||
<div
|
||||
className="absolute inset-0 overflow-hidden pointer-events-none will-change-transform"
|
||||
style={{ clipPath: `polygon(0 0, ${sliderPosition}% 0, ${sliderPosition}% 100%, 0 100%)` }}
|
||||
>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img
|
||||
src={beforeUrl}
|
||||
alt="Before result"
|
||||
loading="eager"
|
||||
className="absolute inset-0 w-full h-full object-cover"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Split Divider Line */}
|
||||
<div
|
||||
className="absolute top-0 bottom-0 w-0.5 bg-white shadow-[0_0_12px_rgba(37,99,235,0.8)] z-20 pointer-events-none will-change-transform"
|
||||
style={{ left: `${sliderPosition}%` }}
|
||||
>
|
||||
{/* Center Circular Touch/Mouse Handle */}
|
||||
<div className="absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-8 h-8 sm:w-10 sm:h-10 rounded-full bg-white border-2 border-blue-600 shadow-xl flex items-center justify-center pointer-events-auto cursor-ew-resize hover:scale-110 active:scale-95 transition-transform duration-150">
|
||||
<svg
|
||||
className="w-3.5 h-3.5 sm:w-4 sm:h-4 text-blue-600"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2.5} d="M8 9l-3 3 3 3m8-6l3 3-3 3" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Floating Badges */}
|
||||
<div className="absolute top-3 left-3 sm:top-4 sm:left-4 bg-slate-900/80 backdrop-blur-md px-3 py-1.5 rounded-xl text-[11px] font-mono font-bold text-white border border-white/10 pointer-events-none z-10 flex items-center gap-1.5 shadow-md">
|
||||
<Eye className="w-3.5 h-3.5 text-slate-300" />
|
||||
<span>{beforeLabel}</span>
|
||||
</div>
|
||||
<div className="absolute top-3 right-3 sm:top-4 sm:right-4 bg-gradient-to-r from-blue-600 to-indigo-600 backdrop-blur-md px-3 py-1.5 rounded-xl text-[11px] font-mono font-bold text-white shadow-md border border-white/20 pointer-events-none z-10 flex items-center gap-1.5">
|
||||
<Sparkles className="w-3.5 h-3.5 text-white" />
|
||||
<span>{afterLabel}</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{caption && (
|
||||
<p className="mt-2.5 text-center text-xs font-mono text-slate-500">
|
||||
{caption}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<Cinematic3DComparison
|
||||
beforeUrl={beforeUrl}
|
||||
afterUrl={afterUrl}
|
||||
beforeLabel={beforeLabel}
|
||||
afterLabel={afterLabel}
|
||||
caption={caption}
|
||||
aspectRatio={aspectRatio}
|
||||
autoSlide={autoSlide}
|
||||
className={className}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,264 @@
|
||||
'use client';
|
||||
|
||||
import React, { useState, useRef, useCallback, useEffect } from 'react';
|
||||
import { Eye, Sparkles, Scan, Activity } from 'lucide-react';
|
||||
|
||||
interface Cinematic3DComparisonProps {
|
||||
beforeUrl: string;
|
||||
afterUrl: string;
|
||||
beforeLabel?: string;
|
||||
afterLabel?: string;
|
||||
caption?: string;
|
||||
aspectRatio?: string;
|
||||
autoSlide?: boolean;
|
||||
maxTilt?: number;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function Cinematic3DComparison({
|
||||
beforeUrl,
|
||||
afterUrl,
|
||||
beforeLabel = 'RAW SOURCE',
|
||||
afterLabel = 'AI RECONSTRUCTED',
|
||||
caption,
|
||||
aspectRatio = 'aspect-[4/3] sm:aspect-[16/10]',
|
||||
autoSlide = true,
|
||||
maxTilt = 7,
|
||||
className = '',
|
||||
}: Cinematic3DComparisonProps) {
|
||||
const [sliderPosition, setSliderPosition] = useState(50);
|
||||
const [isDragging, setIsDragging] = useState(false);
|
||||
const [isUserInteracting, setIsUserInteracting] = useState(false);
|
||||
const [tilt, setTilt] = useState({ rx: 0, ry: 0, glareX: 50, glareY: 50, active: false });
|
||||
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
const stageRef = useRef<HTMLDivElement>(null);
|
||||
const animFrameRef = useRef<number | null>(null);
|
||||
const resumeTimerRef = useRef<NodeJS.Timeout | null>(null);
|
||||
const startTimeRef = useRef<number>(Date.now());
|
||||
|
||||
// Auto-slide smooth sine oscillation loop
|
||||
useEffect(() => {
|
||||
if (!autoSlide || isDragging || isUserInteracting) {
|
||||
if (animFrameRef.current) cancelAnimationFrame(animFrameRef.current);
|
||||
return;
|
||||
}
|
||||
|
||||
const animate = () => {
|
||||
const elapsed = Date.now() - startTimeRef.current;
|
||||
// Gentle cinematic oscillation between 28% and 72%
|
||||
const newPos = 50 + 22 * Math.sin(elapsed * 0.0014);
|
||||
setSliderPosition(newPos);
|
||||
animFrameRef.current = requestAnimationFrame(animate);
|
||||
};
|
||||
|
||||
animFrameRef.current = requestAnimationFrame(animate);
|
||||
|
||||
return () => {
|
||||
if (animFrameRef.current) cancelAnimationFrame(animFrameRef.current);
|
||||
};
|
||||
}, [autoSlide, isDragging, isUserInteracting]);
|
||||
|
||||
// Handle position calculation
|
||||
const handleMove = useCallback((clientX: number) => {
|
||||
if (!containerRef.current) return;
|
||||
const rect = containerRef.current.getBoundingClientRect();
|
||||
const x = Math.max(0, Math.min(clientX - rect.left, rect.width));
|
||||
const percent = Math.max(0, Math.min(100, (x / rect.width) * 100));
|
||||
setSliderPosition(percent);
|
||||
}, []);
|
||||
|
||||
const handleTouchMove = useCallback((e: TouchEvent) => {
|
||||
if (!isDragging) return;
|
||||
handleMove(e.touches[0].clientX);
|
||||
}, [isDragging, handleMove]);
|
||||
|
||||
const handleMouseMove = useCallback((e: MouseEvent) => {
|
||||
if (!isDragging) return;
|
||||
handleMove(e.clientX);
|
||||
}, [isDragging, handleMove]);
|
||||
|
||||
const handleMouseUp = useCallback(() => {
|
||||
setIsDragging(false);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (isDragging) {
|
||||
window.addEventListener('mousemove', handleMouseMove, { passive: true });
|
||||
window.addEventListener('mouseup', handleMouseUp);
|
||||
window.addEventListener('touchmove', handleTouchMove, { passive: true });
|
||||
window.addEventListener('touchend', handleMouseUp);
|
||||
}
|
||||
return () => {
|
||||
window.removeEventListener('mousemove', handleMouseMove);
|
||||
window.removeEventListener('mouseup', handleMouseUp);
|
||||
window.removeEventListener('touchmove', handleTouchMove);
|
||||
window.removeEventListener('touchend', handleMouseUp);
|
||||
};
|
||||
}, [isDragging, handleMouseMove, handleMouseUp, handleTouchMove]);
|
||||
|
||||
// 3D Spatial Tilt Tracking
|
||||
const handleStageMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
|
||||
if (!containerRef.current) return;
|
||||
const rect = containerRef.current.getBoundingClientRect();
|
||||
const x = (e.clientX - rect.left) / rect.width;
|
||||
const y = (e.clientY - rect.top) / rect.height;
|
||||
|
||||
const rx = -(y - 0.5) * maxTilt * 2;
|
||||
const ry = (x - 0.5) * maxTilt * 2;
|
||||
|
||||
setTilt({
|
||||
rx,
|
||||
ry,
|
||||
glareX: x * 100,
|
||||
glareY: y * 100,
|
||||
active: true,
|
||||
});
|
||||
};
|
||||
|
||||
const handleMouseEnter = () => {
|
||||
setIsUserInteracting(true);
|
||||
if (resumeTimerRef.current) clearTimeout(resumeTimerRef.current);
|
||||
};
|
||||
|
||||
const handleMouseLeave = () => {
|
||||
setTilt((prev) => ({ ...prev, rx: 0, ry: 0, active: false }));
|
||||
if (resumeTimerRef.current) clearTimeout(resumeTimerRef.current);
|
||||
resumeTimerRef.current = setTimeout(() => {
|
||||
setIsUserInteracting(false);
|
||||
startTimeRef.current = Date.now();
|
||||
}, 2800);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={`w-full perspective-1400 select-none ${className}`}>
|
||||
{/* 3D Kinetic Tilt Stage */}
|
||||
<div
|
||||
ref={containerRef}
|
||||
onMouseMove={handleStageMouseMove}
|
||||
onMouseEnter={handleMouseEnter}
|
||||
onMouseLeave={handleMouseLeave}
|
||||
onMouseDown={() => {
|
||||
setIsDragging(true);
|
||||
setIsUserInteracting(true);
|
||||
}}
|
||||
onTouchStart={() => {
|
||||
setIsDragging(true);
|
||||
setIsUserInteracting(true);
|
||||
}}
|
||||
className={`relative w-full ${aspectRatio} rounded-2xl sm:rounded-3xl overflow-hidden cursor-ew-resize preserve-3d transition-transform duration-200 ease-out shadow-cinematic-3d hover:shadow-cinematic-hover border border-slate-900/[0.08] bg-slate-950`}
|
||||
style={{
|
||||
transform: tilt.active
|
||||
? `rotateX(${tilt.rx.toFixed(2)}deg) rotateY(${tilt.ry.toFixed(2)}deg) scale3d(1.015, 1.015, 1.015)`
|
||||
: 'rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1)',
|
||||
touchAction: 'pan-y',
|
||||
}}
|
||||
>
|
||||
{/* Layer 1: After Image (Full Reconstructed Neural Result) */}
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img
|
||||
src={afterUrl}
|
||||
alt="AI Reconstructed result"
|
||||
loading="eager"
|
||||
className="absolute inset-0 w-full h-full object-cover pointer-events-none will-change-transform"
|
||||
/>
|
||||
|
||||
{/* Dynamic 3D Cursor Specular Light Glint */}
|
||||
<div
|
||||
className="absolute inset-0 pointer-events-none transition-opacity duration-300 z-10"
|
||||
style={{
|
||||
opacity: tilt.active ? 0.65 : 0,
|
||||
background: `radial-gradient(circle 380px at ${tilt.glareX}% ${tilt.glareY}%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.08) 50%, transparent 80%)`,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Layer 2: Before Image (Clipped Left Side with Polygon Split) */}
|
||||
<div
|
||||
className="absolute inset-0 overflow-hidden pointer-events-none will-change-transform"
|
||||
style={{ clipPath: `polygon(0 0, ${sliderPosition}% 0, ${sliderPosition}% 100%, 0 100%)` }}
|
||||
>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img
|
||||
src={beforeUrl}
|
||||
alt="Original input"
|
||||
loading="eager"
|
||||
className="absolute inset-0 w-full h-full object-cover"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Layer 3: Illuminated Holographic Laser Split Line (Champagne Gold + Electric Sapphire) */}
|
||||
<div
|
||||
className="absolute top-0 bottom-0 w-[2px] bg-gradient-to-b from-blue-400 via-white to-amber-300 holographic-laser-split z-20 pointer-events-none will-change-transform"
|
||||
style={{ left: `${sliderPosition}%` }}
|
||||
>
|
||||
{/* Subtle Vertical Caustic Glow Beam */}
|
||||
<div className="absolute -top-4 -bottom-4 -left-1.5 w-3.5 bg-gradient-to-r from-blue-500/20 via-white/40 to-amber-400/20 blur-[3px]" />
|
||||
|
||||
{/* 3D Tactile Center Control Handle floating at translateZ */}
|
||||
<div
|
||||
className="absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-9 h-9 sm:w-11 sm:h-11 rounded-full bg-white/95 backdrop-blur-md border border-slate-900/10 shadow-2xl flex items-center justify-center pointer-events-auto cursor-ew-resize hover:scale-110 active:scale-95 transition-transform duration-150 preserve-3d"
|
||||
style={{ transform: 'translateZ(28px)' }}
|
||||
>
|
||||
{/* Outer Metallic Ring */}
|
||||
<div className="absolute inset-0 rounded-full border border-blue-600/30 shadow-[0_0_12px_rgba(37,99,235,0.3)]" />
|
||||
|
||||
{/* Inner Arrows SVG */}
|
||||
<svg
|
||||
className="w-4 h-4 text-blue-700"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2.5} d="M8 9l-3 3 3 3m8-6l3 3-3 3" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Layer 4: Floating 3D Telemetry Badges (Floating at translateZ(32px)) */}
|
||||
<div
|
||||
className="absolute top-3.5 left-3.5 sm:top-5 sm:left-5 bg-white/85 backdrop-blur-md px-3 py-1.5 rounded-xl text-[10px] sm:text-[11px] font-mono font-bold text-slate-800 border border-slate-900/[0.08] pointer-events-none z-20 flex items-center gap-1.5 shadow-sm preserve-3d"
|
||||
style={{ transform: 'translateZ(30px)' }}
|
||||
>
|
||||
<Eye className="w-3.5 h-3.5 text-slate-600" />
|
||||
<span>{beforeLabel}</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="absolute top-3.5 right-3.5 sm:top-5 sm:right-5 bg-gradient-to-r from-blue-600 via-indigo-600 to-blue-700 text-white backdrop-blur-md px-3.5 py-1.5 rounded-xl text-[10px] sm:text-[11px] font-mono font-bold shadow-md border border-white/20 pointer-events-none z-20 flex items-center gap-1.5 preserve-3d"
|
||||
style={{ transform: 'translateZ(30px)' }}
|
||||
>
|
||||
<Sparkles className="w-3.5 h-3.5 text-white" />
|
||||
<span>{afterLabel}</span>
|
||||
</div>
|
||||
|
||||
{/* Lower Spatial Telemetry Chips (Enigma Archive Aesthetic) */}
|
||||
<div
|
||||
className="absolute bottom-3.5 left-3.5 sm:bottom-4 sm:left-4 hidden sm:flex items-center gap-2 pointer-events-none z-20 preserve-3d"
|
||||
style={{ transform: 'translateZ(26px)' }}
|
||||
>
|
||||
<div className="bg-slate-950/60 backdrop-blur-md px-2.5 py-1 rounded-lg text-[9px] font-mono font-semibold text-white/90 border border-white/10 flex items-center gap-1.5">
|
||||
<Activity className="w-3 h-3 text-emerald-400 animate-pulse" />
|
||||
<span>DELTA DEPTH MAP</span>
|
||||
</div>
|
||||
<div className="bg-slate-950/60 backdrop-blur-md px-2.5 py-1 rounded-lg text-[9px] font-mono font-semibold text-white/90 border border-white/10 flex items-center gap-1.5">
|
||||
<Scan className="w-3 h-3 text-cyan-400" />
|
||||
<span>LOSSLESS 4K</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className="absolute bottom-3.5 right-3.5 sm:bottom-4 sm:right-4 bg-white/80 backdrop-blur-md px-2.5 py-1 rounded-lg text-[9px] font-mono font-bold text-slate-700 border border-slate-900/[0.06] pointer-events-none z-20 preserve-3d"
|
||||
style={{ transform: 'translateZ(26px)' }}
|
||||
>
|
||||
SCAN: {Math.round(sliderPosition)}%
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{caption && (
|
||||
<p className="mt-3 text-center text-xs font-mono text-slate-500 tracking-wide uppercase">
|
||||
{caption}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user