Serious Animation (an introduction to Web Animations)

63

description

English translation of Web Animations presentation given at html5j in Tokyo November 30 2013. Introduces the importance of animation, problems with existing technology, the Web Animations API and core concepts and a new Animation Elements specification. An HTML version of the slides (without comments) is available here: http://people.mozilla.org/~bbirtles/pres/html5j-2013/index-en.html

Transcript of Serious Animation (an introduction to Web Animations)

Page 1: Serious Animation (an introduction to Web Animations)
Page 2: Serious Animation (an introduction to Web Animations)
Page 3: Serious Animation (an introduction to Web Animations)

When you think of animation you probably imagine things like this…

Page 4: Serious Animation (an introduction to Web Animations)

Or perhaps this…

But actually there are other ways of using animation!

Page 5: Serious Animation (an introduction to Web Animations)

OSX’s genie effect make it easy to understand what has happened to

your window and how to get it back

Page 6: Serious Animation (an introduction to Web Animations)

Firefox’s interface uses animation in a similar way to tell you

where your download has gone.

Page 7: Serious Animation (an introduction to Web Animations)

Changes big and small can often be grasped more easily using animation.

Page 8: Serious Animation (an introduction to Web Animations)

Long stories can also be made easy to comprehend using animation.

Animation is essentially using time to convey information.

Page 9: Serious Animation (an introduction to Web Animations)
Page 10: Serious Animation (an introduction to Web Animations)
Page 11: Serious Animation (an introduction to Web Animations)
Page 12: Serious Animation (an introduction to Web Animations)
Page 13: Serious Animation (an introduction to Web Animations)

If we apply both these classes to the same element…

Page 14: Serious Animation (an introduction to Web Animations)

One wins since CSS Animation can’t do addition

Page 15: Serious Animation (an introduction to Web Animations)

If we make up a single animation combining both effects the timing won’t

match and we have to prepare all possible combinations in advance

Page 16: Serious Animation (an introduction to Web Animations)
Page 17: Serious Animation (an introduction to Web Animations)
Page 18: Serious Animation (an introduction to Web Animations)

We can’t animate Foxkeh’s eyes like this

Page 19: Serious Animation (an introduction to Web Animations)
Page 20: Serious Animation (an introduction to Web Animations)

SVG Animation actually has more features…

Page 21: Serious Animation (an introduction to Web Animations)

But CSS has much more content.

Page 22: Serious Animation (an introduction to Web Animations)

In most browsers the implementation of CSS Animation and SVG Animation

is completely separate.

Page 23: Serious Animation (an introduction to Web Animations)

As a result CSS is more optimised and correctly and widely implemented

Page 24: Serious Animation (an introduction to Web Animations)
Page 26: Serious Animation (an introduction to Web Animations)

(in so far as making changes to CSS properties is concerned)

Page 27: Serious Animation (an introduction to Web Animations)
Page 28: Serious Animation (an introduction to Web Animations)

Some people suggested we shouldn’t have two animation models for the Web.

Page 29: Serious Animation (an introduction to Web Animations)

At the same time developers pointed out missing features in both.

Page 30: Serious Animation (an introduction to Web Animations)

So we did this.

Page 31: Serious Animation (an introduction to Web Animations)

Features we already had in both CSS and SVG.

Page 32: Serious Animation (an introduction to Web Animations)

From CSS we imported animation direction.

Page 33: Serious Animation (an introduction to Web Animations)

CSS Transitions’ automatic reversing is not part of the Web Animations model but can be realized using other features of the model.

Page 34: Serious Animation (an introduction to Web Animations)

We imported a number of features from SVG such as additive animation, motion path animation and seek control.

Page 35: Serious Animation (an introduction to Web Animations)

The most complex features from SVG, however, are not part of the model but are included in the SVG bindings (“Animation Elements”).

Page 36: Serious Animation (an introduction to Web Animations)

We also added four new features. Timing groups and custom effects are particularly powerful.

Page 37: Serious Animation (an introduction to Web Animations)

Web Animations is fundamentally an abstract model.

Page 38: Serious Animation (an introduction to Web Animations)

CSS syntax and mapping to the model will be defined in a separate spec.

Page 39: Serious Animation (an introduction to Web Animations)

Likewise, SVG syntax and mapping will be defined in the Animation Elements spec.

Page 40: Serious Animation (an introduction to Web Animations)

There is also an API onto the model.

Page 41: Serious Animation (an introduction to Web Animations)

Currently the API and model are defined in one spec but that is simply for ease of maintenance.

Page 42: Serious Animation (an introduction to Web Animations)
Page 43: Serious Animation (an introduction to Web Animations)
Page 44: Serious Animation (an introduction to Web Animations)
Page 45: Serious Animation (an introduction to Web Animations)

http://brian.sol1.net/svg/2013/07/25/players-wanted-the-pause-and-seek-game/

Players are used to control playback of animations and timing groups.

Page 46: Serious Animation (an introduction to Web Animations)

Timing groups play their children simultaneously.

There are two types of timing groups: timing groups and timing chains (although these names may change).

Page 47: Serious Animation (an introduction to Web Animations)

Timing chains play their children in turn.

Page 48: Serious Animation (an introduction to Web Animations)

You can use them together.

Page 49: Serious Animation (an introduction to Web Animations)

The arrangement from the previous demo is as follows.

Page 50: Serious Animation (an introduction to Web Animations)
Page 51: Serious Animation (an introduction to Web Animations)
Page 52: Serious Animation (an introduction to Web Animations)
Page 53: Serious Animation (an introduction to Web Animations)

dev.w3.org/fxtf/web-animations

git.io/webanim Native implementation status.

Page 54: Serious Animation (an introduction to Web Animations)
Page 55: Serious Animation (an introduction to Web Animations)

By way of introduction to SVG animation, this is a very simple app for creating SVG animations.

You can try it at http://parapara-editor.mozlabs.jp/sandbox.

Page 56: Serious Animation (an introduction to Web Animations)

The completed animations get sent to a shared canvas where they are animated. This is also created with SVG animation.

You can find out more at http://parapara.mozlabs.jp.

Page 57: Serious Animation (an introduction to Web Animations)

The SVG file for a character looks like this.

Page 58: Serious Animation (an introduction to Web Animations)

But with Animation Elements we can simplify it to this.

Page 59: Serious Animation (an introduction to Web Animations)

The select attribute lets us re-use the animation definition.

Page 60: Serious Animation (an introduction to Web Animations)

Timing chains make sequencing easy.

Page 61: Serious Animation (an introduction to Web Animations)

Our door close demo could be written like this.

Element syntax is convenient for expressing hierarchies and can be used together with CSS by using <set> elements to set CSS classes that trigger animations.

Page 62: Serious Animation (an introduction to Web Animations)

This kind of approach lends itself to collecting timing information in one place, perhaps even a separate timesheet file.