css - 纯CSS绘制动画圆弧

标签 css animation css-shapes

我知道可以在 SVG 和 Canvas 中绘制圆弧并为其设置动画。但是,在 CSS 中可能吗?

我使用以下方法创建了一个圆弧:

.arc{
    width:150px;
    height:400px;
    border-radius:50%;
    border-right:1px solid black;
    border-left:1px solid black;
    border-top:1px solid black;
    border-bottom:1px solid white;
}

但是,我该如何制作动画呢?我能想到的唯一方法是在它上面放一个纯白色的 div,然后将该 div 向右滑动,逐渐露出弧线。有没有更好的办法?

最佳答案

你可能想看看这篇文章,Chris Coyier 做了一篇关于饼图动画的文章,如果你去掉浅蓝色背景,它与你的演示基本相同。 enter image description here

文章:http://css-tricks.com/css-pie-timer/

演示:http://codepen.io/HugoGiraudel/pen/BHEwo

关于css - 纯CSS绘制动画圆弧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18835477/

相关文章:

javascript - 如何创建带背景的三 Angular 形(固定高度,宽度=100%)

css - 如何在 html 元素上实现水平和垂直渐变

jquery - 更改加载的 iframe 的样式

android - 如何动画 ListView 展开和折叠

Android RecyclerView 将项目移动到 View 的末尾

ios - 无法为UIWindow的 subview UIView设置动画

html - 带有条纹背景和顶部三 Angular 形切口的形状

html - Chrome 80 css 网格大后代导致网格增长

css - 这两种修复折叠父级和 float 子级的方法是相同的,但是为什么呢?

html - 如何使用 border-radius 在 CSS3 中创建三 Angular 形