我有一张SVG图形,其中心点坐标为(100, 100)。
<g id="centre">
<circle cx="100" cy="100" r="2"/>
</g>
一个路径(如圆)应该将其包围并跳动 - 我的意思是,它应该从0缩放到一个值,集中在点(100,100)。
在执行此操作时,脉冲还应从不透明度=0开始,到不透明度=0.5,然后回到不透明度=0。
(我不想使用<canvas>
代替路径。)
整个过程看起来像这样:
<g transform="translate(100,100)">
<g id="pulse" >
<radialGradient id="SVGID_4_" cx="100" cy="100" r="21.2498" gradientUnits="userSpaceOnUse">
<stop offset="0" style="stop-color:#FFFFFF;stop-opacity:0"/>
<stop offset="1" style="stop-color:#006837" />
</radialGradient>
<path opacity="0.5" fill="url(#SVGID_4_)" stroke="url(#SVGID_4_)" stroke-width="0.5" stroke-miterlimit="10" d="M120.864,99.676
c0,11.599-9.401,21-21,21c-11.598,0-21-9.401-21-21c0-11.598,9.402-21,21-21c6.705,0,12.679,3.144,16.523,8.037
C119.193,90.281,120.864,94.783,120.864,99.676z" />
<animateTransform
attributeType="xml"
attributeName="transform"
type="scale"
from="0"
by="3"
dur="2s"
fill="freeze"
repeatCount="indefinite"
/>
<animate
attributeType="xml"
attributeName="fill-opacity"
from="0"
to="0"
values="0;0.5;0"
dur="2s"
repeatCount="indefinite"
fill="freeze" />
</g>
</g>
<g id="centre">
<circle cx="100" cy="100" r="2"/>
</g>
</svg>
我的要求并没有得到满足,脉冲从中间开始,但向右下方移动,同时放大。有人知道正确的操作方法吗?谢谢。 (我查了几篇其他帖子,但没有帮助到我)