- {/* 3D Kinetic Tilt Stage */}
+ {/* 3D Kinetic Tilt Stage with Locked Touch-Action for Flawless Mobile Swiping */}
setIsDragging(true)}
- onTouchStart={() => setIsDragging(true)}
+ onPointerDown={handlePointerDown}
+ onPointerMove={handlePointerMove}
+ onPointerUp={handlePointerUp}
+ onPointerCancel={handlePointerUp}
onKeyDown={handleKeyDown}
role="slider"
aria-label="Before and after comparison"
@@ -139,8 +177,11 @@ export function Cinematic3DComparison({
aria-valuemax={100}
aria-valuenow={50}
tabIndex={0}
- className={`relative w-full ${aspectRatio} rounded-2xl sm:rounded-3xl overflow-hidden cursor-ew-resize preserve-3d transition-transform duration-150 ease-out shadow-cinematic-3d hover:shadow-cinematic-hover border border-slate-900/[0.08] bg-slate-950`}
- style={{ '--split': '50%', touchAction: 'pan-y' } as React.CSSProperties}
+ className={`relative w-full ${aspectRatio} rounded-2xl sm:rounded-3xl overflow-hidden cursor-ew-resize preserve-3d transition-transform duration-150 ease-out shadow-cinematic-3d hover:shadow-cinematic-hover border border-slate-900/[0.08] bg-slate-950 touch-none`}
+ style={{
+ '--split': '50%',
+ touchAction: 'none', // Strictly prevents iOS/Android touch scrolling conflict on the slider
+ } as React.CSSProperties}
>
{/* Layer 1: After Image (Full Reconstructed Neural Result) */}
{/* eslint-disable-next-line @next/next/no-img-element */}
@@ -167,17 +208,17 @@ export function Cinematic3DComparison({
/>
- {/* Layer 3: Illuminated Holographic Laser Split Line (Champagne Gold + Electric Sapphire) */}
+ {/* Layer 3: Illuminated Holographic Laser Split Line */}
- {/* Subtle Vertical Caustic Glow Beam */}
+ {/* Vertical Caustic Glow Beam */}
- {/* 3D Tactile Center Control Handle floating at translateZ */}
+ {/* 3D Tactile Center Control Handle with generous touch-target area */}
{/* Outer Metallic Ring */}
@@ -195,7 +236,7 @@ export function Cinematic3DComparison({
- {/* Layer 4: Floating 3D Telemetry Badges (Floating at translateZ(32px)) */}
+ {/* Layer 4: Floating 3D Telemetry Badges */}
{afterLabel}
- {/* Lower Spatial Telemetry Chips (Enigma Archive Aesthetic) */}
+ {/* Lower Spatial Telemetry Chips */}
{
+ it('Cinematic3DComparison renders with touch-none, role="slider", and touchAction: none', () => {
+ const html = renderToString(
+
+ );
+
+ expect(html).toContain('role="slider"');
+ expect(html).toContain('aria-label="Before and after comparison"');
+ expect(html).toContain('touch-none');
+ expect(html).toContain('touch-action:none');
+ });
+
+ it('CardBeforeAfterSlider renders with touch-none, role="slider", and touchAction: none', () => {
+ const html = renderToString(
+
+ );
+
+ expect(html).toContain('role="slider"');
+ expect(html).toContain('aria-label="Before and after transformation slider"');
+ expect(html).toContain('touch-none');
+ expect(html).toContain('touch-action:none');
+ expect(html).toContain('--split:50%');
+ });
+
+ it('ShiftableToolsGridSection renders comparison sliders as standalone interactive cards with touch-action: none', () => {
+ const html = renderToString(
+
+ );
+
+ expect(html).toContain('role="slider"');
+ expect(html).toContain('aria-label="Before and after comparison slider"');
+ expect(html).toContain('touch-none');
+ expect(html).toContain('touch-action:none');
+ expect(html).toContain('TRY TOOL');
+ });
+});