Я внес корректировку в свой CSS, чтобы исправить это.Хотя, вероятно, есть лучший способ сделать это.
svg#figure {
height: 40px;
width: 40px;
position: absolute;
top: 100px;
left: 0px;
z-index: 2;
fill: red;
stroke: black;
/* animation*/
animation-name: testfigure;
animation-duration: 15s;
animation-iteration-count: 1;
animation-direction:normal;
}
svg#monster {
fill: red;
fill-opacity: 0.5;
height: 40px;
width: 80px;
position: absolute;
top: 100px;
left: -100px;
z-index: 3;
/*animation*/
animation-name: testmonster;
animation-duration: 15s;
animation-iteration-count: 1;
animation-direction: normal;
animation-delay: 1s;
}
@keyframes testmonster {
0% {margin-left:120px}
15% {margin-top: -70px;}
30% {margin-left: 190px;}
35% {margin-top: 60px;}
45% {margin-left: 100px;margin-top:130px;}
50% {margin-left: 250px;}
70% {margin-top: -50px;}
80% {margin-left: 310px;}
100% {margin-top: 250px;margin-left: 0px;}
}
@keyframes testfigure {
0% {margin-left:38px}
15% {margin-top: -80px;}
30% {margin-left: 100px;}
35% {margin-top: 65px;}
45% {margin-left: 15px;margin-top: 130px;}
50% {margin-left: 165px;}
70% {margin-top: -50px;}
80% {margin-left: 230px;}
100% {margin-top: 250px;margin-left: 0px;}
}