-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
845 lines (804 loc) · 25.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
<!--
Google IO 2012/2013 HTML5 Slide Template
Authors: Eric Bidelman <[email protected]>
Luke Mahé <[email protected]>
URL: https://code.google.com/p/io-2012-slides
Web Animation slides 2014
Authors: Alan Cutter <[email protected]>
Eric Willigers <[email protected]>
-->
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<!--<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">-->
<!--<meta name="viewport" content="width=device-width, initial-scale=1.0">-->
<!--This one seems to work all the time, but really small on ipad-->
<!--<meta name="viewport" content="initial-scale=0.4">-->
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" media="all" href="theme/css/default.css">
<link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="theme/css/phone.css">
<base target="_blank"> <!-- This amazingness opens all links in a new tab. -->
<script data-main="js/slides" src="js/require-1.0.8.min.js"></script>
<script data-main="js/slides" src="js/web-animations.js"></script>
</head>
<body style="opacity: 0">
<slides class="layout-widescreen">
<slide class="logoslide nobackground">
<article class="flexbox vcenter">
<h2>Web Animations</h2>
<h3>LCA Multimedia Miniconf</h3>
</article>
</slide>
<slide class="title-slide segue nobackground">
<aside class="gdbar"><img src="images/chrome-logo-128.png"></aside>
<!-- The content of this hgroup is replaced programmatically through the slide_config.json. -->
<hgroup class="auto-fadein">
<h1 data-config-title><!-- populated from slide_config.json --></h1>
<h2 data-config-subtitle><!-- populated from slide_config.json --></h2>
<p data-config-presenter><!-- populated from slide_config.json --></p>
</hgroup>
</slide>
<slide>
<hgroup>
<h2>Animations on the web today</h2>
</hgroup>
<article>
<ul class="build">
<li>CSS Animations</li>
<li>SVG Animations</li>
<li>JavaScript Animations (requestAnimationFrame, Canvas, WebGL, etc.)</li>
<li>Flash (becoming obsolete)</li>
</ul>
</article>
</slide>
<slide>
<hgroup>
<h2>CSS Animations</h2>
<h3>Transitions and Keyframe animations</h3>
</hgroup>
<article>
<pre class="prettyprint" data-lang="CSS">
.red.square { transition: transform 2s ease-in-out; }
.red.square:hover { transform: rotate(360deg); }</pre>
<pre class="prettyprint">
.yellow.square:hover { animation: spin 2s ease-in-out; }
@keyframes spin {
100% { transform: rotate(360deg); }
}</pre>
<style>
#squareContainer {
position: relative;
}
#redSquare {
position: absolute;
left: 200px;
-webkit-transition: -webkit-transform 2s ease-in-out;
transition: transform 2s ease-in-out;
width: 100px;
height: 100px;
background-color: #f44a3f;
display: inline-block;
margin-right: 30px;
}
#redSquare:hover {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
@-webkit-keyframes spin-animation {
to {
-webkit-transform: rotate(360deg);
}
}
@keyframes spin-animation {
to {
transform: rotate(360deg);
}
}
#yellowSquare {
position: absolute;
left: 600px;
width: 100px;
height: 100px;
background-color: #ffd14d;
}
#yellowSquare:hover {
-webkit-animation: spin-animation 2s ease-in-out;
animation: spin-animation 2s ease-in-out;
}
</style>
<div id="squareContainer">
<div id="redSquare"></div>
<div id="yellowSquare"></div>
</div>
<script>
yellowSquare.addEventListener('click', function() {
yellowSquare.style.webkitAnimationPlayState = (yellowSquare.style.webkitAnimationPlayState == 'paused') ? 'running' : 'paused';
yellowSquare.style.animationPlayState = (yellowSquare.style.animationPlayState == 'paused') ? 'running' : 'paused';
});
</script>
</article>
</slide>
<slide>
<hgroup>
<h2>CSS Animations</h2>
<h3>Transitions and Keyframe animations</h3>
</hgroup>
<article>
<ul class="build">
<li>Simple & effective</li>
<li>Declarative</li>
<li>Not tied to the main thread</li>
<li>Simple play/pause controls for keyframe animations</li>
<li class="red">No dynamic modification or definition of animation content</li>
<li class="red">No primitives for synchronising different animations playing together</li>
<li class="red">Cannot stack multiple animations on top of each other</li>
</ul>
</article>
</slide>
<slide>
<hgroup>
<h2>SVG Animations</h2>
<h3>SMIL</h3>
</hgroup>
<article>
<!-- SVG Animation example -->
<pre class="prettyprint" data-lang="SVG">
<animatetransform
attributeName="transform"
attributeType="xml"
type="rotate"
from="0deg"
to="360deg"
dur="2s"
repeatCount="indefinite"
></animatetransform></pre>
<svg id="svgAnimation" ns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" style="margin-top: -20px; display: inline-block">
<g transform="translate(100,100)">
<g>
<rect width="100" height="100" fill="green" transform="translate(-50,-50)"></rect>
<!-- Add ease-in-out and infinite iterations to this animation and the code -->
<animatetransform
attributeName="transform"
attributeType="xml"
type="rotate"
from="0"
to="360"
dur="2s"
repeatCount="indefinite"
></animatetransform>
</g>
</g>
</svg>
<button style="margin-left: 50px; margin-top: -180px; width: 60px;" id="svgAnimationControl">Pause</button>
<script>
var svgPaused = false;
svgAnimationControl.addEventListener('click', function() {
if (svgPaused) {
svgAnimation.unpauseAnimations();
svgAnimationControl.innerHTML = 'Pause';
} else {
svgAnimation.pauseAnimations();
svgAnimationControl.innerHTML = 'Play';
}
svgPaused = !svgPaused;
});
</script>
</article>
</slide>
<slide>
<hgroup>
<h2>SVG Animations</h2>
<h3>SMIL</h3>
</hgroup>
<article>
<ul class="build">
<li>Declarative</li>
<li>Has playback controls</li>
<li>Can synchronise animations together</li>
<li class="red">Entire SVG is treated as a single animation</li>
<li class="red">Cannot dynamically modify animation content</li>
<li class="red">Sees very little use on the web</li>
<li class="red">Does not integrate with HTML content</li>
<li class="red">
Implementations are lacking compared with CSS Animations
<ul class="build">
<li>Missing cross browser support</li>
<li>Fewer performance optimisations</li>
</ul>
</li>
</ul>
</article>
</slide>
<slide>
<hgroup>
<h2>JavaScript</h2>
</hgroup>
<article>
<pre class="prettyprint" data-lang="JavaScript">
function frame(time) {
document.querySelector('.blue.square').style.transform =
'rotate(' + (Math.sin(time / 1000) * 360) + 'deg)';
requestAnimationFrame(frame);
}
requestAnimationFrame(frame);</pre>
<style>
#jsAnimation {
margin-left: 40px;
margin-top: 60px;
width: 100px;
height: 100px;
background-color: #4387fd;
}
</style>
<div id="jsAnimation"></div>
<script>
function frame(time) {
jsAnimation.style.webkitTransform = 'rotate(' + (Math.sin(time / 1000) * 360) + 'deg)';
jsAnimation.style.transform = 'rotate(' + (Math.sin(time / 1000) * 360) + 'deg)';
requestAnimationFrame(frame);
}
requestAnimationFrame(frame);
</script>
</article>
</slide>
<slide>
<hgroup>
<h2>JavaScript</h2>
</hgroup>
<article>
<ul class="build">
<li>Total control over the animation</li>
<li>Access to powerful graphical tools (Canvas & WebGL)</li>
<li>Portable (even beyond the web)</li>
<li class="red">Must run on the main thread</li>
<li class="red">Procedural, not declarative</li>
</ul>
</article>
</slide>
<slide>
<hgroup>
<h2>Problems</h2>
</hgroup>
<article>
<ul class="build">
<li class="red">Different APIs have different models for animation</li>
<li class="red">Unnecessary maintenance to support multiple ways of doing the same thing</li>
<li class="red">A hassle for web developers to learn multiple techniques</li>
<li class="red">No way to synchronise different animation techniques together</li>
<li class="red">Not easy for JavaScript to set up declarative animations</li>
</ul>
</article>
</slide>
<slide>
<article class="flexbox vcenter">
<h2>Web Animations</h2>
<h3>A new general purpose animation model</h3>
</article>
</slide>
<slide>
<hgroup>
<h2>Contributors</h2>
</hgroup>
<article>
<ul>
<li>Mozilla</li>
<li>Google</li>
<li>Adobe</li>
<li>W3C: CSS-SVG Effects Task Force (FXTF)</li>
</ul>
</article>
</slide>
<slide>
<hgroup>
<h2>Motivations</h2>
</hgroup>
<article>
<ul class="build">
<li class="green">Provides a common model for CSS and SVG animations</li>
<li class="green">Allows different animation technologies to coordinate together</li>
<li class="green">Allows for future animation specs to integrate with the same model<br>(media integration, Layout Animations)</li>
<li class="green">Provides a JavaScript API for defining animations declaratively</li>
<li class="green">Animations are not tied to the main thread</li>
<li class="green">Makes HTML animations a more compelling alternative to Flash</li>
</ul>
</article>
</slide>
<slide>
<hgroup>
<h2>JavaScript API</h2>
</hgroup>
<article>
<h3>A simple example</h3>
<pre class="prettyprint" data-lang="JavaScript">
element.animate({transform: 'rotate(360deg)'}, 2);
</pre>
<img src="images/chrome-logo-128.png" id="simpleExample">
<script>
simpleExample.addEventListener('click', function() {
simpleExample.animate(
[{transform: 'rotate(0deg)'}, {transform: 'rotate(360deg)'}],
{duration: 2});
});
</script>
</article>
</slide>
<slide>
<hgroup>
<h2>JavaScript API</h2>
</hgroup>
<article>
<h3>More complex timing</h3>
<pre class="prettyprint" data-lang="JavaScript">
element.animate(
{transform: 'rotate(360deg)'},
{
direction: 'alternate',
duration: 1,
iterations: 4
});
</pre>
<img src="images/chrome-logo-128.png" id="complexExample">
<script>
complexExample.addEventListener('click', function() {
complexExample.animate(
[{transform: 'rotate(0deg)'}, {transform: 'rotate(360deg)'}],
{direction: 'alternate', duration: 1, iterations: 4});
});
</script>
</article>
</slide>
<slide>
<hgroup>
<h2>JavaScript API</h2>
</hgroup>
<article>
<h3>More complex timing</h3>
<pre class="prettyprint" data-lang="JavaScript">
element.animate(
{transform: 'rotate(360deg)'},
{
direction: 'alternate',
duration: 1,
iterations: Infinity,
easing: 'ease-in-out',
playbackRate: 2
});
</pre>
<img src="images/chrome-logo-128.png" id="moreComplexExample">
<script>
moreComplexExample.addEventListener('click', function() {
moreComplexExample.animate(
[{transform: 'rotate(0deg)'}, {transform: 'rotate(360deg)'}],
{direction: 'alternate', duration: 1, iterations: Infinity, easing: 'ease-in-out', playbackRate: 2});
});
</script>
</article>
</slide>
<slide>
<hgroup>
<h2>JavaScript API</h2>
</hgroup>
<article>
<h3>Without the syntactic sugar</h3>
<pre class="prettyprint" data-lang="JavaScript">
document.timeline.play(
new Animation(
element,
new KeyframeAnimationEffect([{transform: 'rotate(360deg)'}]),
{duration: 2}));
</pre>
<img src="images/chrome-logo-128.png" id="noSugar">
<script>
noSugar.addEventListener('click', function() {
document.timeline.play(
new Animation(
noSugar,
[{transform: 'rotate(0deg)'}, {transform: 'rotate(360deg)'}],
{duration: 2}));
});
</script>
</article>
</slide>
<slide>
<hgroup>
<h2>JavaScript API</h2>
</hgroup>
<article>
<h3>Parallel animation grouping</h3>
<pre class="prettyprint" data-lang="JavaScript">
document.timeline.play(new ParGroup([
new Animation(parItem1, [{width: '0px'}, {width: '600px'}], 1),
new Animation(parItem2, [{width: '0px'}, {width: '800px'}], 1),
new Animation(parItem3, [{width: '0px'}, {width: '200px'}], 1),
]));
</pre>
<style>
#parGroupContainer {
width: 820px;
background-color: lightgrey;
border: solid black;
padding: 20px;
padding-bottom: 10px;
}
.par-timing-box {
width: 0px;
height: 20px;
background: #ffd14d;
border: solid black;
margin-bottom: 10px;
}
</style>
<div id="parGroupContainer">
<div id="parItem1" class="par-timing-box"></div>
<div id="parItem2" class="par-timing-box"></div>
<div id="parItem3" class="par-timing-box"></div>
</div>
<script>
parGroupContainer.addEventListener('click', function() {
document.timeline.play(new ParGroup([
new Animation(parItem1, [{width: '0px'}, {width: '600px'}], 1),
new Animation(parItem2, [{width: '0px'}, {width: '820px'}], 1),
new Animation(parItem3, [{width: '0px'}, {width: '200px'}], 1),
]));
});
</script>
</article>
</slide>
<slide>
<hgroup>
<h2>JavaScript API</h2>
</hgroup>
<article>
<h3>Sequential animation grouping</h3>
<pre class="prettyprint" data-lang="JavaScript">
document.timeline.play(new SeqGroup([
new Animation(seqItem1, [{width: '0px'}, {width: '300px'}], 1),
new Animation(seqItem2, [{width: '0px'}, {width: '400px'}], 1),
new Animation(seqItem3, [{width: '0px'}, {width: '100px'}], 1),
]));
</pre>
<style>
#seqGroupContainer {
width: 820px;
background-color: lightgrey;
border: solid black;
padding: 20px;
padding-bottom: 10px;
}
.seq-timing-box {
width: 0px;
height: 20px;
background: #0da861;
border: solid black;
margin-bottom: 10px;
}
#seqItem2 { margin-left: 305px; }
#seqItem3 { margin-left: 710px; }
</style>
<div id="seqGroupContainer">
<div id="seqItem1" class="seq-timing-box"></div>
<div id="seqItem2" class="seq-timing-box"></div>
<div id="seqItem3" class="seq-timing-box"></div>
</div>
<script>
var seqPlayer;
seqGroupContainer.addEventListener('click', function() {
if (seqPlayer) {
seqPlayer.source = null;
}
seqPlayer = document.timeline.play(new SeqGroup([
new Animation(seqItem1, [{width: '0px'}, {width: '300px'}], 1),
new Animation(seqItem2, [{width: '0px'}, {width: '400px'}], 1),
new Animation(seqItem3, [{width: '0px'}, {width: '100px'}], 1),
]));
});
</script>
</article>
</slide>
<slide>
<hgroup>
<h2>JavaScript API</h2>
</hgroup>
<article>
<h3>Nested grouped animations</h3>
<style>
#outerSeqGroupContainer {
width: 835px;
background-color: lightgrey;
border: solid black;
padding: 20px;
padding-bottom: 10px;
}
#innerParGroupContainer {
margin-left: 305px;
margin-bottom: 10px;
width: 380px;
background-color: lightgrey;
border: solid black;
padding: 20px;
padding-bottom: 10px;
}
.outer-seq-timing-box {
width: 0px;
height: 20px;
background: #0da861;
border: solid black;
margin-bottom: 10px;
}
.inner-par-timing-box {
width: 0px;
height: 20px;
background: #ffd14d;
border: solid black;
margin-bottom: 10px;
}
#outerSeqItem2 { margin-left: 730px; }
</style>
<div id="outerSeqGroupContainer">
<div id="outerSeqItem1" class="outer-seq-timing-box"></div>
<div id="innerParGroupContainer">
<div id="innerParItem1" class="inner-par-timing-box"></div>
<div id="innerParItem2" class="inner-par-timing-box"></div>
<div id="innerParItem3" class="inner-par-timing-box"></div>
</div>
<div id="outerSeqItem2" class="outer-seq-timing-box"></div>
</div>
<script>
var outerSeqPlayer;
outerSeqGroupContainer.addEventListener('click', function() {
if (outerSeqPlayer) {
outerSeqPlayer.source = null;
}
outerSeqPlayer = document.timeline.play(new SeqGroup([
new Animation(outerSeqItem1, [{width: '0px'}, {width: '300px'}], 1),
new ParGroup([
new Animation(innerParItem1, [{width: '0px'}, {width: '300px'}], 1),
new Animation(innerParItem2, [{width: '0px'}, {width: '380px'}], 1),
new Animation(innerParItem3, [{width: '0px'}, {width: '100px'}], 1),
]),
new Animation(outerSeqItem2, [{width: '0px'}, {width: '100px'}], 1),
]));
});
</script>
</article>
</slide>
<slide>
<hgroup>
<h2>JavaScript API</h2>
</hgroup>
<article>
<h3>Nested grouped animations</h3>
<pre class="prettyprint" data-lang="JavaScript">
document.timeline.play(new SeqGroup([
new Animation(outerSeqItemFirst, [{width: '0px'}, {width: '300px'}], 1),
new ParGroup([
new Animation(innerParItem1, [{width: '0px'}, {width: '300px'}], 1),
new Animation(innerParItem2, [{width: '0px'}, {width: '380px'}], 1),
new Animation(innerParItem3, [{width: '0px'}, {width: '100px'}], 1),
]),
new Animation(outerSeqItemLast, [{width: '0px'}, {width: '100px'}], 1)
]));
</pre>
</article>
</slide>
<slide>
<hgroup>
<h2>JavaScript API</h2>
</hgroup>
<article>
<h3>Path animations</h3>
<img id="pathImage" src="images/chrome-logo-128.png">
<script>
document.timeline.play(
new Animation(
pathImage,
new PathAnimationEffect(
'M 100 200 ' +
'C 200 100 300 0 400 100 ' +
'C 500 200 600 300 700 200 ' +
'C 800 100 900 100 900 100', 'auto-rotate'),
{
duration: 1,
direction: 'alternate',
easing: 'ease-in-out',
iterations: Infinity,
}));
</script>
</article>
</slide>
<slide>
<hgroup>
<h2>JavaScript API</h2>
</hgroup>
<article>
<h3>Path animations</h3>
<pre class="prettyprint" data-lang="JavaScript">
var svgPathData = 'M 100 200' +
'C 200 100 300 0 400 100' +
'C 500 200 600 300 700 200' +
'C 800 100 900 100 900 100';
var pathAnimation = new Animation(
chromeLogo,
new PathAnimationEffect(svgPathData, 'auto-rotate'),
{
duration: 1,
direction: 'alternate',
easing: 'ease-in-out',
iterations: Infinity,
});
document.timeline.play(pathAnimation);
</pre>
</article>
</slide>
<slide id="seekSlide">
<hgroup>
<h2>JavaScript API</h2>
</hgroup>
<article>
<h3>Playback control</h3>
<pre class="prettyprint" data-lang="JavaScript">
var player = document.timeline.play(pathAnimation);
player.paused = true;
seekSlide.onmousemove = function(event) {
player.currentTime = (event.clientX - seekSlide.offsetLeft) / seekSlide.clientWidth;
};
</pre>
<img id="seekImage" src="images/chrome-logo-128.png">
<script>
var seekPlayer = document.timeline.play(new Animation(seekImage,
new PathAnimationEffect(
'M 100 200 ' +
'C 200 100 300 0 400 100 ' +
'C 500 200 600 300 700 200 ' +
'C 800 100 900 100 900 100', 'auto-rotate'),
{duration: 1.5}));
seekPlayer.paused = true;
seekSlide.onmousemove = function(event) {
seekPlayer.currentTime = 1.5 * ((event.clientX - seekSlide.offsetLeft) / seekSlide.clientWidth);
};
</script>
</article>
</slide>
<slide id="customSlide">
<hgroup>
<h2>JavaScript API</h2>
</hgroup>
<article>
<h3 style="margin-top: -30px;">Custom animation effects</h3>
<pre class="prettyprint" data-lang="JavaScript">
function customAnimationEffect(timeFraction, iteration, target) {
output.textContent = 'timeFraction: ' + timeFraction.toFixed(2);
'iteration: ' + iteration + '\n' +
}
document.timeline.play(
new Animation(
null,
customAnimationEffect,
{ duration: 2, direction: 'alternate',
easing: 'ease-in-out', iterations: Infinity }));
</pre>
<pre id="customOutput" data-lang="output"></pre>
<script>
function customAnimationEffect(timeFraction, iteration, target) {
customOutput.textContent = 'timeFraction: ' + timeFraction.toFixed(2) + '\n' +
'iteration: ' + iteration;
}
var customPlayer = document.timeline.play(
new Animation(
null,
{sample: customAnimationEffect},
{
duration: 2,
direction: 'alternate',
easing: 'ease-in-out',
iterations: Infinity,
}));
window.addEventListener('slideenter', function(event) {
if (event.slide == customSlide) {
customPlayer.currentTime = 0;
}
});
</script>
</article>
</slide>
<slide>
<hgroup>
<h2>Timing Model</h2>
</hgroup>
<article class="flexbox hcenter">
<img src="images/time-model.png" style="margin-left: 175px; margin-top: -20px;">
</article>
</slide>
<slide>
<hgroup>
<h2>Timing Model</h2>
<h3>Timing inputs</h3>
</hgroup>
<article>
<pre class="prettyprint" data-lang="WebIDL">
dictionary TimingInput {
double delay = 0;
double endDelay = 0;
FillMode fill = "auto";
double iterationStart = 0.0;
unrestricted double iterations = 1.0;
(unrestricted double or DOMString) duration = "auto";
double playbackRate = 1.0;
PlaybackDirection direction = "normal";
DOMString easing = "linear";
EasingTimesInput easingTimes = "distribute";
};
</pre>
</article>
</slide>
<slide>
<hgroup>
<h2>Timing Model</h2>
<h3>Timing calculations</h3>
</hgroup>
<article class="flexbox hcenter">
<div style="height: 500px; overflow: scroll; margin-left: auto; margin-right: auto;">
<img src="images/time-calculations.svg" style="height: 1500px;">
</div>
</article>
</slide>
<slide>
<hgroup>
<h2>Implementation Status</h2>
</hgroup>
<article>
<ul class="build">
<li>Specification at First Public Working Draft: <a href="http://www.w3.org/TR/web-animations/">www.w3.org/TR/web-animations</a></li>
<li>Chrome:
<ul>
<li>CSS Transitions & Animations rewritten on top of the Web Animations model</li>
<li>JavaScript API in development behind a flag</li>
</ul>
<li>Firefox & Safari: Started implementation</li>
<li>IE: No public signals</li>
</ul>
</article>
</slide>
<slide>
<hgroup>
<h2>Polyfill</h2>
</hgroup>
<article>
<ul class="build">
<li>A JS implementation of the API</li>
<li>Allows developers to use the technology on browsers that don't yet support it</li>
<li>Available on Github: <a href="https://github.com/web-animations/web-animations-js">github.com/web-animations/web-animations-js</a></li>
<li>Please try it out!</li>
</ul>
</article>
</slide>
<slide>
<article class="flexbox vcenter">
<h2>Demos</h2>
</article>
</slide>
<slide>
<article class="flexbox vcenter">
<h2><span class="blue">Questions?</span></h2>
</article>
</slide>
<slide class="thank-you-slide segue nobackground">
<aside class="gdbar right"><img src="images/chrome-logo-128.png"></aside>
<article class="flexbox vleft auto-fadein">
<h2>Thank You!</h2>
</article>
<p class="auto-fadein" data-config-contact>
<!-- populated from slide_config.json -->
</p>
</slide>
<slide class="backdrop"></slide>
</slides>
<!--[if IE]>
<script src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"></script>
<script>CFInstall.check({mode: 'overlay'});</script>
<![endif]-->
</body>
</html>