【发布时间】:2015-11-10 16:58:02
【问题描述】:
我正在尝试制作 SVG 手写动画。我已经研究了一些教程,但它们都使用 SVG 笔画属性,这对我来说不太适用,因为在我的情况下,动画应该在 fill,而不是 stroke。
我发现了类似的东西:
svg path {
fill: none;
stroke: #000;
stroke-width: 1;
stroke-linecap: round;
stroke-linejoin: round;
stroke-dasharray: 1700;
stroke-dashoffset: 1700;
-webkit-animation: dash 5s linear forwards;
animation: dash 5s linear forwards;
}
@-webkit-keyframes dash {
to {
stroke-dashoffset: 0;
}
}
@keyframes dash {
to {
stroke-dashoffset: 0;
}
}
这是我正在处理的 SVG:http://codepen.io/boyporreta/pen/BNewgG
有没有办法使用fill 而不是stroke 创建这个动画?
提前致谢。
【问题讨论】:
-
关于描边的事情是它为每个形状定义了一个起点(以允许虚线轮廓)。填充没有。