loading code fetching the highlighted snippet
drag() makes the knob draggable on x and keeps it inside its track. Reset animates the knob home with animate(); both work on the same x value, so the next drag starts from wherever the knob is.
axis: 'x' locks the knob to one axis and sets touch-action: pan-y, so a vertical swipe on a phone still scrolls the
page.constraints: track keeps the knob inside the track element. Release it with
some speed and it glides, then settles against the edge.drag() and animate() share the knob's x, so
Reset springs it home and the next drag continues from where it is.