I am new to SVG animation and I am trying to animate a "wave" background I made in Figma and exported as SVG.
Basically, as you see in the snippet, I'm trying to keep the shape of the wave, but make the contours move very subtly. Is that possible to do? If so, what approach should I use? I don't know where to start. I tried to use the SVG <animate> and messed around with the numbers, but it doesn't work and breaks the wave and does not even animate.
Would really appreciate an example or if someone can point me to the right direction so I can give it a try.
Here's my SVG original path:
<svg width="1279" height="650" viewBox="0 0 1279 650" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="
M -138 -167.889
C -138 -167.889
2002 -494.389
1020.73 -167.889
C 39.4558 158.611
1111.22 305.526
942.746 516.955
C 681.205 845.177
-138 458.649
-138 458.649
V -167.889
Z"
fill="#000000">
</path>
</svg>
Here's one where I tried to animate and failed spectacularly:
<div class="wave">
<svg width="1279" height="650" viewBox="0 0 1279 650" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="
M -138 -167.889
C -138 -167.889
2002 -494.389
1020.73 -167.889
C 39.4558 158.611
1111.22 305.526
942.746 516.955
C 681.205 845.177
-138 458.649
-138 458.649
V -167.889
Z"
fill="#EDE5FA">
<animate
repeatCount="indefinite"
fill="#454599"
attributeName="d"
dur="15s"
values="
M -138 -167.889
C -128 -167.889
2002 -494.389
1020.73 -167.889
C 139.4558 158.611
1411.22 305.526
942.746 516.955
C 881.205 845.177
-138 458.649
-138 458.649
V -167.889
Z
">
</animate>
</path>
</svg>
</div>
Thanks
<div class="wave">
<svg width="1279" height="650" viewBox="0 0 1279 650" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="
M -138 -167.889
C -138 -167.889
2002 -494.389
1020.73 -167.889
C 39.4558 158.611
1111.22 305.526
942.746 516.955
C 681.205 845.177
-138 458.649
-138 458.649
V -167.889
Z"
fill="#000000">
</path>
</svg>
</div>