Pass begin, update, and complete
to animate(). The update callback receives
{ target, progress, time }.
A Function. For update, the first argument is an object: { target, progress, time }.
noop
.circle {
width: 50px;
height: 50px;
background-color: var(--highlight-color);
border-radius: 50%;
}
.value {
font-size: 20px;
font-weight: bold;
color: #fff;
margin-bottom: 20px;
font-family: monospace;
}
.demo-content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
}
begin/update/complete 回调拿到动画进度与时间,适合做进度条、数字跟随、状态同步等“联动”效果。