feat: implement management folder architecture, hover-only tool sliders, grain transform animation, and prominent upload studio
This commit is contained in:
@@ -1,24 +1,5 @@
|
||||
'use client';
|
||||
|
||||
import React, { useRef, useState } from 'react';
|
||||
import Link from 'next/link';
|
||||
import {
|
||||
Play,
|
||||
Pause,
|
||||
Volume2,
|
||||
VolumeX,
|
||||
ArrowRight,
|
||||
Sparkles,
|
||||
Image as ImageIcon,
|
||||
Video as VideoIcon,
|
||||
Layers,
|
||||
CheckCircle2
|
||||
} from 'lucide-react';
|
||||
import { ShimmerBadge } from '@/components/animate-ui/ShimmerBadge';
|
||||
import { SpotlightCard } from '@/components/animate-ui/SpotlightCard';
|
||||
import { BorderBeam } from '@/components/animate-ui/BorderBeam';
|
||||
import { MotionTextReveal } from '@/components/animate-ui/MotionTextReveal';
|
||||
import { AnimatedGradientText } from '@/components/animate-ui/AnimatedGradientText';
|
||||
import { ArrowRight, Image as ImageIcon, Play, Video } from 'lucide-react';
|
||||
|
||||
export interface MediaItem {
|
||||
id: string;
|
||||
@@ -43,94 +24,28 @@ interface MediaShowcaseProps {
|
||||
items?: MediaItem[];
|
||||
}
|
||||
|
||||
const DEFAULT_MEDIA_ITEMS: MediaItem[] = [
|
||||
{
|
||||
id: 'video-retouch-reel',
|
||||
type: 'video',
|
||||
title: '4K Studio Model Portrait Session',
|
||||
category: 'VIDEO ENHANCEMENT',
|
||||
badge: '4K 60FPS VIDEO',
|
||||
description: 'Continuous temporal facial neural retouching across dynamic video frames with zero flicker.',
|
||||
videoUrl: 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4',
|
||||
poster: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=800&auto=format&fit=crop&q=80',
|
||||
link: '/tools/blemish-remover',
|
||||
tag: 'Temporal Retouching',
|
||||
},
|
||||
{
|
||||
id: 'hair-alpha-photo',
|
||||
type: 'photo',
|
||||
title: 'Fine Flyaway Strand Alpha Extraction',
|
||||
category: 'HAIR CUTOUT',
|
||||
badge: 'ULTRA HD PHOTO',
|
||||
description: 'Microscopic hair fiber separation preserving semi-transparent boundary details for editorial covers.',
|
||||
image: 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=800&auto=format&fit=crop&q=80',
|
||||
link: '/tools/background-remover',
|
||||
tag: '0.02px Edge Trim',
|
||||
},
|
||||
{
|
||||
id: 'restoration-comparison',
|
||||
type: 'comparison',
|
||||
title: '4K Generative Facial Restoration',
|
||||
category: 'SUPER-RESOLUTION',
|
||||
badge: 'SIDE-BY-SIDE',
|
||||
description: 'Deep neural priors reconstruct iris sharpness and realistic skin pores from compressed source photos.',
|
||||
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',
|
||||
link: '/tools/photo-enhancer',
|
||||
tag: 'Iris Sharpness',
|
||||
},
|
||||
];
|
||||
|
||||
export function MediaShowcaseSection({
|
||||
title = 'Visual Media & Transformation Reel',
|
||||
badge = 'CURATED CREATIVE GALLERY',
|
||||
subtitle = 'Explore high-resolution photography, 4K video clips, and creative transformations produced by CRE neural tools.',
|
||||
items = DEFAULT_MEDIA_ITEMS,
|
||||
subtitle = 'Explore high-resolution photography, video, and creative transformations produced by CRE neural tools.',
|
||||
items = [],
|
||||
}: MediaShowcaseProps) {
|
||||
const mediaItems = items && items.length > 0 ? items : DEFAULT_MEDIA_ITEMS;
|
||||
|
||||
return (
|
||||
<section className="py-20 sm:py-24 bg-[#F5F2EB] border-y border-slate-900/[0.08] relative overflow-hidden">
|
||||
{/* Ambient background glow */}
|
||||
<div className="absolute top-1/4 right-1/4 w-96 h-96 bg-blue-500/[0.03] rounded-full blur-3xl pointer-events-none" />
|
||||
|
||||
<div className="w-full max-w-[1640px] 2xl:max-w-[1720px] mx-auto px-4 sm:px-6 lg:px-8 xl:px-10 relative z-10">
|
||||
{/* Section Header */}
|
||||
<div className="flex flex-col md:flex-row md:items-end justify-between gap-4 mb-12 pb-6 border-b border-slate-900/[0.08]">
|
||||
<div>
|
||||
<div className="mb-2.5">
|
||||
<ShimmerBadge>
|
||||
<Sparkles className="w-3.5 h-3.5 text-blue-600" />
|
||||
<span>{badge}</span>
|
||||
</ShimmerBadge>
|
||||
</div>
|
||||
<h3 className="text-2xl sm:text-3xl lg:text-4xl font-display font-black text-slate-900 tracking-tight">
|
||||
<MotionTextReveal text="Visual Media &" className="text-slate-900 inline" />{' '}
|
||||
<AnimatedGradientText className="font-black">
|
||||
Transformation Reel
|
||||
</AnimatedGradientText>
|
||||
</h3>
|
||||
<p className="text-xs sm:text-sm text-slate-600 mt-1 max-w-2xl font-normal">
|
||||
{subtitle}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-3 self-start md:self-end">
|
||||
<Link
|
||||
href="/#studio-suite"
|
||||
className="text-xs font-mono font-bold text-blue-700 bg-white hover:bg-blue-50 border border-slate-200 px-4 py-2 rounded-full flex items-center gap-1.5 shadow-sm transition-all duration-200 hover:-translate-y-0.5"
|
||||
>
|
||||
<span>Explore The Suite</span>
|
||||
<ArrowRight className="w-3.5 h-3.5" />
|
||||
</Link>
|
||||
<section className="relative overflow-hidden border-y border-slate-900/[0.08] bg-[#F5F2EB] py-16 sm:py-20 lg:py-24">
|
||||
<div className="mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8">
|
||||
<div className="mb-9 flex flex-col gap-4 border-b border-slate-900/[0.08] pb-7 sm:mb-12 sm:flex-row sm:items-end sm:justify-between">
|
||||
<div className="max-w-2xl">
|
||||
<p className="eyebrow">{badge}</p>
|
||||
<h2 className="mt-3 text-3xl font-display font-bold tracking-tight text-slate-900 sm:text-4xl">{title}</h2>
|
||||
<p className="mt-3 text-sm leading-relaxed text-slate-600 sm:text-base">{subtitle}</p>
|
||||
</div>
|
||||
<Link href="/#studio-suite" className="button-secondary shrink-0">
|
||||
Explore the suite <ArrowRight className="h-4 w-4" />
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{/* Dynamic Media Grid: Video Cards, Photo Showcases & Side-by-Side Frames */}
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 sm:gap-8">
|
||||
{mediaItems.map((item) => (
|
||||
<MediaCard key={item.id} item={item} />
|
||||
))}
|
||||
<div className="grid gap-5 md:grid-cols-3">
|
||||
{items.map((item) => <MediaCard key={item.id} item={item} />)}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -138,147 +53,50 @@ export function MediaShowcaseSection({
|
||||
}
|
||||
|
||||
function MediaCard({ item }: { item: MediaItem }) {
|
||||
const videoRef = useRef<HTMLVideoElement>(null);
|
||||
const [isPlaying, setIsPlaying] = useState(false);
|
||||
const [isMuted, setIsMuted] = useState(true);
|
||||
|
||||
const togglePlay = () => {
|
||||
if (!videoRef.current) return;
|
||||
if (isPlaying) {
|
||||
videoRef.current.pause();
|
||||
setIsPlaying(false);
|
||||
} else {
|
||||
videoRef.current.play().catch(() => {});
|
||||
setIsPlaying(true);
|
||||
}
|
||||
};
|
||||
|
||||
const toggleMute = () => {
|
||||
if (!videoRef.current) return;
|
||||
videoRef.current.muted = !isMuted;
|
||||
setIsMuted(!isMuted);
|
||||
};
|
||||
const image = item.image || item.poster || item.beforeUrl;
|
||||
|
||||
return (
|
||||
<SpotlightCard className="group bg-white rounded-3xl p-5 sm:p-6 border border-slate-900/[0.08] shadow-sm hover:shadow-2xl hover:border-blue-400/80 hover:-translate-y-1.5 transition-all duration-300 flex flex-col justify-between relative">
|
||||
<BorderBeam duration={12} size={250} borderWidth={1.5} colorFrom="#3b82f6" colorTo="#a855f7" />
|
||||
|
||||
<div>
|
||||
{/* Card Header Tag */}
|
||||
<div className="flex items-center justify-between gap-2 mb-4 pb-3 border-b border-slate-100">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-[10px] font-mono font-bold uppercase tracking-wider text-blue-700 bg-blue-50 border border-blue-200/80 px-2.5 py-0.5 rounded-full flex items-center gap-1">
|
||||
{item.type === 'video' ? <VideoIcon className="w-3 h-3 text-blue-600" /> : <ImageIcon className="w-3 h-3 text-blue-600" />}
|
||||
<span>{item.category}</span>
|
||||
</span>
|
||||
</div>
|
||||
{item.badge && (
|
||||
<span className="text-[10px] font-mono font-bold text-slate-700 bg-slate-100 border border-slate-200 px-2.5 py-0.5 rounded-full">
|
||||
{item.badge}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Media Viewport Container */}
|
||||
<div className="relative aspect-[16/10] rounded-2xl overflow-hidden mb-5 bg-slate-950 border border-slate-200 shadow-inner group/media">
|
||||
{item.type === 'video' && item.videoUrl ? (
|
||||
/* HTML5 Video Player Viewport */
|
||||
<div className="relative w-full h-full">
|
||||
<video
|
||||
ref={videoRef}
|
||||
src={item.videoUrl}
|
||||
poster={item.poster}
|
||||
loop
|
||||
muted={isMuted}
|
||||
playsInline
|
||||
className="w-full h-full object-cover"
|
||||
onPlay={() => setIsPlaying(true)}
|
||||
onPause={() => setIsPlaying(false)}
|
||||
/>
|
||||
|
||||
{/* Video Controls Overlay */}
|
||||
<div className="absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent flex items-end justify-between p-3.5 pointer-events-none">
|
||||
<button
|
||||
onClick={togglePlay}
|
||||
aria-label={isPlaying ? 'Pause video' : 'Play video'}
|
||||
className="pointer-events-auto w-9 h-9 rounded-full bg-white/95 text-slate-900 shadow-lg flex items-center justify-center hover:scale-110 active:scale-95 transition-all"
|
||||
>
|
||||
{isPlaying ? <Pause className="w-4 h-4 fill-slate-900" /> : <Play className="w-4 h-4 fill-slate-900 ml-0.5" />}
|
||||
</button>
|
||||
|
||||
<div className="flex items-center gap-2 pointer-events-auto">
|
||||
<button
|
||||
onClick={toggleMute}
|
||||
aria-label={isMuted ? 'Unmute' : 'Mute'}
|
||||
className="w-8 h-8 rounded-full bg-black/60 text-white backdrop-blur-md flex items-center justify-center hover:bg-black/80 transition-colors"
|
||||
>
|
||||
{isMuted ? <VolumeX className="w-3.5 h-3.5" /> : <Volume2 className="w-3.5 h-3.5" />}
|
||||
</button>
|
||||
<span className="px-2 py-0.5 rounded bg-black/70 backdrop-blur-md text-[9px] font-mono font-bold text-white">
|
||||
4K VIDEO
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
) : item.type === 'comparison' && item.beforeUrl && item.afterUrl ? (
|
||||
/* Clean Side-by-Side Dual Split Frame */
|
||||
<div className="grid grid-cols-2 h-full w-full">
|
||||
<div className="relative h-full overflow-hidden border-r border-white/20">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src={item.beforeUrl} alt="Original source" className="h-full w-full object-cover" />
|
||||
<span className="absolute bottom-2 left-2 bg-black/80 backdrop-blur-md px-2 py-0.5 rounded text-[9px] font-mono font-bold text-white shadow-sm">
|
||||
RAW INPUT
|
||||
</span>
|
||||
</div>
|
||||
<div className="relative h-full overflow-hidden">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src={item.afterUrl} alt="CRE Reconstructed result" className="h-full w-full object-cover group-hover/media:scale-105 transition-transform duration-700" />
|
||||
<span className="absolute bottom-2 right-2 bg-blue-600/90 backdrop-blur-md px-2 py-0.5 rounded text-[9px] font-mono font-bold text-white shadow-sm">
|
||||
CRE AI
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
/* High-Res Photo Showcase Viewport */
|
||||
<div className="relative w-full h-full">
|
||||
<article className="group overflow-hidden rounded-3xl border border-slate-900/[0.08] bg-white shadow-cream-sm transition-shadow duration-300 hover:shadow-cream-md">
|
||||
<div className="relative aspect-[16/10] overflow-hidden bg-slate-100">
|
||||
{item.type === 'video' && item.videoUrl ? (
|
||||
<video controls preload="none" playsInline poster={item.poster} className="h-full w-full object-cover" aria-label={item.title}>
|
||||
<source src={item.videoUrl} type="video/mp4" />
|
||||
</video>
|
||||
) : item.type === 'comparison' && item.beforeUrl && item.afterUrl ? (
|
||||
<div className="grid h-full grid-cols-2">
|
||||
<figure className="relative overflow-hidden border-r border-white/30">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img
|
||||
src={item.image || item.poster || item.beforeUrl || 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=800&auto=format&fit=crop&q=80'}
|
||||
alt={item.title}
|
||||
className="w-full h-full object-cover group-hover/media:scale-105 transition-transform duration-700"
|
||||
/>
|
||||
<div className="absolute inset-0 bg-gradient-to-t from-slate-950/60 via-transparent to-transparent pointer-events-none" />
|
||||
{item.tag && (
|
||||
<span className="absolute bottom-3 left-3 bg-white/90 backdrop-blur-md px-2.5 py-1 rounded-lg text-[10px] font-mono font-bold text-slate-800 shadow-sm">
|
||||
{item.tag}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Card Copy */}
|
||||
<h4 className="text-lg sm:text-xl font-display font-bold text-slate-900 group-hover:text-blue-600 transition-colors tracking-tight mb-2">
|
||||
{item.title}
|
||||
</h4>
|
||||
<p className="text-xs sm:text-sm text-slate-600 font-normal leading-relaxed mb-4">
|
||||
{item.description}
|
||||
</p>
|
||||
<img src={item.beforeUrl} alt="Original image" loading="lazy" decoding="async" className="h-full w-full object-cover" />
|
||||
<figcaption className="media-label left-2">Before</figcaption>
|
||||
</figure>
|
||||
<figure className="relative overflow-hidden">
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src={item.afterUrl} alt="Enhanced image" loading="lazy" decoding="async" className="h-full w-full object-cover transition-transform duration-500 group-hover:scale-[1.03]" />
|
||||
<figcaption className="media-label right-2">After</figcaption>
|
||||
</figure>
|
||||
</div>
|
||||
) : image ? (
|
||||
<>
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
<img src={image} alt={item.title} loading="lazy" decoding="async" className="h-full w-full object-cover transition-transform duration-500 group-hover:scale-[1.03]" />
|
||||
<div className="absolute inset-0 bg-gradient-to-t from-slate-950/45 to-transparent" />
|
||||
</>
|
||||
) : null}
|
||||
<span className="absolute left-3 top-3 inline-flex items-center gap-1.5 rounded-full bg-white/94 px-2.5 py-1 text-[10px] font-semibold uppercase tracking-wide text-slate-700 shadow-sm">
|
||||
{item.type === 'video' ? <Video className="h-3 w-3 text-blue-700" /> : <ImageIcon className="h-3 w-3 text-blue-700" />}
|
||||
{item.category}
|
||||
</span>
|
||||
{item.type === 'video' && <Play className="pointer-events-none absolute bottom-3 right-3 h-8 w-8 rounded-full bg-white/90 p-2 text-slate-900 shadow-sm" />}
|
||||
</div>
|
||||
|
||||
{/* Action Link */}
|
||||
<div className="pt-3 border-t border-slate-100 flex items-center justify-between">
|
||||
<span className="text-[11px] font-mono text-slate-400">
|
||||
Studio Preset
|
||||
</span>
|
||||
<Link
|
||||
href={item.link}
|
||||
className="inline-flex items-center gap-1.5 text-xs font-mono font-bold text-blue-600 group-hover:text-blue-700 group-hover:translate-x-0.5 transition-all"
|
||||
>
|
||||
<span>Open Tool</span>
|
||||
<ArrowRight className="w-3.5 h-3.5" />
|
||||
<div className="p-5">
|
||||
{item.tag && <p className="text-xs font-semibold uppercase tracking-[0.12em] text-blue-700">{item.tag}</p>}
|
||||
<h3 className="mt-2 text-xl font-display font-bold tracking-tight text-slate-900">{item.title}</h3>
|
||||
<p className="mt-2 text-sm leading-relaxed text-slate-600">{item.description}</p>
|
||||
<Link href={item.link} className="mt-5 inline-flex items-center gap-1.5 text-sm font-semibold text-blue-700 transition-transform hover:translate-x-0.5">
|
||||
Open tool <ArrowRight className="h-4 w-4" />
|
||||
</Link>
|
||||
</div>
|
||||
</SpotlightCard>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user