Here are four different versions to supplement @misterManSam's brilliant answer.
1. With Easing
Explanation
If you filled up a circular bowl full of liquid, it would fill faster at the bottom and top than it would in the middle (because there is more area to cover in the wider middle section). So, with that crude explanation in mind, the animation needs to: start fast, slow in the middle, and then finish fast when the bowl narrows again at the top.
To do this we can use a CSS3 easing function: cubic-bezier(.2,.6,.8,.4)
.
Have a look at the example below.
(If you want to tweak the easing here is a great resource: http://cubic-bezier.com/#.2,.6,.8,.4)
Example:
#banner {
width: 150px;
height: 150px;
position: relative;
background: #000;
border-radius: 50%;
overflow: hidden;
}
#banner::before {
content: '';
position: absolute;
background: #04ACFF;
width: 100%;
bottom: 0;
animation: wipe 5s cubic-bezier(.2,.6,.8,.4) forwards;
}
@keyframes wipe {
0% {
height: 0;
}
100% {
height: 100%;
}
}
<div id="banner">
</div>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…