diff --git a/src/components/sections/ShiftableToolsGridSection.tsx b/src/components/sections/ShiftableToolsGridSection.tsx
index fe8f3c5..1e219c3 100644
--- a/src/components/sections/ShiftableToolsGridSection.tsx
+++ b/src/components/sections/ShiftableToolsGridSection.tsx
@@ -184,64 +184,32 @@ function ShiftableRow({ items }: { items: ToolMediaItem[] }) {
}}
className="w-full transition-[flex-grow] duration-1000 ease-[cubic-bezier(0.16,1,0.3,1)] will-change-[flex-grow] flex flex-col min-w-0"
>
- {/* Window Container with strictly locked pixel height & landscape aspect */}
- {item.mediaType === 'comparison' ? (
-
- {/* GPU-Composited Shadow Elevation Layer */}
-
+ {/* Window Container with strictly locked pixel height & landscape aspect (entire card is clickable) */}
+
+ {/* GPU-Composited Shadow Elevation Layer */}
+
- {/* Media Renderer (Interactive comparison slider with touch-action: none) */}
-
+ {/* Media Renderer */}
+
- {/* Dedicated Tool Link Pill on top right so sliding never accidentally navigates */}
-
-
TRY TOOL
-
-
-
- {/* Hover Media Type Pill */}
-
-
-
- comparison
-
-
-
- ) : (
-
- {/* GPU-Composited Shadow Elevation Layer (Opacity-only transition, zero paint thrash) */}
-
-
- {/* Media Renderer */}
-
-
- {/* Hover Media Type Pill (Smooth GPU Opacity Transition) */}
-
-
- {item.mediaType === 'video' && }
- {item.mediaType === 'photo' && }
- {item.mediaType}
-
-
-
- )}
+
+ {item.mediaType === 'video' && }
+ {item.mediaType === 'comparison' && }
+ {item.mediaType === 'photo' && }
+ {item.mediaType}
+
+
+
{/* Little Title Below Window (Fixed height, no vertical jumping) */}
{/* BEFORE Image (Base layer, fixed scale & position, 0% zoom) */}
- {/* Glowing Slider Divider Line (Direct GPU transform & position) */}
+ {/* Glowing Slider Divider Line (pointer-events-none so touching the line allows page scroll) */}
- {/* Circular Grab Handle with Before/After Arrow Cue & Touch Padding */}
-
+ {/* Circular Grab Handle with Before/After Arrow Cue & Touch Padding - Dedicated Drag Trigger with Pointer Capture */}
+
{
+ e.preventDefault();
+ e.stopPropagation();
+ }}
+ onKeyDown={handleKeyDown}
+ role="slider"
+ aria-label="Before and after comparison slider"
+ aria-valuemin={8}
+ aria-valuemax={92}
+ aria-valuenow={50}
+ tabIndex={0}
+ style={{ touchAction: 'none' }}
+ className="absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-8 h-8 rounded-full bg-white shadow-xl border border-slate-200/90 flex items-center justify-center text-xs font-bold text-blue-600 pointer-events-auto cursor-ew-resize touch-none before:absolute before:-inset-3 before:content-['']"
+ >
↔
diff --git a/src/components/sections/TrendyBentoSection.tsx b/src/components/sections/TrendyBentoSection.tsx
index 9ab9f15..ee5f6c0 100644
--- a/src/components/sections/TrendyBentoSection.tsx
+++ b/src/components/sections/TrendyBentoSection.tsx
@@ -257,9 +257,10 @@ export function TrendyBentoSection({
: 'col-span-1 aspect-square rounded-[36px] sm:rounded-[42px]';
return (
-
{/* GPU-composited shadow elevation layer */}
toggleTileSize(tile.id, e)}
title={tile.isWide ? 'Shrink tile' : 'Expand tile'}
- className="w-9 h-9 rounded-2xl bg-white/90 hover:bg-white text-slate-800 shadow-md flex items-center justify-center transition-[transform,background-color] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] hover:scale-110 active:scale-95"
+ className="w-9 h-9 rounded-2xl bg-white/90 hover:bg-white text-slate-800 shadow-md flex items-center justify-center transition-[transform,background-color] duration-200 ease-[cubic-bezier(0.16,1,0.3,1)] hover:scale-110 active:scale-95 z-30"
>
{tile.isWide ? (
@@ -312,15 +314,14 @@ export function TrendyBentoSection({
{tile.description}
-
{tile.cta}
-
+
-
+
);
})}
diff --git a/src/components/ui/CardBeforeAfterSlider.tsx b/src/components/ui/CardBeforeAfterSlider.tsx
index 5130124..d3ab408 100644
--- a/src/components/ui/CardBeforeAfterSlider.tsx
+++ b/src/components/ui/CardBeforeAfterSlider.tsx
@@ -73,10 +73,11 @@ export function CardBeforeAfterSlider({
}
}, [setSplit]);
- // Unified Pointer Handlers (Flawless on iOS/Android touchscreens and desktop mouse)
+ // Unified Pointer Handlers on Center Pill Handle with Left/Right Arrows
const handlePointerDown = useCallback(
(e: React.PointerEvent) => {
if (e.button !== 0 && e.pointerType === 'mouse') return;
+ e.stopPropagation();
isDraggingRef.current = true;
isInteractedRef.current = true;
@@ -88,13 +89,13 @@ export function CardBeforeAfterSlider({
// Fallback
}
- // Cache rect on pointer down to eliminate layout thrashing
- const rect = e.currentTarget.getBoundingClientRect();
- cachedRectRef.current = { left: rect.left, width: rect.width };
-
- const x = Math.max(0, Math.min(e.clientX - rect.left, rect.width));
- const percent = (x / rect.width) * 100;
- setSplit(percent);
+ if (containerRef.current) {
+ const rect = containerRef.current.getBoundingClientRect();
+ cachedRectRef.current = { left: rect.left, width: rect.width };
+ const x = Math.max(0, Math.min(e.clientX - rect.left, rect.width));
+ const percent = (x / rect.width) * 100;
+ setSplit(percent);
+ }
},
[setSplit]
);
@@ -102,6 +103,7 @@ export function CardBeforeAfterSlider({
const handlePointerMove = useCallback(
(e: React.PointerEvent) => {
if (!isDraggingRef.current) return;
+ e.stopPropagation();
const clientX = e.clientX;
if (rafIdRef.current) {
@@ -127,6 +129,7 @@ export function CardBeforeAfterSlider({
const handlePointerUp = useCallback((e: React.PointerEvent) => {
if (!isDraggingRef.current) return;
+ e.stopPropagation();
isDraggingRef.current = false;
cachedRectRef.current = null;
@@ -147,19 +150,11 @@ export function CardBeforeAfterSlider({
ref={containerRef}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
- onPointerDown={handlePointerDown}
- onPointerMove={handlePointerMove}
- onPointerUp={handlePointerUp}
- onPointerCancel={handlePointerUp}
- role="slider"
- aria-label="Before and after transformation slider"
- aria-valuenow={50}
- tabIndex={0}
style={{
'--split': '50%',
- touchAction: 'none', // Strictly prevents mobile touch scrolling interference
+ touchAction: 'pan-y', // Allows mobile vertical scrolling across the card and line
} as React.CSSProperties}
- className={`relative w-full ${aspectRatio} overflow-hidden cursor-ew-resize select-none bg-slate-900 group/slider transition-shadow duration-300 hover:shadow-cream-lg touch-none`}
+ className={`relative w-full ${aspectRatio} overflow-hidden select-none bg-slate-900 group/slider transition-shadow duration-300 hover:shadow-cream-lg`}
>
{/* Layer 1: After Image (Transformed Neural Result) */}
{/* eslint-disable-next-line @next/next/no-img-element */}
@@ -186,7 +181,7 @@ export function CardBeforeAfterSlider({
/>
- {/* Layer 3: Vertical Split Divider Line */}
+ {/* Layer 3: Vertical Split Divider Line (pointer-events-none so it doesn't block scrolling) */}
- {/* Center Pill Handle with Left/Right Arrows & Touch Pad */}
-
-