SVG实现可控圆环进度条 扫描效果
移动端做一个 loadiing 加载的图标,跟以往沿用的都不太一样,是一个圆环进度条,圆环进度条也就罢了,还得能用百分比控制。
具体思路是 使用svg + css3 动画实现进度条的效果,代码如下:
1 | <svg class="svg" xmlns="http://www.w3.org/200/svg" height="150" width="110"> |
css 代码1
2
3
4.progress_circle{
stroke-dasharray:1691,1691; // 进度 vs 周长
-webkit-animation:strokeDasharray 3.5s linear;
}
纯css3扫描效果~
1 | border-top: 0.208rem solid #ececec; |
结束语:也可以用js 通过 stroke-dasharray 属性 控制 进度条,效果大致如下。
![[width] [height] [title text [alt text]]](/img/scan.jpeg)