【发布时间】:2018-08-31 21:08:26
【问题描述】:
我一直在为这个 SVG 问题而烦恼,我确定这是一个属性或我缺少的东西,但无法弄清楚
我基本上想构建一个自定义加载器,它有一个从 svg 左侧开始并向右移动的圆圈,在中间缩放,所以它开始时可能很小,可能是 0.5 比例,然后在中间增加到可能 3 比例在另一侧缩小到 0.5,然后重复此操作,左右移动
到目前为止,我可以让圆圈从左向右移动,我也可以对其进行缩放,但是当我尝试将两个动画结合起来时,它会到处乱转。
https://jsfiddle.net/0odvwna4/18/
<svg width="800px" height="100px">
<circle
cx="0"
cy="50"
r="15"
fill="blue"
stroke="black"
stroke-width="1"
transform="scale(0.0801245 0.0801245)">
<animateTransform
attributeName="transform"
type="scale"
begin="0s"
calcMode="spline"
keySplines="0.3 0 0.7 1;0.3 0 0.7 1"
values="0;1;0"
keyTimes="0;0.5;1"
dur="5s"
repeatCount="indefinite"></animateTransform>
<animate
attributeName="cx"
from="0"
to="800"
dur="5s"
repeatCount="indefinite"
/>
</circle>
</svg>
【问题讨论】:
标签: html css svg svg-animate