我的CSS:
.App-logo {
animation: rotating infinite 10s linear;
height: 40vmin;
}
.App-logo:hover {
animation-timing-function: ease-out;
animation-iteration-count: 100;
animation-delay: 2s;
}
@keyframes rotating {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
不幸的是,您无法保存关键帧状态,仅使用CSS在它们之间进行转换。如果您想在它们之间进行转换,则需要使用Javascript之类的东西来跟踪状态并在任何时间点操作数据。