We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function keyframes( steps: AnimationStyleMetadata[] ): AnimationKeyframesSequenceMetadata;
它的参数是一个style()的数组,表示步骤。
style()
animate("5s", keyframes([ style({ backgroundColor: "red", offset: 0 }), // 0% style({ backgroundColor: "blue", offset: 0.2 }), // 20% style({ backgroundColor: "orange", offset: 0.3 }), // 30% style({ backgroundColor: "black", offset: 1 }) // 100% ]))
这里的 offset 和css3 keyframes里面的百分比一样,是时间的偏移量。 offset: 0.2表示动画在 20%的时候的样式。
此外,如果没有设置偏移量,那么偏移量将自动计算
animate("5s", keyframes([ style({ backgroundColor: "red" }) // offset = 0 style({ backgroundColor: "blue" }) // offset = 0.33 style({ backgroundColor: "orange" }) // offset = 0.66 style({ backgroundColor: "black" }) // offset = 1 ]))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
keyframes:关键帧
它的参数是一个
style()
的数组,表示步骤。这里的 offset 和css3 keyframes里面的百分比一样,是时间的偏移量。
offset: 0.2表示动画在 20%的时候的样式。
此外,如果没有设置偏移量,那么偏移量将自动计算
The text was updated successfully, but these errors were encountered: