鱼游了一段距离,到达一定距离后,它必须转身游回来。动画规则是什么?
CSS
@keyframes go-right-left {
from {
right: 0px;
}
to {
right: calc(40% - 50px);
}
}
@-webkit-keyframes go-right-left {
from {
right: 0px;
}
to {
right: calc(40% - 50px);
}
}
.fish-blue {
animation: go-right-left 60s ease infinite alternate;
-webkit-animation: go-right-left 60s ease infinite alternate;
position: relative;
}

有
alternate很多错误,所以最好是这样: