feat(hero): overhaul hero and interactive try-it widget with neo-studio aesthetics
This commit is contained in:
@@ -67,7 +67,8 @@ export function BeforeAfterSlider({
|
||||
ref={containerRef}
|
||||
onMouseDown={() => setIsDragging(true)}
|
||||
onTouchStart={() => setIsDragging(true)}
|
||||
className={`relative w-full ${aspectRatio} rounded-2xl sm:rounded-3xl overflow-hidden select-none cursor-ew-resize shadow-2xl border border-slate-200/80 dark:border-slate-800/80 bg-slate-950 group`}
|
||||
className={`relative w-full ${aspectRatio} rounded-2xl sm:rounded-3xl overflow-hidden select-none cursor-ew-resize shadow-2xl border border-white/[0.1] bg-[#07090E] group`}
|
||||
style={{ touchAction: 'pan-y' }}
|
||||
>
|
||||
{/* After Image (Background) */}
|
||||
{/* eslint-disable-next-line @next/next/no-img-element */}
|
||||
@@ -92,15 +93,15 @@ export function BeforeAfterSlider({
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Split Divider Line with Glow */}
|
||||
{/* Split Divider Line with Neon Cyan Glow */}
|
||||
<div
|
||||
className="absolute top-0 bottom-0 w-1 bg-white shadow-[0_0_15px_rgba(37,99,235,0.8)] z-20 pointer-events-none will-change-transform"
|
||||
className="absolute top-0 bottom-0 w-0.5 bg-gradient-to-b from-cyan-300 via-white to-cyan-300 shadow-[0_0_15px_rgba(0,240,255,0.9)] 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-9 h-9 sm:w-10 sm:h-10 rounded-full bg-white dark:bg-slate-900 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">
|
||||
<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-[#0B0F17] border-2 border-cyan-400 shadow-[0_0_20px_rgba(0,240,255,0.6)] flex items-center justify-center pointer-events-auto cursor-ew-resize hover:scale-110 active:scale-95 transition-transform duration-150">
|
||||
<svg
|
||||
className="w-4 h-4 text-blue-600 dark:text-blue-400"
|
||||
className="w-3.5 h-3.5 sm:w-4 sm:h-4 text-cyan-400"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
@@ -111,23 +112,23 @@ export function BeforeAfterSlider({
|
||||
</div>
|
||||
|
||||
{/* Floating Badges */}
|
||||
<div className="absolute top-3 left-3 sm:top-4 sm:left-4 bg-slate-950/70 backdrop-blur-md px-3 py-1.5 rounded-xl text-[11px] sm:text-xs font-bold text-white border border-white/10 pointer-events-none z-10 flex items-center space-x-1.5">
|
||||
<Eye className="w-3.5 h-3.5 text-slate-300" />
|
||||
<div className="absolute top-3 left-3 sm:top-4 sm:left-4 bg-[#05070B]/80 backdrop-blur-xl px-3 py-1.5 rounded-xl text-[11px] font-mono font-bold text-slate-300 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-400" />
|
||||
<span>{beforeLabel}</span>
|
||||
</div>
|
||||
<div className="absolute top-3 right-3 sm:top-4 sm:right-4 bg-gradient-to-r from-blue-600/90 to-cyan-500/90 backdrop-blur-md px-3 py-1.5 rounded-xl text-[11px] sm:text-xs font-bold text-white shadow-lg shadow-blue-500/25 border border-white/20 pointer-events-none z-10 flex items-center space-x-1.5">
|
||||
<Sparkles className="w-3.5 h-3.5 text-white" />
|
||||
<div className="absolute top-3 right-3 sm:top-4 sm:right-4 bg-gradient-to-r from-cyan-500/90 to-purple-600/90 backdrop-blur-xl px-3 py-1.5 rounded-xl text-[11px] font-mono font-bold text-white shadow-[0_0_20px_rgba(0,240,255,0.3)] border border-white/20 pointer-events-none z-10 flex items-center gap-1.5">
|
||||
<Sparkles className="w-3.5 h-3.5 text-cyan-200" />
|
||||
<span>{afterLabel}</span>
|
||||
</div>
|
||||
|
||||
{/* Bottom Helper Hint */}
|
||||
<div className="absolute bottom-3 left-1/2 -translate-x-1/2 bg-black/40 backdrop-blur-md px-3 py-1 rounded-full text-[10px] text-white/80 pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-200">
|
||||
Drag horizontally to compare
|
||||
<div className="absolute bottom-3 left-1/2 -translate-x-1/2 bg-black/60 backdrop-blur-md px-3 py-1 rounded-full text-[10px] font-mono text-cyan-300/80 pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-200 border border-cyan-500/20">
|
||||
Drag horizontally to inspect pore texture
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{caption && (
|
||||
<p className="mt-2.5 text-center text-xs font-medium text-slate-500 dark:text-slate-400">
|
||||
<p className="mt-2.5 text-center text-xs font-mono text-slate-400">
|
||||
{caption}
|
||||
</p>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user