【发布时间】:2019-04-20 03:01:29
【问题描述】:
我用关键帧制作的动画没有流畅的结尾,而且跳到开头的速度非常快。我不知道如何使这个过渡更顺畅。
当动画结束并跳回起点时,第一项并不完全可见。
body {
font-family: 'Poppins', sans-serif;
}
ul {
list-style: none;
}
#flip {
height: 43px;
margin-top: -20px;
overflow: hidden;
}
#flip .content {
display: flex;
flex-direction: column;
align-items: center;
}
#flip h3 {
font-weight: 400;
font-size: 0.5em;
color: white;
text-transform: uppercase;
text-align: right;
display: inline-block;
padding: 5px;
margin-bottom: 10px;
animation: flip 4s infinite;
animation-delay: 1s;
}
#flip .one {
background: #CD1517;
}
#flip .two {
background: #068587;
}
#flip .three {
background: #F2B134;
}
#flip .four {
background: #6B50BF;
}
#flip .five {
background: #4FB99F;
}
@-webkit-keyframes flip {
0% {
transform: translateY(0px);
}
20% {
transform: translateY(-43px);
}
40% {
transform: translateY(-90px);
}
60% {
transform: translateY(-135px);
}
80% {
transform: translateY(-180px);
}
100% {
transform: translateY(0px);
}
}
<ul>
<li id="flip">
<div class="content">
<h3 class="one">developer</h3>
<h3 class="two">designer</h3>
<h3 class="three">programmer</h3>
<h3 class="four">carodej</h3>
<h3 class="five">alluneed</h3>
</div>
</li>
</ul>
结束动画可以制作从头到尾平滑跳转的动画。
【问题讨论】:
标签: html css css-animations