Closed alvarotrigo closed 2 years ago
Hi!
I assume this library can't be used to animate paths
It can, but unfortunately it only works in Chrome for now. Hopefully other browsers will catch up with their implementation of SVG2 soon!
In the meantime, an alternative to this is to animate the CSS clip-path
property instead of an SVG shape. For simple examples like the one you just linked to, that's a perfectly acceptable way to do it. You can check out the following example to get an idea.
Does Anime.JS really take in the "d" attribute pathing? I've not been successful with it. And am trying to avoid GreenSock since it's been pricey.
Does Anime.JS really take in the "d" attribute pathing? I've not been successful with it. And am trying to avoid GreenSock since it's been pricey.
Sure!
See this:
var tl = anime.timeline({
targets: '#path',
duration: 500,
direction: 'normal',
duration: 500,
easing: 'easeInOutQuad',
});
tl.add({
d: getPath('M2.6 2.8 L 96.3 4.8 L 98.5 98.4 L 0 100 Z'),
});
tl.add({
d: getPath('M6.3 7.1 L 96.3 4.8 L 93.7 94.3 L 8.5 92.2 Z'),
}, '-=200');
Thank you! That worked perfectly.
Is this working with arc path?
I assume this library can't be used to animate paths like the following?
Unlike TweenLite or Anime.js? https://jsfiddle.net/alvarotrigo/6yev2wc0/18/