gpt4 book ai didi

CSS:只有一个动画的动画延迟

转载 作者:行者123 更新时间:2023-12-02 17:04:50 25 4
gpt4 key购买 nike

我目前有 3 个动画,我这样调用它们:

animation: 225ms radius-in forwards, 
75ms opacity-in forwards,
150ms opacity-out;

有没有办法使用纯 css 来延迟“不透明”动画,直到半径内动画完成?

提前致谢!

最佳答案

我在下面的最终动画中添加了 4 秒的延迟。出于可见性目的,我将每个动画的持续时间设置为 2 秒。

div {
width: 200px;
height: 200px;
opacity: 0.3;
background-color: darkgray;
animation:2000ms radius-in forwards, 2000ms opacity-in forwards, 2000ms 4000ms opacity-out forwards;
}

@keyframes radius-in {
from { border-radius: 0; }
to { border-radius: 25px; }
}

@keyframes opacity-in {
from { opacity: 0; }
to { opacity: 1; }
}

@keyframes opacity-out {
from { opacity: 1; }
to { opacity: 0.3; }
}
<div></div>

关于CSS:只有一个动画的动画延迟,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52208428/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com