问题描述
所以我最近遇到了这个警告
So I've recently encountered this warning
SVG's SMIL animations (<animate>, <set>, etc.) are deprecated and will be removed. Please use CSS animations or Web animations instead.
进行了尽可能多的研究,我一直在寻找用Web动画替换SMIL的借口(如果我们是技术人员,则SMIL 是),但这都涉及JavaScript和CSS.我在<img>
标签中使用了动画SVG,因为这就是SVG格式的重点:它是图像.
Doing as much research as I could, I keep finding excuses about replacing SMIL with web animations (which SMIL is if we're being technical) but this all involves JavaScript and CSS. I use animated SVGs in <img>
tags because that's the point of the SVG format: it's an image.
这真的非常好,因为这至少使我能够在臭名昭著的混乱网络中组织图像(例如,JavaScript没有导入,因此您必须填充全局范围).
This was really nice and all because it allowed me to at least organize my images on a web that's notorious for being a giant mess (e.g. JavaScript has no imports so you have to fill the global scope).
现在我无法使用SVG进行动画制作,GIF是自包含动画的唯一选择吗?
Now that I can't animate with SVG, is GIF the only option for self-contained animations?
推荐答案
SMIL并非已失效/已弃用您相信的那样. Chrome开发人员最近发布了以下内容:
SMIL is not as dead/deprecated as you believe it is. The Chrome developers recently posted this:
这篇关于没有smil,gif是我唯一的选择吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!