I have an arrow pointing to the right that I want to move to the right; then, move it left to its original position. This animation should repeat endlessly. I tried doing this by following the documentation but am running into errors.
My code:
wixAnimations.timeline({repeat: -1, yoyo: false})
.add($w('#front5'), {y: 0, x: 0.02*windowWidth, scale: 1, duration: 500, easing: 'easeInCubic'})
.add($w('#front5'), {y: 0, x: `-=0.02*${windowWidth}`, scale: 1, duration: 1000, easing: 'easeOutCubic'})
.play()
I keep getting an error on the second “add” from the x-input. How do I use -= properly? Thanks!