import React, { useState, useRef, useEffect } from 'react'; import { MoveHorizontal } from 'lucide-react'; import CompareNew from '../assets/images/compare-new.webp'; import CompareOld from '../assets/images/compare-old.webp'; export const ComparisonSlider = () => { const [sliderPos, setSliderPos] = useState(50); const containerRef = useRef(null); const handleMove = (e) => { if (!containerRef.current) return; const rect = containerRef.current.getBoundingClientRect(); const x = Math.max(0, Math.min(e.clientX - rect.left, rect.width)); const percentage = (x / rect.width) * 100; setSliderPos(percentage); }; const handleTouchMove = (e) => { if (!containerRef.current) return; const rect = containerRef.current.getBoundingClientRect(); const touch = e.touches[0]; const x = Math.max(0, Math.min(touch.clientX - rect.left, rect.width)); const percentage = (x / rect.width) * 100; setSliderPos(percentage); }; return (

The Old vs The LynkedUp Way

{/* AFTER IMAGE (New Way) - Background */}
The New Way
Our Way
{[ "15-Minute Drone Scan", "Zero Safety Risk", "AI + Thermal Imaging", "~30% Lower Costs", ].map((text, i) => (
{text}
))} {/* Extended items — desktop only */} {[ "60% faster lead conversion", "Deploy Reps with confidence", "Evidence-driven damage detection", ].map((text, i) => (
{text}
))}
{/* BEFORE IMAGE (Old Way) - Clipped Overlay */}
The Old Way {/* Overlay Text visible only when this side is dominant */}
The Old Way
{[ "Dangerous Ladders & Falls", "Guesswork Estimates", "Slow Turnaround Times", "Hidden Material Costs" ].map((text, i) => (
{text}
))}
{/* Slider Handle — Desktop */}
{/* Slider Handle — Mobile (visible circle + line) */}
{/* Instructions Overlay (Fades out on interaction) */}
Drag to compare
); };