L
L
lebedevweb2021-12-03 00:35:16
css
lebedevweb, 2021-12-03 00:35:16

How to implement svg animation with path replacement?

Hello, it's not possible to make a smooth replacement of path inside svg.

1. I wanted to implement it using @keyframes, but the animation works only in crome and only in the sandbox: https://jsfiddle.net/7wvuj4sp/
2. The second solution was to do it through animate with changing the coordinates of the figure through values. Works in crome, opera and firefox, but there is no smooth transition between coordinate displays.
https://jsfiddle.net/aw6z4mtg/17/

Tell me what I'm doing wrong and how can I fix the code?

UPD: second link fixed

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lebedevweb, 2021-12-04
@lebedevweb

Found the reason. Reworked the 2nd option:

2. The second solution was to do it through animate with changing the coordinates of the figure through values. Works in crome, opera and firefox, but there is no smooth transition between coordinate displays.
https://jsfiddle.net/aw6z4mtg/17/

The error was that the coordinates in values ​​had a different set of points (in fact, different objects were substituted), so there was no transition.
In the new version, the object contains the same set of points with changed coordinates.
https://jsfiddle.net/

A
Anton Shamanov, 2021-12-03
@SilenceOfWinter

https://svgjs.dev/docs/3.0/animating/
https://jsfiddle.net/Fuzzy/f2wbgx5a/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question