【发布时间】:2020-02-27 11:27:10
【问题描述】:
场景:
我有一个动画,当我的背景视频变得非常亮时,我的文字会变黑。
问题:
在背景视频切换回开头后,文本保持黑色。如何重新设置?
目标:
我希望我的 keyframe 动画在几秒钟后重新启动。
问题:
有解决办法吗?
我的代码: HTML:
<div class="header-text">
<h1 class="head-text">Rico Dijkstra</h1>
<h2 class="head-desc">Front-end</h2>
</div>
CSS:
.header-text {
display: flex;
flex-direction: column;
float: right;
text-align: right;
align-content: center;
justify-content: center;
}
.head-text {
font-family: 'Lato', ;
color: white;
float: right;
font-size: 4rem;
animation-name: color-swap;
animation-duration: 3s;
animation-delay: 4.5s;
animation-fill-mode: forwards;
}
.head-desc {
font-family: 'Lato', ;
color: white;
float: right;
font-size: 3rem;
animation-name: color-swap;
animation-duration: 3s;
animation-delay: 4.5s;
animation-fill-mode: forwards;
margin-top: 0;
}
@keyframes color-swap {
from {color: white;}
to {color: black}
}
【问题讨论】:
标签: css-animations reset keyframe seconds