我有一箇中心點在(100,100)的svg圖形。SVG - 從中心重複(脈動)的比例路徑
<g id="centre">
<circle cx="100" cy="100" r="2"/>
</g>
的路徑(如圓)應環繞它和脈動 - 我的意思是,它應該自身規模從0到的點(100,100)的值,集中。 雖然這樣做,脈衝也應該從不透明度= 0開始,到不透明度= 0.5並回到不透明度= 0。 (我不想用的,而不是路徑。)
整個事情是這樣的:
<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>
它不工作,我想,脈衝從中間開始,但向下移動到右側,同時放大。 有沒有人知道如何做到這一點? 在此先感謝。 (我擡頭其他幾個職位,但它並沒有幫助我)
看起來很棒,謝謝! – Dunkelbunt27