我试图从左到右动画一个箭头.我的箭头路径的代码如下:
<svg id="svg_circle" width="100%" height="100%" viewBox = '0 0 450 400'>
<g transform = "translate(0,0)">
<path class="path" stroke="#F0F0F0" fill="#fff" stroke-width="1" opacity="1" d="m34.97813,21.70979l-33.55223,0.47088l-0.0394,-13.57138l34.2665,-0.47295l-0.0208,-7.14282l14.50618,14.42226l-14.95643,15.04345l-0.20382,-8.74944z" id="svg_1">
<animate id="project_anim1" attributeName="fill" from="#fff" to="#4DAF4C" begin="1s" dur="1s" fill="freeze" repeatCount="1"></animate>
</path>
</g>
</svg>Run Code Online (Sandbox Code Playgroud)
以上是我箭头的svg路径内容.
请有人帮我如何从左到右填充路径.等待快速反应
我在 svg 中有一条曲线,需要在悬停时沿着其路径填充曲线有人可以帮忙吗?填充动画应该是另一种颜色或可以是相同的。我尝试使用 animate 标签,但它无效并且像任何东西一样填充。下面给出了我的 SVG 路径。这是我的 Svg 代码,需要将此路径填充为 dashoffset。
<svg width="210mm" height="45mm" viewBox="0 0 744.09449 159.44881">
<path style="opacity:1;fill:#ded9d5;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-opacity:1"
d="m 18.929688,529.44141 c 1.140051,2.17164 1.739409,4.60197 1.74414,7.07226 -0.0033,2.41521 -0.575072,4.79339 -1.666016,6.92969 l 36.876954,0 c 17.101683,0 11.124297,14.78094 13.525192,34.92207 7.304679,27.32129 35.935342,38.13518 62.612922,41.73111 -1.5457,-2.42739 -4.33484,-7.94712 -4.33733,-10.8524 0.005,-3.11453 0.90166,-5.74434 2.66254,-8.27277 -23.30774,-1.1068 -29.8766,-7.34118 -39.33413,-22.29658 -4.829034,-11.35821 5.68082,-49.23338 -28.703413,-49.23338 z" transform="translate(0.5714286,1.42857)" id="path4471" />
</svg>Run Code Online (Sandbox Code Playgroud)
我试图画一个 svg 圆圈。因为我需要使用 stroke-dashoffest 为其设置动画,所以圆圈的笔触仅按逆时针方向填充。有什么办法可以顺时针方向移动动画。
My Code:
<svg width="130" height="130" xmlns="http://www.w3.org/2000/svg">
<!-- Created with Method Draw - http://github.com/duopixel/Method-Draw/ -->
<g>
<title>Layer 1</title>
<g>
<path stroke="blue" id="svg_1" d="m66.75,11.75a54,52 0 1 0 0.00001,0l-0.00001,0z" opacity="0.5" stroke-width="5" stroke-dashoffset="2000" stroke-dasharray="2000" fill="red">
<animate id="project_study_anim1" attributeName="stroke-dashoffset" from="2000" to="0" begin="1s" dur="5s" fill="freeze" repeatCount="1"></animate>
</path>
</g>
</g>
</svg>
Run Code Online (Sandbox Code Playgroud)