3 ms·
Another fun thing to do with using SVG-as-images in the browser is easy animation of the SVG, using Primitive (for example) as noted in the article to convert a
by minimaxir 9y ago
Another fun thing to do with using SVG-as-images in the browser is easy animation of the SVG, using Primitive (for example) as noted in the article to convert an image into SVG shapes, plus a tool like Vivus (https://maxwellito.github.io/vivus/ https://maxwellito.github.io/vivus/) or Snap.svg (http://snapsvg.io http://snapsvg.io) to animate each shape of the SVG.
Here’s a demo I made using Primitive + Vivus: http://minimaxir.com/2016/12/primitive/ http://minimaxir.com/2016/12/primitive/
- baybal2 9y agoSVG animation is amazing, but as a person who made work with in-browser animation and visualization my breadwinner, I can say that usage of JS for that is a huuuuuge downside Effectively, you have to rewrite a big part of actionscript functionality into your browser to do really simple things It is greatly regrettable than browsermakers have thrown out all declarative animation features, and never thought of improving on them.
- derefr 9y agoIs “declarative SVG animation scripting” really a primitive API you need the browser to support directly? “Rewriting a big part of Actionscript functionality” seems like the job of a JS animation framework, not the browser. Like the ones that animation tools that previously compiled to Flash (e.g. Adobe Animate itself) use.
- baybal2 9y agoJS animations that can approach flash level quality are hard to do. It is like saying that you don't need native video support, but you use JS to interpolate initial image.
- derefr 9y agoThe latter is false because the APIs for image manipulation don't give you features like hardware video-compression-codec decoding, and so you just can't really drive a <canvas> fast enough using JS to draw video on it. The JS graphics+SVG APIs, however, do have all the right primitives exposed to let you do flash-level animation. It's not a matter of incapability; it's just a matter of nobody having coded the right framework, or the right framework (i.e. the one Animate uses) being proprietary and without an open-source attempt to clone it. That doesn't suggest browser vendors should step in and put the capability into the browser, any more than the inability to do realtime 3D without a framework like three.js or a game engine like Unity's HTML5+WebAssembly engine, suggests that browsers should create a common, native game-engine-like API.