feat(showcase): completely rewrite horizontal showcase into native GPU-accelerated filmstrip with zero scroll hijacking
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import React, { useRef, useEffect, useState, useCallback } from 'react';
|
import React, { useRef, useState, useEffect, useCallback } from 'react';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { Sparkles, ArrowRight, Smartphone, ChevronLeft, ChevronRight } from 'lucide-react';
|
import { Sparkles, ArrowRight, Smartphone, ChevronLeft, ChevronRight, Layers } from 'lucide-react';
|
||||||
import { Cinematic3DComparison } from '@/components/ui/Cinematic3DComparison';
|
import { Cinematic3DComparison } from '@/components/ui/Cinematic3DComparison';
|
||||||
|
|
||||||
interface ShowcaseCard {
|
interface ShowcaseCard {
|
||||||
@@ -74,327 +74,304 @@ const showcaseCards: ShowcaseCard[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export function CinematicHorizontalScrollSection() {
|
export function CinematicHorizontalScrollSection() {
|
||||||
const containerRef = useRef<HTMLDivElement>(null);
|
const scrollRef = useRef<HTMLDivElement>(null);
|
||||||
const trackRef = useRef<HTMLDivElement>(null);
|
const [activeIndex, setActiveIndex] = useState(0);
|
||||||
const bgTextRef = useRef<HTMLDivElement>(null);
|
const [isDragging, setIsDragging] = useState(false);
|
||||||
const progressBarRef = useRef<HTMLDivElement>(null);
|
const [dragStartX, setDragStartX] = useState(0);
|
||||||
const progressTextRef = useRef<HTMLSpanElement>(null);
|
const [dragScrollLeft, setDragScrollLeft] = useState(0);
|
||||||
const [activeCardIndex, setActiveCardIndex] = useState(0);
|
|
||||||
|
|
||||||
|
// Smoothly scroll to a specific card index
|
||||||
const scrollToCard = useCallback((index: number) => {
|
const scrollToCard = useCallback((index: number) => {
|
||||||
if (!containerRef.current) return;
|
if (!scrollRef.current) return;
|
||||||
const rect = containerRef.current.getBoundingClientRect();
|
const container = scrollRef.current;
|
||||||
const containerTop = rect.top + window.scrollY;
|
const card = container.children[index] as HTMLElement | undefined;
|
||||||
const scrollableDistance = Math.max(containerRef.current.offsetHeight - window.innerHeight, 1);
|
if (card) {
|
||||||
const targetY = containerTop + (index / 2) * scrollableDistance;
|
const containerWidth = container.offsetWidth;
|
||||||
window.scrollTo({ top: targetY, behavior: 'smooth' });
|
const cardWidth = card.offsetWidth;
|
||||||
|
const cardLeft = card.offsetLeft;
|
||||||
|
// Center the card in the viewport
|
||||||
|
const targetLeft = cardLeft - (containerWidth - cardWidth) / 2;
|
||||||
|
container.scrollTo({
|
||||||
|
left: Math.max(0, targetLeft),
|
||||||
|
behavior: 'smooth',
|
||||||
|
});
|
||||||
|
setActiveIndex(index);
|
||||||
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const navigateStep = useCallback((delta: number) => {
|
const handlePrev = useCallback(() => {
|
||||||
const nextIdx = Math.max(0, Math.min(2, activeCardIndex + delta));
|
scrollToCard(Math.max(0, activeIndex - 1));
|
||||||
scrollToCard(nextIdx);
|
}, [activeIndex, scrollToCard]);
|
||||||
}, [activeCardIndex, scrollToCard]);
|
|
||||||
|
|
||||||
|
const handleNext = useCallback(() => {
|
||||||
|
scrollToCard(Math.min(showcaseCards.length - 1, activeIndex + 1));
|
||||||
|
}, [activeIndex, scrollToCard]);
|
||||||
|
|
||||||
|
// Update active index based on scroll position via lightweight scroll listener
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let ticking = false;
|
const container = scrollRef.current;
|
||||||
let containerTop = 0;
|
if (!container) return;
|
||||||
let scrollableDistance = 1;
|
|
||||||
let maxTranslate = 1;
|
|
||||||
let cardStep = 780;
|
|
||||||
let screenCenter = window.innerWidth / 2;
|
|
||||||
|
|
||||||
const measure = () => {
|
|
||||||
if (!containerRef.current || !trackRef.current) return;
|
|
||||||
const rect = containerRef.current.getBoundingClientRect();
|
|
||||||
containerTop = rect.top + window.scrollY;
|
|
||||||
scrollableDistance = Math.max(containerRef.current.offsetHeight - window.innerHeight, 1);
|
|
||||||
maxTranslate = Math.max(trackRef.current.scrollWidth - window.innerWidth, 1);
|
|
||||||
screenCenter = window.innerWidth / 2;
|
|
||||||
const firstCard = trackRef.current.children[0] as HTMLElement | undefined;
|
|
||||||
if (firstCard) {
|
|
||||||
cardStep = firstCard.offsetWidth + 48; // card width + gap
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
measure();
|
|
||||||
window.addEventListener('resize', measure, { passive: true });
|
|
||||||
|
|
||||||
// Ultra-fast direct 1:1 synchronization with smooth scroll (Zero double-damping lag)
|
|
||||||
const updatePosition = () => {
|
|
||||||
const sy = window.scrollY;
|
|
||||||
const offset = sy - containerTop;
|
|
||||||
const progress = Math.min(Math.max(offset / scrollableDistance, 0), 1);
|
|
||||||
const currentX = progress * maxTranslate;
|
|
||||||
|
|
||||||
if (trackRef.current) {
|
|
||||||
// Direct GPU compositor translation (100% synchronized with Lenis)
|
|
||||||
trackRef.current.style.transform = `translate3d(-${currentX.toFixed(1)}px, 0, 0)`;
|
|
||||||
|
|
||||||
if (bgTextRef.current) {
|
|
||||||
bgTextRef.current.style.transform = `translate3d(-${(currentX * 0.35).toFixed(1)}px, 0, 0) rotateX(8deg)`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (progressBarRef.current) {
|
|
||||||
progressBarRef.current.style.width = `${Math.max(progress * 100, 4).toFixed(1)}%`;
|
|
||||||
}
|
|
||||||
if (progressTextRef.current) {
|
|
||||||
progressTextRef.current.textContent = `PROGRESS ${Math.round(progress * 100)}%`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const currentActive = Math.min(Math.round(progress * 2), 2);
|
|
||||||
setActiveCardIndex(currentActive);
|
|
||||||
|
|
||||||
// Arithmetic 3D perspective rotation (zero forced reflows)
|
|
||||||
const cards = trackRef.current.children;
|
|
||||||
const padLeft = window.innerWidth > 640 ? 48 : 24;
|
|
||||||
for (let i = 0; i < cards.length; i++) {
|
|
||||||
const card = cards[i] as HTMLElement;
|
|
||||||
const cardCenter = padLeft + i * cardStep + (cardStep - 48) / 2 - currentX;
|
|
||||||
const dist = (cardCenter - screenCenter) / (screenCenter * 1.2);
|
|
||||||
const rotY = Math.max(Math.min(dist * -6, 9), -9);
|
|
||||||
const scale = Math.max(1 - Math.abs(dist) * 0.03, 0.96);
|
|
||||||
|
|
||||||
card.style.transform = `perspective(1100px) rotateY(${rotY.toFixed(2)}deg) scale3d(${scale.toFixed(3)}, ${scale.toFixed(3)}, 1)`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
let timeoutId: NodeJS.Timeout;
|
||||||
const handleScroll = () => {
|
const handleScroll = () => {
|
||||||
if (!ticking) {
|
clearTimeout(timeoutId);
|
||||||
ticking = true;
|
timeoutId = setTimeout(() => {
|
||||||
requestAnimationFrame(() => {
|
if (!container) return;
|
||||||
updatePosition();
|
const scrollLeft = container.scrollLeft;
|
||||||
ticking = false;
|
const containerCenter = scrollLeft + container.offsetWidth / 2;
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Trackpad horizontal swipe listener (converts two-finger deltaX directly into scroll)
|
let closestIdx = 0;
|
||||||
const handleWheel = (e: WheelEvent) => {
|
let minDiff = Infinity;
|
||||||
if (!containerRef.current) return;
|
|
||||||
const rect = containerRef.current.getBoundingClientRect();
|
for (let i = 0; i < container.children.length; i++) {
|
||||||
if (rect.top <= 20 && rect.bottom >= window.innerHeight - 20) {
|
const child = container.children[i] as HTMLElement;
|
||||||
if (Math.abs(e.deltaX) > Math.abs(e.deltaY) && Math.abs(e.deltaX) > 2) {
|
const childCenter = child.offsetLeft + child.offsetWidth / 2;
|
||||||
window.scrollBy({ top: e.deltaX * 0.9, behavior: 'instant' });
|
const diff = Math.abs(containerCenter - childCenter);
|
||||||
|
if (diff < minDiff) {
|
||||||
|
minDiff = diff;
|
||||||
|
closestIdx = i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
setActiveIndex(closestIdx);
|
||||||
|
}, 50);
|
||||||
};
|
};
|
||||||
|
|
||||||
window.addEventListener('scroll', handleScroll, { passive: true });
|
container.addEventListener('scroll', handleScroll, { passive: true });
|
||||||
window.addEventListener('wheel', handleWheel, { passive: true });
|
|
||||||
// Initial sync
|
|
||||||
updatePosition();
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener('resize', measure);
|
clearTimeout(timeoutId);
|
||||||
window.removeEventListener('scroll', handleScroll);
|
container.removeEventListener('scroll', handleScroll);
|
||||||
window.removeEventListener('wheel', handleWheel);
|
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// Mouse Drag to Scroll handlers
|
||||||
|
const onMouseDown = (e: React.MouseEvent) => {
|
||||||
|
// Only drag when clicking background/card frame, not when interacting with inputs/buttons
|
||||||
|
const target = e.target as HTMLElement;
|
||||||
|
if (target.closest('button') || target.closest('a') || target.closest('input')) return;
|
||||||
|
|
||||||
|
if (!scrollRef.current) return;
|
||||||
|
setIsDragging(true);
|
||||||
|
setDragStartX(e.pageX - scrollRef.current.offsetLeft);
|
||||||
|
setDragScrollLeft(scrollRef.current.scrollLeft);
|
||||||
|
};
|
||||||
|
|
||||||
|
const onMouseMove = (e: React.MouseEvent) => {
|
||||||
|
if (!isDragging || !scrollRef.current) return;
|
||||||
|
e.preventDefault();
|
||||||
|
const x = e.pageX - scrollRef.current.offsetLeft;
|
||||||
|
const walk = (x - dragStartX) * 1.5; // Drag speed multiplier
|
||||||
|
scrollRef.current.scrollLeft = dragScrollLeft - walk;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onMouseUp = () => {
|
||||||
|
setIsDragging(false);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section
|
<section
|
||||||
id="flagship-models"
|
id="flagship-models"
|
||||||
ref={containerRef}
|
className="py-20 sm:py-28 lg:py-32 bg-[#FAF8F5] border-t border-slate-900/[0.08] relative overflow-hidden"
|
||||||
className="relative h-[150vh] sm:h-[170vh] bg-[#FAF8F5] border-t border-slate-900/[0.08] overflow-visible"
|
|
||||||
>
|
>
|
||||||
{/* Sticky Fullscreen Camera Viewport */}
|
{/* Subtle Ambient Background Gradient */}
|
||||||
<div className="sticky top-0 h-screen w-full overflow-hidden flex flex-col justify-between py-8 sm:py-12 select-none">
|
<div className="absolute top-1/4 left-1/3 w-[500px] h-[500px] bg-blue-500/[0.025] rounded-full blur-3xl pointer-events-none -z-10" />
|
||||||
{/* Massive 3D Kinetic Background Typography Ribbon (Parallax Drift) */}
|
<div className="absolute bottom-1/4 right-1/4 w-[450px] h-[450px] bg-amber-500/[0.02] rounded-full blur-3xl pointer-events-none -z-10" />
|
||||||
<div
|
|
||||||
ref={bgTextRef}
|
|
||||||
className="absolute top-1/2 -translate-y-1/2 left-0 w-max whitespace-nowrap pointer-events-none -z-10 opacity-25 select-none preserve-3d"
|
|
||||||
aria-hidden="true"
|
|
||||||
>
|
|
||||||
<span className="font-display font-black text-[13vw] uppercase tracking-tighter text-transparent bg-clip-text bg-gradient-to-r from-slate-900/10 via-blue-900/15 to-amber-900/10 block leading-none">
|
|
||||||
01 ALPHA MATTING // 02 DERMAL RETOUCH // 03 4K SUPER-RES // STUDIO ARCHIVE //
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Ambient Subtle Gradients */}
|
{/* Massive Typographic Watermark (Lightweight CSS) */}
|
||||||
<div className="absolute top-1/4 left-1/3 w-[500px] h-[500px] bg-blue-500/[0.035] rounded-full blur-3xl pointer-events-none -z-10" />
|
<div
|
||||||
<div className="absolute bottom-1/4 right-1/4 w-[450px] h-[450px] bg-amber-500/[0.03] rounded-full blur-3xl pointer-events-none -z-10" />
|
className="absolute top-6 left-1/2 -translate-x-1/2 w-max select-none pointer-events-none opacity-[0.03] -z-10"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
<span className="font-display font-black text-[12vw] uppercase tracking-tighter text-slate-900 block leading-none">
|
||||||
|
FLAGSHIP VISION ARCHIVE
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Section Top Header & Navigation Telemetry with 3D Depth */}
|
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-8 sm:mb-12">
|
||||||
<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">
|
{/* Header Row: Title & Editorial Badge */}
|
||||||
<div className="preserve-3d">
|
<div className="flex flex-col md:flex-row md:items-end justify-between gap-6 pb-6 border-b border-slate-200">
|
||||||
<div className="badge-3d inline-flex items-center gap-2 px-3.5 py-1 rounded-full bg-blue-50/90 border border-blue-200/80 text-[11px] font-mono font-semibold text-blue-700 mb-2 shadow-sm">
|
<div>
|
||||||
|
<div className="inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-blue-50 border border-blue-200 text-xs font-mono font-semibold text-blue-700 mb-3 shadow-sm">
|
||||||
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
|
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
|
||||||
<span>HORIZONTAL 3D CINEMATIC ARCHIVE</span>
|
<span>FLAGSHIP TRANSFORMATION MODELS</span>
|
||||||
</div>
|
</div>
|
||||||
<h2 className="text-2xl sm:text-4xl lg:text-5xl font-display font-black text-slate-900 tracking-tight text-3d-chiseled">
|
<h2 className="text-3xl 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 text-3d-gradient">In Real-Time</span>
|
Interactive <span className="text-transparent bg-clip-text bg-gradient-to-r from-blue-700 via-indigo-600 to-amber-600">Model Showcase</span>
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex flex-wrap items-center gap-2.5 sm:gap-3">
|
{/* Navigation Controls: Tabs & Arrow Buttons */}
|
||||||
{/* Quick Card Jump Pills */}
|
<div className="flex flex-wrap items-center gap-3">
|
||||||
<div className="hidden sm:flex items-center gap-1.5 bg-slate-100/80 backdrop-blur-sm p-1 rounded-full border border-slate-200/80">
|
{/* Quick Model Tabs */}
|
||||||
{showcaseCards.map((c, i) => (
|
<div className="inline-flex items-center gap-1 p-1 bg-white rounded-full border border-slate-200 shadow-sm">
|
||||||
<button
|
{showcaseCards.map((card, idx) => {
|
||||||
key={c.id}
|
const isActive = activeIndex === idx;
|
||||||
onClick={() => scrollToCard(i)}
|
return (
|
||||||
className={`px-3 py-1 rounded-full text-xs font-mono font-bold transition-all duration-200 ${
|
<button
|
||||||
activeCardIndex === i
|
key={card.id}
|
||||||
? 'bg-blue-600 text-white shadow-sm'
|
onClick={() => scrollToCard(idx)}
|
||||||
: 'text-slate-600 hover:text-slate-900'
|
className={`px-3.5 py-1.5 rounded-full text-xs font-mono font-bold transition-all duration-200 ${
|
||||||
}`}
|
isActive
|
||||||
>
|
? 'bg-blue-600 text-white shadow-sm shadow-blue-500/20'
|
||||||
0{i + 1}
|
: 'text-slate-600 hover:text-slate-950 hover:bg-slate-100'
|
||||||
</button>
|
}`}
|
||||||
))}
|
>
|
||||||
|
<span>0{idx + 1}</span>
|
||||||
|
<span className="hidden sm:inline ml-1 font-sans text-xs">
|
||||||
|
{card.category.split(' ')[0]}
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Quick Step Controls */}
|
{/* Prev / Next Arrows */}
|
||||||
<div className="flex items-center gap-1">
|
<div className="flex items-center gap-1.5">
|
||||||
<button
|
<button
|
||||||
onClick={() => navigateStep(-1)}
|
onClick={handlePrev}
|
||||||
disabled={activeCardIndex === 0}
|
disabled={activeIndex === 0}
|
||||||
aria-label="Previous card"
|
aria-label="Previous Model"
|
||||||
className="w-8 h-8 rounded-full bg-white border border-slate-200 shadow-sm flex items-center justify-center text-slate-700 hover:text-blue-600 hover:border-blue-300 disabled:opacity-40 disabled:cursor-not-allowed transition-all"
|
className="w-9 h-9 rounded-full bg-white border border-slate-200 shadow-sm flex items-center justify-center text-slate-700 hover:text-blue-600 hover:border-blue-300 disabled:opacity-35 disabled:cursor-not-allowed transition-all active:scale-95"
|
||||||
>
|
>
|
||||||
<ChevronLeft className="w-4 h-4" />
|
<ChevronLeft className="w-4 h-4" />
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => navigateStep(1)}
|
onClick={handleNext}
|
||||||
disabled={activeCardIndex === 2}
|
disabled={activeIndex === showcaseCards.length - 1}
|
||||||
aria-label="Next card"
|
aria-label="Next Model"
|
||||||
className="w-8 h-8 rounded-full bg-white border border-slate-200 shadow-sm flex items-center justify-center text-slate-700 hover:text-blue-600 hover:border-blue-300 disabled:opacity-40 disabled:cursor-not-allowed transition-all"
|
className="w-9 h-9 rounded-full bg-white border border-slate-200 shadow-sm flex items-center justify-center text-slate-700 hover:text-blue-600 hover:border-blue-300 disabled:opacity-35 disabled:cursor-not-allowed transition-all active:scale-95"
|
||||||
>
|
>
|
||||||
<ChevronRight className="w-4 h-4" />
|
<ChevronRight className="w-4 h-4" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Progress Badge */}
|
|
||||||
<div className="flex items-center gap-1.5 px-3 py-1 rounded-full bg-white/90 backdrop-blur-sm border border-slate-900/[0.08] text-xs font-mono font-bold text-slate-800 shadow-sm">
|
|
||||||
<span className="w-2 h-2 rounded-full bg-blue-600 animate-ping inline-block" />
|
|
||||||
<span ref={progressTextRef}>PROGRESS 0%</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Horizontal Sliding Filmstrip Track (Zero CSS transition conflicts, 100% hardware GPU translation) */}
|
{/* Panoramic Native Scroll Filmstrip (100% GPU-accelerated, Zero Lag, Native Touch & Drag) */}
|
||||||
<div className="relative w-full my-auto overflow-visible py-4">
|
<div
|
||||||
<div
|
ref={scrollRef}
|
||||||
ref={trackRef}
|
onMouseDown={onMouseDown}
|
||||||
className="flex items-center gap-8 sm:gap-12 px-6 sm:px-12 w-max will-change-transform preserve-3d"
|
onMouseMove={onMouseMove}
|
||||||
>
|
onMouseUp={onMouseUp}
|
||||||
{showcaseCards.map((card) => (
|
onMouseLeave={onMouseUp}
|
||||||
<div
|
className="flex gap-6 sm:gap-8 px-4 sm:px-8 lg:px-12 overflow-x-auto scroll-smooth snap-x snap-mandatory no-scrollbar pb-6 cursor-grab active:cursor-grabbing"
|
||||||
key={card.id}
|
style={{
|
||||||
className="w-[85vw] sm:w-[620px] lg:w-[740px] shrink-0 bg-white/95 backdrop-blur-xl rounded-3xl p-5 sm:p-8 border border-slate-900/[0.08] shadow-cinematic-3d hover:shadow-cinematic-hover transition-shadow duration-300 preserve-3d group"
|
WebkitOverflowScrolling: 'touch',
|
||||||
>
|
}}
|
||||||
{/* Card Top Metadata Bar (translateZ 30px) */}
|
>
|
||||||
<div
|
{showcaseCards.map((card, idx) => {
|
||||||
className="flex items-center justify-between pb-4 border-b border-slate-900/[0.06] mb-5 preserve-3d"
|
const isActive = activeIndex === idx;
|
||||||
style={{ transform: 'translateZ(30px)' }}
|
return (
|
||||||
>
|
<div
|
||||||
<div className="flex items-center gap-3">
|
key={card.id}
|
||||||
<span className="font-mono text-xs font-black text-blue-700 tracking-wider">
|
className={`snap-center shrink-0 w-[90vw] sm:w-[680px] lg:w-[840px] bg-white rounded-3xl p-6 sm:p-9 border transition-all duration-300 ${
|
||||||
{card.index}
|
isActive
|
||||||
</span>
|
? 'border-blue-500/40 shadow-xl shadow-slate-900/[0.06] scale-[1.01]'
|
||||||
<span className="h-3 w-px bg-slate-300" />
|
: 'border-slate-900/[0.08] shadow-md opacity-90 hover:opacity-100 hover:border-slate-300'
|
||||||
<span className="font-mono text-[10px] sm:text-xs font-bold text-slate-500 uppercase tracking-widest">
|
}`}
|
||||||
{card.category}
|
>
|
||||||
</span>
|
{/* Card Header Metadata Bar */}
|
||||||
</div>
|
<div className="flex flex-wrap items-center justify-between gap-3 pb-4 border-b border-slate-100 mb-6">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-3">
|
||||||
<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">
|
<span className="font-mono text-sm font-black text-blue-700 tracking-wider">
|
||||||
{card.latency}
|
{card.index}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
<span className="h-3.5 w-px bg-slate-300" />
|
||||||
|
<span className="font-mono text-xs font-bold text-slate-500 uppercase tracking-widest">
|
||||||
|
{card.category}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* 3D Cinematic Comparison Viewport (autoSlide false to save CPU/GPU cycles during horizontal pan) */}
|
<div className="flex items-center gap-2">
|
||||||
<div className="mb-6 relative z-10">
|
<span className="px-3 py-1 rounded-full bg-blue-50 border border-blue-200 text-blue-700 text-xs font-mono font-semibold">
|
||||||
<Cinematic3DComparison
|
{card.model}
|
||||||
beforeUrl={card.beforeUrl}
|
</span>
|
||||||
afterUrl={card.afterUrl}
|
<span className="px-2.5 py-1 rounded-full bg-amber-50 border border-amber-200 text-amber-800 text-[11px] font-mono font-semibold">
|
||||||
beforeLabel="RAW SOURCE"
|
{card.latency}
|
||||||
afterLabel={card.model}
|
</span>
|
||||||
aspectRatio="aspect-[16/10]"
|
|
||||||
autoSlide={false}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Card 3D Stereoscopic Typography Stack */}
|
|
||||||
<div className="space-y-3 preserve-3d">
|
|
||||||
{/* Headline at translateZ 45px with 3D Chiseled Extrusion */}
|
|
||||||
<h3
|
|
||||||
className="text-xl sm:text-2xl font-display font-bold text-slate-900 tracking-tight preserve-3d text-3d-chiseled"
|
|
||||||
style={{ transform: 'translateZ(45px)' }}
|
|
||||||
>
|
|
||||||
{card.title}
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
{/* Description at translateZ 25px */}
|
|
||||||
<p
|
|
||||||
className="text-sm text-slate-600 leading-relaxed font-normal preserve-3d"
|
|
||||||
style={{ transform: 'translateZ(25px)' }}
|
|
||||||
>
|
|
||||||
{card.description}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{/* Specs Chips at translateZ 35px */}
|
|
||||||
<div
|
|
||||||
className="flex flex-wrap gap-2 pt-2 preserve-3d"
|
|
||||||
style={{ transform: 'translateZ(35px)' }}
|
|
||||||
>
|
|
||||||
{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 at translateZ 50px */}
|
|
||||||
<div
|
|
||||||
className="pt-4 flex flex-wrap items-center justify-between gap-3 border-t border-slate-900/[0.06] preserve-3d"
|
|
||||||
style={{ transform: 'translateZ(50px)' }}
|
|
||||||
>
|
|
||||||
<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 h-3 text-blue-400" />
|
|
||||||
<span>{card.appName}</span>
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
|
||||||
|
{/* Interactive Comparison Viewport */}
|
||||||
|
<div className="mb-6 rounded-2xl overflow-hidden border border-slate-200 bg-slate-100">
|
||||||
|
<Cinematic3DComparison
|
||||||
|
beforeUrl={card.beforeUrl}
|
||||||
|
afterUrl={card.afterUrl}
|
||||||
|
beforeLabel="RAW SOURCE"
|
||||||
|
afterLabel={card.model}
|
||||||
|
aspectRatio="aspect-[16/10]"
|
||||||
|
autoSlide={false}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Card Editorial Content & Specifications */}
|
||||||
|
<div className="space-y-4">
|
||||||
|
<div className="flex flex-col sm:flex-row sm:items-baseline justify-between gap-2">
|
||||||
|
<h3 className="text-2xl sm:text-3xl font-display font-bold text-slate-900 tracking-tight">
|
||||||
|
{card.title}
|
||||||
|
</h3>
|
||||||
|
<span className="text-xs font-mono text-blue-600 font-semibold shrink-0">
|
||||||
|
{card.tagline}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p className="text-sm sm:text-base text-slate-600 leading-relaxed font-normal">
|
||||||
|
{card.description}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{/* Specs Chips */}
|
||||||
|
<div className="flex flex-wrap gap-2 pt-1">
|
||||||
|
{card.specs.map((spec, i) => (
|
||||||
|
<span
|
||||||
|
key={i}
|
||||||
|
className="px-3 py-1 rounded-lg bg-slate-50 text-slate-700 text-xs font-mono font-medium border border-slate-200"
|
||||||
|
>
|
||||||
|
✓ {spec}
|
||||||
|
</span>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Direct Action Links */}
|
||||||
|
<div className="pt-4 flex flex-wrap items-center justify-between gap-3 border-t border-slate-100">
|
||||||
|
<Link
|
||||||
|
href={`/tools/${card.toolSlug}`}
|
||||||
|
className="inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-blue-600 hover:bg-blue-700 text-white text-xs font-bold transition-all shadow-sm shadow-blue-500/20 active:scale-95"
|
||||||
|
>
|
||||||
|
<span>Launch Online Studio</span>
|
||||||
|
<ArrowRight className="w-3.5 h-3.5" />
|
||||||
|
</Link>
|
||||||
|
|
||||||
|
<Link
|
||||||
|
href={`/apps/${card.appSlug}`}
|
||||||
|
className="inline-flex items-center gap-1.5 px-4 py-2.5 rounded-full bg-slate-100 hover:bg-slate-200 text-slate-800 text-xs font-bold transition-colors"
|
||||||
|
>
|
||||||
|
<Smartphone className="w-3.5 h-3.5 text-blue-600" />
|
||||||
|
<span>{card.appName}</span>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Bottom Progress Bar Indicator */}
|
||||||
|
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mt-6">
|
||||||
|
<div className="flex items-center justify-between gap-4">
|
||||||
|
<div className="flex-1 max-w-xs h-1.5 bg-slate-200 rounded-full overflow-hidden">
|
||||||
|
<div
|
||||||
|
className="h-full bg-gradient-to-r from-blue-600 to-indigo-600 rounded-full transition-all duration-300"
|
||||||
|
style={{
|
||||||
|
width: `${((activeIndex + 1) / showcaseCards.length) * 100}%`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Bottom Cinematic Control & Progress Rail */}
|
<div className="flex items-center gap-3 text-xs font-mono text-slate-500">
|
||||||
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 w-full z-10">
|
<span>MODEL {activeIndex + 1} OF {showcaseCards.length}</span>
|
||||||
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-3 py-3 border-t border-slate-900/[0.06]">
|
<span>•</span>
|
||||||
{/* Visual Progress Bar Track */}
|
<span>SWIPE OR DRAG TO EXPLORE</span>
|
||||||
<div className="flex-1 max-w-md h-1.5 bg-slate-200/80 rounded-full overflow-hidden">
|
|
||||||
<div
|
|
||||||
ref={progressBarRef}
|
|
||||||
className="h-full bg-gradient-to-r from-blue-600 via-indigo-600 to-amber-500 rounded-full will-change-transform"
|
|
||||||
style={{ width: '4%' }}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Model Metadata Tags */}
|
|
||||||
<div className="flex items-center gap-4 text-xs font-mono text-slate-500">
|
|
||||||
<span>ARCHIVE: VOL. 26</span>
|
|
||||||
<span>•</span>
|
|
||||||
<span>NEURAL VISION ACCELERATOR</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user