-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Description
Describe the bug
Looping animations cannot use relative tween type values.
Provide a minimal reproduction demo of the bug
import { animate } from "https://esm.sh/animejs";
animate('.square', {
rotate: '+=10',
loop: true,
onLoop: self => self.refresh()
});
When using the JS above on https://codepen.io/juliangarnier/pen/pvoGoxR, the square rotate 10 degrees then stops.
Describe the expected behavior
The square should rotate infinitely by increment of 10 degrees.
Using the following code result in the expected behavior:
import { animate, utils } from "https://esm.sh/animejs";
animate('.square', {
rotate: target => utils.get(target, 'rotate', false) + 10,
loop: true,
onLoop: self => self.refresh()
});