I want use CSS animation for attribute "d" to SVG path. This example working in Google chrome:
body {
background-color: #022040;
}
#path {
d: path('M425,225 L475,275 L575,175 L675,275 L775,175 L875,275 L925,225');
stroke: #1EFE64;
fill: none;
animation-name: path;
animation-duration: 5s;
animation-timing-function: ease-in;
animation-fill-mode: forwards;
}
@keyframes path {
0% {
d: path('M425,225 L475,275');
}
25% {
d: path('M425,225 L475,275 L575,175 L575,175 L575,175 L575,175 L575,175');
}
50% {
d: path('M425,225 L475,275 L575,175 L675,275 L675,275 L675,275 L675,275');
}
75% {
d: path('M425,225 L475,275 L575,175 L675,275 L775,175 L775,175 L775,175');
}
90% {
d: path('M425,225 L475,275 L575,175 L675,275 L775,175 L875,275 L875,275');
}
100% {
d: path('M425,225 L475,275 L575,175 L675,275 L775,175 L875,275 L925,225');
}
}
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1000" height="400">
<path id="path" stroke-width="20"/>
</svg>
But doesn't work in Safari Pc/Mobile and FireFox.
How to fix the bug? Or should I use the tag "animate" in svg?
Help me please) Thank you!