gpt4 book ai didi

animation - 什么是纯 SVG,什么是 SMIL?

转载 作者:行者123 更新时间:2023-12-02 11:29:01 24 4
gpt4 key购买 nike

上下文:我正在使用 SVG 制作信息图。我希望借助动画,尤其是通过链接动画,让文档变得栩栩如生。我已经熟悉 SVG,但最近才开始学习 SVG 动画。

由于 SMIL 已被弃用,我正在尝试用纯 SVG 制作动画。

Looking at this article (esp. the Handy Dandy Replacement Reference Chart at the end) ,我觉得我需要停止使用这样的属性:

fill="freeze"
repeatCount="indefinite"
begin="hover"
begin="circ-anim.begin + 1s"

…因为它们是 SVG SMIL 的一部分。

但是,如果我查看 SVG reference on Mozilla ,我看到<animate><animateTransform>在列表中,没有关于它们是 SMIL 的警告,或者需要停止使用它们。

而且,似乎Chrome normally warns against the use of SMIL animations in the console但使用 <animate> 时我看不到这样的警告或<animateTransform> (无论是在 SVG 文档中,还是在包含内联或对象 SVG 的 HTML 文档中。)

长话短说,我不清楚什么是 SMIL,什么是纯 SVG。任何人都可以对这个主题进行一些说明吗? 我可以使用 <animate><animateTransform>

最佳答案

SMIL 是 no longer deprecated by Chrome .

We value all of your feedback, and it's clear that there are use cases serviced by SMIL that just don’t have high-fidelity replacements yet. As a result, we’ve decided to suspend our intent to deprecate and take smaller steps toward other options.

基本上,SVG 中的 SMIL 就是 Animation chapter of the specification 中的所有内容。 。

这就是<animate>元素,<set>元素,<animateMotion>元素和 <animateTransform>元素。 (SVG 规范还包含不应使用的 <animateColor> 元素,您可以将其替换为 animate)。

关于animation - 什么是纯 SVG,什么是 SMIL?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40995387/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com