Reputation:
Not sure if the popmotion still exits or maintained.
Whether it is working for anyone? In their website, it seems to work but not in codepen?
https://codepen.io/popmotion/pen/Kyewbv?editors=0010
const { styler, decay, listen, pointer, value } = window.popmotion;
const slider = document.querySelector('.carousel');
const divStyler = styler(slider);
const sliderX = value(0, divStyler.set('x'));
listen(slider, 'mousedown touchstart')
.start(() => {
pointer({ x: sliderX.get() })
.pipe(({ x }) => x)
.start(sliderX);
});
listen(document, 'mouseup touchend')
.start(() => {
decay({
from: sliderX.get(),
velocity: sliderX.getVelocity(),
// power: 0.8,
timeConstant: 700,
// restDelta: 0.5,
// modifyTarget: v => v
}).start(sliderX);
});
working here: https://popmotion.io/pure/
Does it require a jquery?
Upvotes: 0
Views: 65