0

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?

  • 2
    [This codepen](https://codepen.io/popmotion/pen/ooybYP?editors=0010) (taken from their website) works, maybe the one you're seeing is not up-to-date with the latest version of the library. And no, it doesn't need jQuery. Check the [Installation instructions](https://popmotion.io/learn/install/) to learn how to use it. – cabrerahector May 30 '19 at 13:55
  • @cabrerahector thanks for the confirmation. Maybe some wordpress stuff is interfering –  May 30 '19 at 15:01

0 Answers0