NOTE: To preview some of the links included in this article you will need to be on an HTML5/SVG compliant browser. i.e. Webkit based (Chrome, Safari) or Gecko (Firefox 3.5+), you’re on IE (Trident) ? Don’t even bother clicking on the links !
With a lot of recent articles proclaiming that, with the imminent release of HTML5 will also come the death of Flash, I figured I’d start doing some reading around. I know the W3C are still drafting HTML5 standards (Version as of Mar 4th, 2010), but it’s close. Very close. Browsers are hedging their bets on what will be included and slowly we’re seeing adoption of some core HTML5 spec’s, most notably in Webkit based browsers (Chrome and Safari).
For me; the introduction of HTML5 will introduce many new HTML tags, some exciting new Javascript events (like native drag and drop!), but I think, of ALL of these features none will be as widely adopted, or as expansive, as the humble <canvas> tag.
A container, a Flash ’stage’ if you will for the sake of analogies. To quote:
…is only a container for graphics, you must use a script to actually paint graphics
http://www.w3schools.com/html5/tag_canvas.asp
With recent Javascript library developments from Mootools, jQuery, YUI, even the BBC’s own “Glow!” (to name just a few) we are seeing next generation Javascript (or if we’re being trendy “Web2.0″) that rivals some of Flash’s mainstream tweening capabilities. DOM and JavaScript Library mash-ups have exposed a new era of creativity. SEO compliant interfaces that lift content into a new dimension.
That humble canvas tag is going to extend that concept way beyond what I’d previously imagined possible. SVG (Scalable Vector Graphic) mash-ups created with Inkscape for example. Literally being able to compose SVG output that can be sucked straight into a canvas with CAKE (not to be confused with a well known MVC framework for PHP), but rather the Canvas Animation Kit Experiment, already developing next-NEXT generation Javascript frameworks to compliment HTML5 canvas painting.
For example it’s SVGParser() class…
SVGParser.load('cakenu3.svg', {
width: 1024,
height: 768,
onSuccess: this.initDesign.bind(this),
onFailure: function(xhr, e){ console.log(arguments) }
})
Inkscape SVG output: http://glimr.rubyforge.org/cake/cakenu3.svg (View Source for example SVG output).
Just think of SVG definitions as a cross between HTML imagemap’s and XML, but on steroids! The ability to define glyphs for typographic freedom. No more font constraints. Typographic freedom ? (We’ll see how the font houses (Adobe)) feel about that!
Vector graphics and the canvas tag. Enough to ‘kill’ Flash? We’ll see, but enough with the waffle. Show me some examples! Here you go, but remember; for optimum output view these on the latest Webkit based (support for HTML and SVG) browsers (Chrome/Safari).
HTML5/JavaScript and Canvas Animation Examples:
- Chrome Experiment – Holy! Cow!
- Awesome HTML5 canvas and audio tag demo!
- http://glimr.rubyforge.org/cake/redesign.html#forums
- http://3.paulhamill.com/t/test5.html
Further Reading:
Beyond The Canvas Tag
Google have taken SVG graphics and the capabilities of the canvas tag to new heights. With the installation of their O3D plugin it is possible to animate 3D objects directly within the browser. This is an absolutely amazing demo’ and with just a little bit of imagination the possibilities that this can lead to are endless!
http://o3d.googlecode.com/svn/trunk/samples/beachdemo/beachdemo.html