feat: real-time auto-sliding and hover-scrubbing cards in tool stack, and interactive 2-column Try It transformation studio on tool pages
This commit is contained in:
@@ -8,7 +8,7 @@ import { TryItWidget } from './TryItWidget';
|
|||||||
import { HeroPrism } from '@/components/3d/HeroPrism';
|
import { HeroPrism } from '@/components/3d/HeroPrism';
|
||||||
import { Kinetic3DText } from '@/components/ui/Kinetic3DText';
|
import { Kinetic3DText } from '@/components/ui/Kinetic3DText';
|
||||||
import { ShimmerBadge } from '@/components/animate-ui/ShimmerBadge';
|
import { ShimmerBadge } from '@/components/animate-ui/ShimmerBadge';
|
||||||
import { DeferredComparison } from '@/components/ui/DeferredComparison';
|
import { CardBeforeAfterSlider } from '@/components/ui/CardBeforeAfterSlider';
|
||||||
|
|
||||||
interface HeroSectionProps {
|
interface HeroSectionProps {
|
||||||
title?: any;
|
title?: any;
|
||||||
@@ -170,7 +170,7 @@ export function HeroSection({
|
|||||||
<div className="relative rounded-[2rem] border border-slate-900/[0.1] bg-white p-2.5 sm:p-3 shadow-cinematic-3d">
|
<div className="relative rounded-[2rem] border border-slate-900/[0.1] bg-white p-2.5 sm:p-3 shadow-cinematic-3d">
|
||||||
{example?.before && example?.after ? (
|
{example?.before && example?.after ? (
|
||||||
<div className="space-y-2.5">
|
<div className="space-y-2.5">
|
||||||
<DeferredComparison
|
<CardBeforeAfterSlider
|
||||||
beforeUrl={example.before}
|
beforeUrl={example.before}
|
||||||
afterUrl={example.after}
|
afterUrl={example.after}
|
||||||
beforeLabel="ORIGINAL"
|
beforeLabel="ORIGINAL"
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ function SectionContent({ section, context }: SectionRendererProps) {
|
|||||||
case 'tryItWidget':
|
case 'tryItWidget':
|
||||||
if (!context.tool) return null;
|
if (!context.tool) return null;
|
||||||
return (
|
return (
|
||||||
<div className="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
<div id="tool-tryit" className="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10 sm:py-14">
|
||||||
<TryItWidget
|
<TryItWidget
|
||||||
tool={context.tool}
|
tool={context.tool}
|
||||||
homeApp={context.homeApp}
|
homeApp={context.homeApp}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { ToolItem, AppItem, VariantSpec, resolveLocalised } from '@/types';
|
import { ToolItem, AppItem, VariantSpec, resolveLocalised } from '@/types';
|
||||||
import { BeforeAfterSlider } from '../ui/BeforeAfterSlider';
|
import { BeforeAfterSlider } from '../ui/BeforeAfterSlider';
|
||||||
|
import { CardBeforeAfterSlider } from '../ui/CardBeforeAfterSlider';
|
||||||
|
|
||||||
interface TryItWidgetProps {
|
interface TryItWidgetProps {
|
||||||
tool: ToolItem;
|
tool: ToolItem;
|
||||||
@@ -206,65 +207,111 @@ export function TryItWidget({
|
|||||||
{/* Main Body per Status */}
|
{/* Main Body per Status */}
|
||||||
<div className="mt-7">
|
<div className="mt-7">
|
||||||
{status === 'idle' && (
|
{status === 'idle' && (
|
||||||
<div className="space-y-6">
|
<div className="grid grid-cols-1 lg:grid-cols-[1.1fr_.9fr] gap-8 items-center">
|
||||||
{/* Drag & Drop Upload Zone */}
|
{/* Left Column: Interactive Before/After Transformation Preview */}
|
||||||
<div
|
<div className="space-y-3">
|
||||||
onDrop={handleDrop}
|
<div className="flex items-center justify-between">
|
||||||
onDragOver={(e) => {
|
<span className="text-xs font-mono uppercase tracking-wider text-slate-500 font-bold flex items-center gap-1.5">
|
||||||
e.preventDefault();
|
<Sparkles className="w-3.5 h-3.5 text-blue-600" /> Real AI Transformation Output
|
||||||
setIsDragOver(true);
|
</span>
|
||||||
}}
|
<span className="text-[10px] font-mono font-semibold text-blue-700 bg-blue-50 px-2 py-0.5 rounded-full border border-blue-200">
|
||||||
onDragLeave={() => setIsDragOver(false)}
|
Auto-sliding & scrubber
|
||||||
onClick={() => fileInputRef.current?.click()}
|
</span>
|
||||||
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]'
|
|
||||||
: 'border-slate-300 hover:border-blue-500 bg-slate-50/50 hover:bg-blue-50/20'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
ref={fileInputRef}
|
|
||||||
type="file"
|
|
||||||
accept="image/jpeg,image/png,image/webp"
|
|
||||||
className="hidden"
|
|
||||||
onChange={(e) => e.target.files?.[0] && handleFileChange(e.target.files[0])}
|
|
||||||
/>
|
|
||||||
<div className="w-16 h-16 sm:w-20 sm:h-20 mx-auto mb-4 rounded-3xl bg-blue-50 border border-blue-100 flex items-center justify-center text-blue-600 group-hover:scale-110 transition-all duration-300 shadow-sm">
|
|
||||||
<UploadCloud className="w-8 h-8 sm:w-10 sm:h-10" />
|
|
||||||
</div>
|
</div>
|
||||||
<p className="text-base sm:text-lg font-display font-bold text-slate-900">
|
|
||||||
Drag & drop your photo here, or <span className="text-blue-600 underline decoration-blue-300 underline-offset-4 group-hover:text-blue-700">browse file</span>
|
{tool.content?.examples?.[0]?.before && tool.content?.examples?.[0]?.after ? (
|
||||||
</p>
|
<div className="rounded-2xl overflow-hidden border border-slate-900/10 shadow-cream-sm">
|
||||||
<p className="mt-1.5 text-xs font-mono text-slate-500">
|
<CardBeforeAfterSlider
|
||||||
Supports JPG, PNG, WEBP up to {tool.tryIt?.limits?.maxMB || 12}MB
|
beforeUrl={tool.content.examples[0].before}
|
||||||
</p>
|
afterUrl={tool.content.examples[0].after}
|
||||||
|
beforeLabel="ORIGINAL"
|
||||||
|
afterLabel="AI RESULT"
|
||||||
|
aspectRatio="aspect-[4/3] sm:aspect-[16/10]"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="aspect-[16/10] bg-slate-100 rounded-2xl grid place-items-center text-slate-400 text-sm">
|
||||||
|
Transformation preview
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{tool.content?.examples?.[0]?.caption && (
|
||||||
|
<p className="text-center text-xs font-medium text-slate-500 px-1">
|
||||||
|
{tool.content.examples[0].caption}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Quick Sample Presets */}
|
{/* Right Column: Upload Zone & Instant Samples */}
|
||||||
<div>
|
<div className="space-y-5">
|
||||||
<p className="text-xs font-mono uppercase tracking-wider text-slate-500 font-semibold mb-3">
|
<div>
|
||||||
Or inspect with an instant sample photo:
|
<h4 className="font-display font-bold text-slate-900 text-lg sm:text-xl">
|
||||||
</p>
|
Try with your photo
|
||||||
<div className="flex flex-wrap gap-2.5">
|
</h4>
|
||||||
{samplePresets.map((preset, idx) => (
|
<p className="text-xs text-slate-500 mt-1">
|
||||||
<button
|
Test {resolveLocalised(tool.name, locale)} in your browser with zero setup or sign-in.
|
||||||
key={idx}
|
</p>
|
||||||
onClick={() => loadSamplePreset(preset.url)}
|
</div>
|
||||||
className="inline-flex items-center gap-2 px-4 py-2.5 rounded-xl text-xs font-semibold bg-slate-100 border border-slate-200 text-slate-700 hover:bg-blue-50 hover:border-blue-300 hover:text-blue-700 transition-all active:scale-95 shadow-sm"
|
|
||||||
>
|
{/* Drag & Drop Upload Zone */}
|
||||||
<ImageIcon className="w-3.5 h-3.5 text-slate-500" />
|
<div
|
||||||
<span>{preset.label}</span>
|
onDrop={handleDrop}
|
||||||
</button>
|
onDragOver={(e) => {
|
||||||
))}
|
e.preventDefault();
|
||||||
|
setIsDragOver(true);
|
||||||
|
}}
|
||||||
|
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-2xl p-6 sm:p-8 text-center cursor-pointer transition-all duration-300 group ${
|
||||||
|
isDragOver
|
||||||
|
? 'border-blue-500 bg-blue-50/50 scale-[1.01]'
|
||||||
|
: 'border-slate-300 hover:border-blue-500 bg-slate-50/60 hover:bg-blue-50/30'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
ref={fileInputRef}
|
||||||
|
type="file"
|
||||||
|
accept="image/jpeg,image/png,image/webp"
|
||||||
|
className="hidden"
|
||||||
|
onChange={(e) => e.target.files?.[0] && handleFileChange(e.target.files[0])}
|
||||||
|
/>
|
||||||
|
<div className="w-12 h-12 mx-auto mb-3 rounded-2xl bg-blue-50 border border-blue-100 flex items-center justify-center text-blue-600 group-hover:scale-110 transition-all duration-300 shadow-sm">
|
||||||
|
<UploadCloud className="w-6 h-6" />
|
||||||
|
</div>
|
||||||
|
<p className="text-sm sm:text-base font-display font-bold text-slate-900">
|
||||||
|
Drop your photo here, or <span className="text-blue-600 underline decoration-blue-300 underline-offset-4 group-hover:text-blue-700">browse</span>
|
||||||
|
</p>
|
||||||
|
<p className="mt-1 text-[11px] font-mono text-slate-500">
|
||||||
|
JPG, PNG, WebP up to {tool.tryIt?.limits?.maxMB || 12}MB
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Quick Sample Presets */}
|
||||||
|
<div>
|
||||||
|
<p className="text-xs font-mono uppercase tracking-wider text-slate-500 font-semibold mb-2.5">
|
||||||
|
Or test instantly with a sample photo:
|
||||||
|
</p>
|
||||||
|
<div className="flex flex-wrap gap-2">
|
||||||
|
{samplePresets.map((preset, idx) => (
|
||||||
|
<button
|
||||||
|
key={idx}
|
||||||
|
onClick={() => loadSamplePreset(preset.url)}
|
||||||
|
className="inline-flex items-center gap-1.5 px-3 py-2 rounded-xl text-xs font-semibold bg-white border border-slate-200 text-slate-700 hover:bg-blue-50 hover:border-blue-300 hover:text-blue-700 transition-all active:scale-95 shadow-2xs"
|
||||||
|
>
|
||||||
|
<ImageIcon className="w-3.5 h-3.5 text-slate-400" />
|
||||||
|
<span>{preset.label}</span>
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import type { ElementType } from 'react';
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { ArrowRight, Layers, Palette, Scissors, Smile, Sparkles } from 'lucide-react';
|
import { ArrowRight, Layers, Palette, Scissors, Smile, Sparkles } from 'lucide-react';
|
||||||
import { AppItem, CategoryItem, resolveLocalised, ToolItem } from '@/types';
|
import { AppItem, CategoryItem, resolveLocalised, ToolItem } from '@/types';
|
||||||
import { DeferredComparison } from '@/components/ui/DeferredComparison';
|
import { CardBeforeAfterSlider } from '@/components/ui/CardBeforeAfterSlider';
|
||||||
|
|
||||||
interface VerticalToolStackProps {
|
interface VerticalToolStackProps {
|
||||||
context: { tools: ToolItem[]; categories: CategoryItem[]; apps: AppItem[]; locale: string };
|
context: { tools: ToolItem[]; categories: CategoryItem[]; apps: AppItem[]; locale: string };
|
||||||
@@ -87,7 +87,7 @@ function ToolCard({ tool, app, locale }: { tool: ToolItem; app?: AppItem; locale
|
|||||||
<article className="group overflow-hidden rounded-3xl border border-slate-900/[0.08] bg-white shadow-cream-sm transition-[box-shadow,border-color,transform] duration-300 hover:-translate-y-0.5 hover:border-blue-300 hover:shadow-cream-md">
|
<article className="group overflow-hidden rounded-3xl border border-slate-900/[0.08] bg-white shadow-cream-sm transition-[box-shadow,border-color,transform] duration-300 hover:-translate-y-0.5 hover:border-blue-300 hover:shadow-cream-md">
|
||||||
<div className="relative aspect-[16/10] overflow-hidden bg-slate-100">
|
<div className="relative aspect-[16/10] overflow-hidden bg-slate-100">
|
||||||
{hasComparison ? (
|
{hasComparison ? (
|
||||||
<DeferredComparison
|
<CardBeforeAfterSlider
|
||||||
beforeUrl={example.before}
|
beforeUrl={example.before}
|
||||||
afterUrl={example.after}
|
afterUrl={example.after}
|
||||||
beforeLabel="ORIGINAL"
|
beforeLabel="ORIGINAL"
|
||||||
@@ -104,7 +104,7 @@ function ToolCard({ tool, app, locale }: { tool: ToolItem; app?: AppItem; locale
|
|||||||
className="h-full w-full object-cover transition-transform duration-500 group-hover:scale-[1.03]"
|
className="h-full w-full object-cover transition-transform duration-500 group-hover:scale-[1.03]"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<span className="pointer-events-none absolute left-3 top-3 z-10 rounded-full bg-white/94 px-2.5 py-1 text-[10px] font-semibold uppercase tracking-wide text-slate-700 shadow-sm backdrop-blur">
|
<span className="pointer-events-none absolute left-3 top-3 z-30 rounded-full bg-white/94 px-2.5 py-1 text-[10px] font-semibold uppercase tracking-wide text-slate-700 shadow-sm backdrop-blur">
|
||||||
{tool.category.replace('-', ' ')}
|
{tool.category.replace('-', ' ')}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,177 @@
|
|||||||
|
'use client';
|
||||||
|
|
||||||
|
import React, { useRef, useEffect, useCallback } from 'react';
|
||||||
|
|
||||||
|
interface CardBeforeAfterSliderProps {
|
||||||
|
beforeUrl: string;
|
||||||
|
afterUrl: string;
|
||||||
|
beforeLabel?: string;
|
||||||
|
afterLabel?: string;
|
||||||
|
aspectRatio?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CardBeforeAfterSlider({
|
||||||
|
beforeUrl,
|
||||||
|
afterUrl,
|
||||||
|
beforeLabel = 'BEFORE',
|
||||||
|
afterLabel = 'AFTER',
|
||||||
|
aspectRatio = 'aspect-[16/10]',
|
||||||
|
}: CardBeforeAfterSliderProps) {
|
||||||
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
|
const isHoveredRef = useRef(false);
|
||||||
|
const animIdRef = useRef<number>(0);
|
||||||
|
|
||||||
|
const setSplit = useCallback((percent: number) => {
|
||||||
|
const clamped = Math.max(3, Math.min(97, percent));
|
||||||
|
if (containerRef.current) {
|
||||||
|
containerRef.current.style.setProperty('--split', `${clamped}%`);
|
||||||
|
containerRef.current.setAttribute('aria-valuenow', `${Math.round(clamped)}`);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// Continuous auto-sliding animation when not actively hovered
|
||||||
|
useEffect(() => {
|
||||||
|
let startTime: number | null = null;
|
||||||
|
let isVisible = true;
|
||||||
|
|
||||||
|
const animate = (time: number) => {
|
||||||
|
if (!isVisible) return;
|
||||||
|
if (!isHoveredRef.current) {
|
||||||
|
if (startTime === null) startTime = time;
|
||||||
|
const elapsed = time - startTime;
|
||||||
|
// Smooth sine wave between 28% and 72% over a 3.4-second cycle
|
||||||
|
const currentSplit = 50 + 22 * Math.sin((elapsed / 3400) * 2 * Math.PI);
|
||||||
|
setSplit(currentSplit);
|
||||||
|
} else {
|
||||||
|
startTime = null;
|
||||||
|
}
|
||||||
|
animIdRef.current = requestAnimationFrame(animate);
|
||||||
|
};
|
||||||
|
|
||||||
|
const observer = new IntersectionObserver(
|
||||||
|
([entry]) => {
|
||||||
|
isVisible = entry.isIntersecting;
|
||||||
|
if (isVisible) {
|
||||||
|
startTime = null;
|
||||||
|
animIdRef.current = requestAnimationFrame(animate);
|
||||||
|
} else {
|
||||||
|
cancelAnimationFrame(animIdRef.current);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ threshold: 0.05 }
|
||||||
|
);
|
||||||
|
|
||||||
|
if (containerRef.current) {
|
||||||
|
observer.observe(containerRef.current);
|
||||||
|
}
|
||||||
|
|
||||||
|
animIdRef.current = requestAnimationFrame(animate);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
cancelAnimationFrame(animIdRef.current);
|
||||||
|
observer.disconnect();
|
||||||
|
};
|
||||||
|
}, [setSplit]);
|
||||||
|
|
||||||
|
// Mouse move scrubber
|
||||||
|
const handleMouseMove = useCallback(
|
||||||
|
(e: React.MouseEvent<HTMLDivElement>) => {
|
||||||
|
isHoveredRef.current = true;
|
||||||
|
if (!containerRef.current) return;
|
||||||
|
const rect = containerRef.current.getBoundingClientRect();
|
||||||
|
const x = Math.max(0, Math.min(e.clientX - rect.left, rect.width));
|
||||||
|
const percent = (x / rect.width) * 100;
|
||||||
|
setSplit(percent);
|
||||||
|
},
|
||||||
|
[setSplit]
|
||||||
|
);
|
||||||
|
|
||||||
|
// Touch move scrubber
|
||||||
|
const handleTouchMove = useCallback(
|
||||||
|
(e: React.TouchEvent<HTMLDivElement>) => {
|
||||||
|
isHoveredRef.current = true;
|
||||||
|
if (!containerRef.current || !e.touches[0]) return;
|
||||||
|
const rect = containerRef.current.getBoundingClientRect();
|
||||||
|
const x = Math.max(0, Math.min(e.touches[0].clientX - rect.left, rect.width));
|
||||||
|
const percent = (x / rect.width) * 100;
|
||||||
|
setSplit(percent);
|
||||||
|
},
|
||||||
|
[setSplit]
|
||||||
|
);
|
||||||
|
|
||||||
|
const handlePointerLeave = useCallback(() => {
|
||||||
|
isHoveredRef.current = false;
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
ref={containerRef}
|
||||||
|
onMouseEnter={() => { isHoveredRef.current = true; }}
|
||||||
|
onMouseLeave={handlePointerLeave}
|
||||||
|
onMouseMove={handleMouseMove}
|
||||||
|
onTouchStart={() => { isHoveredRef.current = true; }}
|
||||||
|
onTouchMove={handleTouchMove}
|
||||||
|
onTouchEnd={handlePointerLeave}
|
||||||
|
role="slider"
|
||||||
|
aria-label="Before and after transformation slider"
|
||||||
|
aria-valuenow={50}
|
||||||
|
tabIndex={0}
|
||||||
|
style={{ '--split': '50%' } as React.CSSProperties}
|
||||||
|
className={`relative w-full ${aspectRatio} overflow-hidden cursor-ew-resize select-none bg-slate-900 group/slider`}
|
||||||
|
>
|
||||||
|
{/* Layer 1: After Image (Transformed Neural Result) */}
|
||||||
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||||
|
<img
|
||||||
|
src={afterUrl}
|
||||||
|
alt="AI enhanced result"
|
||||||
|
loading="lazy"
|
||||||
|
decoding="async"
|
||||||
|
className="absolute inset-0 h-full w-full object-cover pointer-events-none"
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* Layer 2: Before Image (Clipped Left by CSS variable --split) */}
|
||||||
|
<div
|
||||||
|
className="absolute inset-0 overflow-hidden pointer-events-none"
|
||||||
|
style={{ clipPath: 'polygon(0 0, var(--split) 0, var(--split) 100%, 0 100%)' }}
|
||||||
|
>
|
||||||
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||||
|
<img
|
||||||
|
src={beforeUrl}
|
||||||
|
alt="Original input"
|
||||||
|
loading="lazy"
|
||||||
|
decoding="async"
|
||||||
|
className="absolute inset-0 h-full w-full object-cover"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Layer 3: Vertical Split Divider Line */}
|
||||||
|
<div
|
||||||
|
className="absolute top-0 bottom-0 w-[2.5px] bg-white z-20 pointer-events-none shadow-[0_0_10px_rgba(0,0,0,0.8)]"
|
||||||
|
style={{ left: 'var(--split)' }}
|
||||||
|
>
|
||||||
|
{/* Glowing Aura */}
|
||||||
|
<div className="absolute -top-4 -bottom-4 -left-1.5 w-3.5 bg-gradient-to-r from-blue-500/30 via-white/70 to-amber-400/30 blur-[2px]" />
|
||||||
|
|
||||||
|
{/* Center Pill Handle with Left/Right Arrows */}
|
||||||
|
<div className="absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-8 h-8 sm:w-9 sm:h-9 rounded-full bg-white text-slate-800 shadow-xl border border-slate-900/15 flex items-center justify-center transition-transform group-hover/slider:scale-110">
|
||||||
|
<svg className="w-3.5 h-3.5 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>
|
||||||
|
|
||||||
|
{/* Floating Corner Badges */}
|
||||||
|
<div className="pointer-events-none absolute bottom-2.5 left-2.5 z-20 rounded-md bg-black/70 px-2 py-0.5 text-[9px] font-mono font-bold tracking-wider text-white backdrop-blur-sm border border-white/10 shadow-sm">
|
||||||
|
{beforeLabel}
|
||||||
|
</div>
|
||||||
|
<div className="pointer-events-none absolute bottom-2.5 right-2.5 z-20 rounded-md bg-blue-600/90 px-2 py-0.5 text-[9px] font-mono font-bold tracking-wider text-white backdrop-blur-sm shadow-sm border border-white/20">
|
||||||
|
{afterLabel}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Scrub Hint */}
|
||||||
|
<div className="pointer-events-none absolute top-2.5 right-2.5 z-20 rounded-full bg-white/90 px-2 py-0.5 text-[9px] font-semibold text-slate-700 shadow-sm backdrop-blur-xs opacity-0 group-hover/slider:opacity-100 transition-opacity">
|
||||||
|
Scrub to compare
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user