63

真面目なアニメーション (html5j 2013, Web Animations)

Embed Size (px)

DESCRIPTION

Web Animationsという技術の紹介としてhtml5j 2013のプレゼンです。 アニメーションの重要さ、現在のウエブプラットホームの弱点、Web Animationsの機能とそのAPIの基本的な使い方、Animation Elementsというスペックなどの紹介です。 カンファレンスの配信は以下のURLでご覧になれます。 https://www.youtube.com/watch?v=Chdlf5PK7E0#t=435 HTML版はこちら: http://people.mozilla.org/~bbirtles/pres/html5j-2013/

Citation preview

Page 1: 真面目なアニメーション (html5j 2013, Web Animations)
Page 2: 真面目なアニメーション (html5j 2013, Web Animations)
Page 3: 真面目なアニメーション (html5j 2013, Web Animations)

アニメーションと言えば、だいたいこのようなものを連想するでしょう。

Page 4: 真面目なアニメーション (html5j 2013, Web Animations)

またはこの人…

しかし、実はニャンコのGIF以外の使い方もあります。

Page 5: 真面目なアニメーション (html5j 2013, Web Animations)

OSXのGenie効果では アニメーションによって最小化の結果が分かりやすく伝えられて、 元に戻したいとき、どうすればいいかすぐ推測できます。

Page 6: 真面目なアニメーション (html5j 2013, Web Animations)

Firefoxのインタフェースにもアニメーションが同様に使われています。 読み込んだファイルを開くときどこにあるかはすぐ分かります。

Page 7: 真面目なアニメーション (html5j 2013, Web Animations)

だいたいどんな変化でも アニメーションによってより 分かりやすく伝えることができます。

Page 8: 真面目なアニメーション (html5j 2013, Web Animations)

長い物語もアニメーションによって誰でも分かるように伝えられます。

基本的にアニメーションは時間を生かして、情報を伝えることです。

Page 9: 真面目なアニメーション (html5j 2013, Web Animations)
Page 10: 真面目なアニメーション (html5j 2013, Web Animations)
Page 11: 真面目なアニメーション (html5j 2013, Web Animations)
Page 12: 真面目なアニメーション (html5j 2013, Web Animations)
Page 13: 真面目なアニメーション (html5j 2013, Web Animations)

もし両方のクラスを同じ要素に適用すれば…

Page 14: 真面目なアニメーション (html5j 2013, Web Animations)

ひとつが勝ち。CSS Animationで足し算できないから。

Page 15: 真面目なアニメーション (html5j 2013, Web Animations)

前もって両方の効果が入っているアニメーションを作ってもタイミングが合わないし、全ての組み合わせを用意しなければならない。

Page 16: 真面目なアニメーション (html5j 2013, Web Animations)
Page 17: 真面目なアニメーション (html5j 2013, Web Animations)
Page 18: 真面目なアニメーション (html5j 2013, Web Animations)

このようにフォクすけの目をアニメートできない

Page 19: 真面目なアニメーション (html5j 2013, Web Animations)
Page 20: 真面目なアニメーション (html5j 2013, Web Animations)

SVG Animationの機能に方が豊かだが…

Page 21: 真面目なアニメーション (html5j 2013, Web Animations)

CSSのコンテンツの方が多い。

Page 22: 真面目なアニメーション (html5j 2013, Web Animations)

そして多くのブラウザーでは CSS Animationの実装と SVG Animationの実装が全く別のもの

Page 23: 真面目なアニメーション (html5j 2013, Web Animations)

その結果として、よく使われているCSS Animationの方がちゃんと実装されています。

Page 24: 真面目なアニメーション (html5j 2013, Web Animations)
Page 26: 真面目なアニメーション (html5j 2013, Web Animations)

(CSS プロパティーを変えるとき)

Page 27: 真面目なアニメーション (html5j 2013, Web Animations)
Page 28: 真面目なアニメーション (html5j 2013, Web Animations)

Webには二つより一つのアニメー

ション・モデルを作った方がよいじゃないかという声があって…

Page 29: 真面目なアニメーション (html5j 2013, Web Animations)

同時にWeb開発者が欠けている機能を指摘してくれた。

Page 30: 真面目なアニメーション (html5j 2013, Web Animations)

それでこうしました。

Page 31: 真面目なアニメーション (html5j 2013, Web Animations)

すでにSVGにもCSSにもあった機能。

Page 32: 真面目なアニメーション (html5j 2013, Web Animations)

CSSだけにあってWeb Animationsに入れたのはdirectionです。

Page 33: 真面目なアニメーション (html5j 2013, Web Animations)

CSS Transitionの自動逆再生はWeb Animationsのモデルに

入ってないけど他の機能ですぐ実現できる。

Page 34: 真面目なアニメーション (html5j 2013, Web Animations)

SVGからいくつかの機能を取り

込んだ。例えば、アニメーションを足し算する機能(加法的アニメーション)、モーションパス、時間制御など。

Page 35: 真面目なアニメーション (html5j 2013, Web Animations)

SVGの中にもっとも複雑な機能を

入れなかったがモデルに入っている機能ですぐ実現できる。

Page 36: 真面目なアニメーション (html5j 2013, Web Animations)

新しい機能よつ入れた。特に有力なのはタイミンググループとカスタム効果。

Page 37: 真面目なアニメーション (html5j 2013, Web Animations)

根本的にWeb Animationsは抽象的なアニメーションモデルです。

Page 38: 真面目なアニメーション (html5j 2013, Web Animations)

どうやってCSS構文をWeb Animationsのモデルによって実装するかとは別のスペックで定義される。

Page 39: 真面目なアニメーション (html5j 2013, Web Animations)

同様にSVGの構文と仕組みはAnimation Elementsというスペックで定義されている。

Page 40: 真面目なアニメーション (html5j 2013, Web Animations)

もう一つの界面としてモデルにはAPIもある。

Page 41: 真面目なアニメーション (html5j 2013, Web Animations)

現在モデルもAPIも同じスペックで定義されている。それは維持しやすいからだけです。

Page 42: 真面目なアニメーション (html5j 2013, Web Animations)
Page 43: 真面目なアニメーション (html5j 2013, Web Animations)
Page 44: 真面目なアニメーション (html5j 2013, Web Animations)
Page 45: 真面目なアニメーション (html5j 2013, Web Animations)

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

アニメーションなどの時間制御、一時停止、巻き戻しなどはプレーヤーという概念によって行う。

Page 46: 真面目なアニメーション (html5j 2013, Web Animations)

タイミンググループの子供は同時に動く。

タイミンググループには種類二つある。名前はまた変わるかもしれないけど、とりあえずタイミンググループとタイミングチェーンと呼ばれる。

Page 47: 真面目なアニメーション (html5j 2013, Web Animations)

タイミングチェーンのこどもは順番に動く。

Page 48: 真面目なアニメーション (html5j 2013, Web Animations)

一緒に使える。

Page 49: 真面目なアニメーション (html5j 2013, Web Animations)

前のデモの構成

Page 50: 真面目なアニメーション (html5j 2013, Web Animations)
Page 51: 真面目なアニメーション (html5j 2013, Web Animations)
Page 52: 真面目なアニメーション (html5j 2013, Web Animations)
Page 53: 真面目なアニメーション (html5j 2013, Web Animations)

dev.w3.org/fxtf/web-animations

git.io/webanim ネイティブ実装現状

Page 54: 真面目なアニメーション (html5j 2013, Web Animations)
Page 55: 真面目なアニメーション (html5j 2013, Web Animations)

SVG Animationの紹介として、これはものすごくSVG Animationエディターのアプリ。以下のURLでアクセスできる。

http://parapara-editor.mozlabs.jp/sandbox

Page 56: 真面目なアニメーション (html5j 2013, Web Animations)

完成したキャラクターが交通のキャンバスで表示される。 それもSVG Animationでできている。 詳しくは以下のURLをご覧ください。

http://parapara.mozlabs.jp

Page 57: 真面目なアニメーション (html5j 2013, Web Animations)

キャラクターのSVGファイルの構成。

Page 58: 真面目なアニメーション (html5j 2013, Web Animations)

しかし、Animation Elementsでもっと簡単に書ける。

Page 59: 真面目なアニメーション (html5j 2013, Web Animations)

selectという属性によってアニメーションの定義を再利用できる。

Page 60: 真面目なアニメーション (html5j 2013, Web Animations)

タイミングチェーンによって順序が作りやすい。

Page 61: 真面目なアニメーション (html5j 2013, Web Animations)

ドアが閉まるデモの構成。

要素構文はこんなような時間階層に適切。しかし、<set>という要素によってCSSのクラスを適用すればCSS Animationも同時に使える。

Page 62: 真面目なアニメーション (html5j 2013, Web Animations)

タイミング情報を1か所またタイムシートと呼ばれる別のファイルに集めるパターンが多い。