【发布时间】:2020-01-02 15:46:57
【问题描述】:
我有一个圆形徽标,我正在尝试像下面的示例那样对其进行动画处理:https://codepen.io/sergiopedercini/pen/aWawra
.circular-chart {
display: block;
margin: 10px auto;
max-width: 80%;
max-height: 250px;
}
.circle {
stroke: #4CC790;
fill: none;
stroke-width: 2.8;
stroke-linecap: round;
animation: progress 1s ease-out forwards;
}
@keyframes progress {
0% {
stroke-dasharray: 0 100;
}
}
<svg viewBox="0 0 36 36" class="circular-chart">
<path class="circle"
stroke-dasharray="60, 100"
d="M18 2.0845
a 15.9155 15.9155 0 0 1 0 31.831
a 15.9155 15.9155 0 0 1 0 -31.831"
/>
</svg>
我该怎么做?
这是我的 SVG 图像:
【问题讨论】:
-
Codepen 和您的代码 - 当转换为可运行的片段时 - 似乎以相同的方式制作动画。你的代码应该做什么?它没有做什么?