https://codepen.io/popmotion/pen/Kyewbv
This is not working for some reason.
https://popmotion.io/pure/ as mentioned here it has to be
const slider = document.querySelector('.slider');
const sliderX = value(0, styler(slider).set('x'))
listen(slider, 'mousedown touchstart').start(() => {
pointer({ x: sliderX.get() })
.pipe(({ x }) => x, clampMovement)
.start(sliderX);
});
listen(document, 'mouseup touchend').start(() => {
decay({
from: sliderX.get(),
velocity: sliderX.getVelocity()
}).pipe(clampMovement)
.start(sliderX);
});
whenever I use it clamp movement is showing as undefined. What should it be actually? Any may to make that working?