代码
html代码
<span class="ani-num" style="--num: 1000"></span>
css代码
@property --seed{
syntax:"<integer>";
inherits:true;
initial-value:0;
}
@keyframes seed {
from {--seed:0;}
to {--seed:100;}
}
.ani-num::before{
counter-reset: num calc(var(--seed) * var(--num) / 100);
content:counter(num);
animation: seed .5s forwards;
}
教程视频
https://www.bilibili.com/video/BV1sZc6eJE5M