@props([ 'before' => null, 'after' => null, 'beforeLabel' => null, 'afterLabel' => null, 'alt' => '', ]) @php($sliderId = 'compare-'.Str::random(6)) {{-- Before / after comparison — the honest way to show what an assignment changed. The reveal is a clip-path on a full-size overlay, so no width maths is needed and it stays exact at every breakpoint. Dragging is a convenience; the range input underneath is the real control, so the comparison is fully operable from the keyboard. --}}
merge(['class' => 'relative select-none overflow-hidden rounded-2xl bg-surface-muted']) }} @pointerdown="dragging = true; move($event)" @pointermove="move($event)" @pointerup.window="dragging = false" @pointercancel.window="dragging = false"> {{-- "After" is the base layer; "before" is clipped over the top of it. --}} {{ $alt }}
@if ($beforeLabel) {{ $beforeLabel }} @endif @if ($afterLabel) {{ $afterLabel }} @endif