tags
<animateTransform
attributeName="transform"
attributeType="XML"
type="rotate"
from="0 60 70"
to="360 60 70"
dur="10s"
repeatCount="indefinite" />
attribute
效果
- 简单投影
<svg height="120" width="120">
<defs>
<filter id="f1" x="0" y="0" width="200%" height="200%">
<feOffset result="offOut" in="SourceGraphic" dx="20" dy="20"></feOffset>
<feBlend in="SourceGraphic" in2="offOut" mode="normal"></feBlend>
</filter>
</defs>
<rect width="90" height="90" stroke="green" stroke-width="3" fill="yellow" filter="url(#f1)"></rect>
</svg>
- 颜色变换(高斯模糊)
feGaussianBlur/feColorMatrix/feOffset/feBlend
- svg实现线性渐变
x1:x2:y1:y2:
0%的color100%的color
0%的color100%的color
<svg height="150" width="400">
<defs>
<linearGradient id="grad1" x1={x1 + '%'} y1={y1 + '%'} x2={x2 + '%'} y2={y2 + '%'}>
<stop offset="0%" style={{ stopColor: "rgb(255,255,0)", stopOpacity: 1 }}></stop>
<stop offset="100%" style={{ stopColor: "rgb(255,0,0)", stopOpacity: 1 }}></stop>
</linearGradient>
</defs>
<ellipse cx="200" cy="70" rx="85" ry="55" fill="url(#grad1)"></ellipse>
</svg>