【发布时间】:2018-08-16 09:45:51
【问题描述】:
我想知道if this pen is possible 是由内联 SVG 动画 (SMIL) 创建的,无需 CSS 或任何 javascript。特别感兴趣的是使发光圆圈的模糊和起伏,以及非常自然地淡入和淡出不透明的随机浮动能量粒子。请帮忙!
继续缩减到下面,但它不那么复杂:(
<g id="particle1">
<animateTransform
attributeName="transform"
type="translate"
values="0 0; -10 0; 0 0; 10 0"
dur="3s"
repeatCount="indefinite"/>
<g>
<circle cx="100" cy="200" r="2.5" fill="#899dff">
<animateTransform
attributeName="transform"
type="translate"
from="0 0"
to="0 -200"
dur="3s"
repeatCount="indefinite"/>
<animate attributeName="opacity"
from="1" to="0" dur="3s"
repeatCount="indefinite"/>
</circle>
</g>
</g>
<g id="particle2">
<animateTransform
attributeName="transform"
type="translate"
values="0 0; 15 0; 0 0; -20 0"
dur="3s"
repeatCount="indefinite"/>
<g>
<circle cx="100" cy="200" r="2.5" fill="#899dff">
<animateTransform
attributeName="transform"
type="translate"
from="25 30"
to="25 -200"
dur="3s"
repeatCount="indefinite"/>
<animate attributeName="opacity"
from="0" to="1" dur="3s"
repeatCount="indefinite"
begin="2s"/>
</circle>
</g>
</g>
【问题讨论】:
-
笔使用 SCSS,而不是 CSS。然后它使用函数
random()。没有可以从声明性 SVG 代码访问的随机数生成器。其他一切皆有可能。提示:您必须为 blur filters 制作动画