-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
1353 lines (1128 loc) · 34.9 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
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Animations Deep Dive</title>
<!--
Author: Estelle Weyl
Contact: firstName @ lastName dot ORG
Twitter: @estellevw
-->
<link href='https://fonts.googleapis.com/css?family=Sanchez' rel='stylesheet'>
<link rel="stylesheet" href="static/css/style.css" media="projection, screen"/>
<style>
</style>
</head>
<body> <header>
<nav>
<ul>
<li class="button cancel" id="back">Back</li>
<li class="button done" id="next">Next</li>
</ul>
</nav>
</header>
<div id="presentation">
<div id="presentation-counter"></div>
<div id="slides">
<!-- Title Slide -->
<div class="slide intro">
<header>
<h1>Animation Deep Dive</h1>
</header>
<h2><a href="http://estelle.github.io/animation">http://estelle.github.io/animation/</a><br/>#AnimDive</h2>
<div class="homepencil">✎</div>
</div>
<div class="slide normal">
<header><h1>Estelle Weyl</h1></header>
<section class="content">
<h2><a href="http://www.standardista.com">www.standardista.com</a></h2>
<h2><a href="http://www.twitter.com/estellevw">@estellevw</a></h2>
<h2><a href="http://www.twitter.com/standardista">@standardista</a></h2>
<div style="float:right"><img src="http://akamaicovers.oreilly.com/images/9780980846904/cat.gif" alt="HTML5 and CSS3 for the Real World"><img src="http://akamaicovers.oreilly.com/images/0636920018063/cat.gif" alt="HTML5: The Definitive Guide" style="margin: 0 20px;"/><img src="http://akamaicovers.oreilly.com/images/0636920021711/cat.gif" alt="MObile HTML5" style="margin: 0 20px;"/><img src="http://akamaicovers.oreilly.com/images/0636920025955/cat.gif" alt="Web Performance Daybook"/></div>
</section>
</div>
<div class="slide intro">
<header><h1>#DiveAnim</h1></header>
<h2>Needs more cowbell</h2>
</div>
<!-- Simplest Transition -->
<div class="slide normal">
<header><h1>Simplest Transition</h1></header>
<section class="content">
<pre style="font-size:140%;">a {
color: green;
}
a:hover {
color: orange;
}</pre>
<p class="hoverme h1">Hover Over Me</p>
</section>
</div>
<!-- CSS3 Transition -->
<div class="slide normal">
<header><h1>CSS3 Transition</h1></header>
<section class="content">
<pre style="font-size:140%;">a {
color: green;
transition: 1s;
}
a:hover {
color: orange;
}</pre>
<p class="hoverme h1 simptrans">Hover Over Me</p>
</section>
</div>
<!-- property overview -->
<div class="slide">
<header><h1>transitions</h1></header>
<section class="content">
<p>Enables the transition of properties from one state to the next over a defined length of time</p>
<ul>
<li><em>transition-property:</em> properties (or 'all') that transition</li>
<li><em>transition-duration:</em> s or ms it takes to transition</li>
<li><em>transition-timing-function:</em> bezier curve of transition</li>
<li><em>transition-delay:</em> s or ms before transition starts</li>
<li><em>transition:</em> shorthand for 4 transition properties</li>
</ul>
<ul class="icons" style="clear: both;">
<li class="chrome">Chrome</li>
<li class="safari">Safari</li>
<li class="firefox">Firefox 4/16</li>
<li class="opera">Opera 10.5</li>
<li class="ie">IE 10</li>
</section>
</div>
<!-- font transition example -->
<div class="slide">
<header><h1>transitions</h1></header>
<section class="content">
<pre contenteditable class="code">code {
color: black;
font-size: 85%;
background-color: rgba(255,255,255,0.9);
transition: all 2s ease-in 50ms;
}
code:hover {
color: red;
font-size: 120%;
background-color: rgba(255,255,255,0.8);
}
</pre>
<pre contenteditable>code {
transition:
color, font-size, background-color 2s ease-in 50ms;
}</pre>
</section>
</div>
<!-- font transition example -->
<div class="slide">
<header><h1>transitions</h1></header>
<section class="content">
<pre contenteditable class="code code2">code {
color: black;
font-size: 85%;
background-color: rgba(255,255,255,0.9);
transition: all 2s ease-in 50ms;
}
code:hover {
color: red;
transform: scale(1.4);
transform-origin: 0 0;
background-color: rgba(255,255,255,0.8);
}
</pre>
<pre contenteditable>code {
transition:
transform 2s ease-in 50ms;
}</pre>
</section>
</div>
<!-- what can be transitioned? -->
<div class="slide normal">
<header><h1>What can be transitioned?</h1></header>
<section class="content">
<p>Anything that has intermediate values</p>
<pre style="width: 40%; float:left;" class="yes">code {
opacity: 1;
}
code:halfway {
opacity: 0.5;
}
code:hover {
opacity: 0;
}</pre>
<pre style="width: 40%; float:right;" class="no">code {
display: block;
}
code:halfway {
display: ???
}
code:hover {
display: none;
}</pre>
</section>
</div>
<!-- what can be transitioned2? -->
<div class="slide normal">
<header><h1>What can be transitioned?</h1></header>
<section class="content">
<p>2 values that have REAL intermediary values</p>
<pre style="width: 40%; float:left;" class="yes">code {
font-size: 100%;
}
code:halfway {
font-size: 110%;
}
code:hover {
font-size: 120%;
}</pre>
<pre style="width: 40%; float:right;" class="no">code {
height: auto;
}
code:halfway {
height: ???
}
code:hover {
height: 1000px;
}</pre>
</section>
</div>
<!-- list of tranisitionable properties -->
<div class="slide normal">
<header><h1>Transitionable Properties</h1></header>
<section class="content">
<ul class="columns">
<li>background-color</li>
<li>background-position</li>
<li>border-color</li>
<li>border-width</li>
<li>border-spacing</li>
<li>bottom</li>
<li>clip</li>
<li>color</li>
<li>crop</li>
<li>font-size</li>
<li>font-weight</li>
<li>height</li>
<li>left</li>
<li>letter-spacing</li>
<li>line-height</li>
<li>margin</li>
<li>max-height</li>
<li>max-width</li>
<li>min-height</li>
<li>min-width</li>
<li>opacity</li>
<li>outline-color</li>
<li>outline-offset</li>
<li>outline-width</li>
<li>padding</li>
<li>right</li>
<li>text-indent</li>
<li>text-shadow</li>
<li>top</li>
<li>vertical-align</li>
<li>visibility</li>
<li>width</li>
<li>word-spacing</li>
<li>z-index</li>
</ul>
</section>
</div>
<!-- transitioning placement -->
<div class="slide object">
<header><h1>Transition placement</h1></header>
<object data="files/transitionplacement.html"></object>
<a href="files/transitionplacement.html" target="play" class="objectlink">Try it out!</a>
</div>
<!-- Tranform Features (or Limitations) -->
<div class="slide normal">
<header><h1>Transition Features (or Limitations)</h1></header>
<section class="content">
<ul>
<li>Single Iteration</li>
<li>Reverse goes to initial state</li>
<li>No granular control</li>
<li>Limited methods of initiation</li>
<li>Can't force them to finish</li>
</ul>
</section>
</div
<!-- Tranform Features (or Limitations) -->
<div class="slide normal">
<header><h1><code>transitionend</code> event</h1></header>
<section class="content">
<ul>
<li>Event thrown only when transition completes</li>
<li><code>transitionend</code> for EVERY property</li>
<li><code>transitionend</code> for each long-hand property within a shorthand</li>
</ul>
<pre contenteditable>table {
border: 1px black solid;
transition: border 1s linear 50ms;
}
table:hover {
border: 5px red solid;
}</pre>
<ul style="-moz-column-count: 2;-webkit-column-count: 2; column-count: 2;">
<li>border-top-color</li>
<li>border-right-color</li>
<li>border-bottom-color</li>
<li>border-left-color</li>
<li>border-top-width</li>
<li>border-right-width</li>
<li>border-bottom-width</li>
<li>border-left-width</li>
</ul>
</section>
</div>
<!-- Useful example -->
<div class="slide normal">
<header><h1>Putting it together in the Real World</h1></header>
<section class="content" style="min-height: 400px;">
<nav>
<ul>
<li>About
<ul>
<li>Me</li>
<li>You</li>
<li>Them</li>
<li>Nobody</li>
</ul>
</li>
<li>Posts
<ul>
<li>Door Post</li>
<li>Wall hanging</li>
<li>Stair Banister</li>
<li>Washington</li>
</ul></li>
<li>Topics
<ul>
<li>CSS3</li>
<li>JavaScript</li>
<li>HTML5</li>
<li>SEO</li>
</ul></li>
<li>Events
<ul>
<li>Party</li>
<li>Dinner</li>
<li>Hike</li>
<li>Foo Camp</li>
</ul></li>
</ul>
</nav>
<pre contenteditable>nav ul li {
list-style-type: none;
}
nav > ul > li {
display: inline-block;
position:relative;
}
nav ul ul {
transform: scale(1,0);
transform-origin: top center;
transition:0.2s linear 50ms;
position:absolute;
top: 100%;
}
nav li:hover ul {
transform: scale(1,1);
}</pre>
</section>
</div>
<!-- card flip
<div class="slide normal">
<header><h1>Pick a card</h1></header>
<section class="content">
<div class="card">
<div class="front"></div>
<div class="back">♥</div>
</div>
<div class="card">
<div class="front"></div>
<div class="back" style="color: black">♣</div>
</div>
<div class="card">
<div class="front"></div>
<div class="back">♦</div>
</div>
<pre contenteditable style="height:500px; overflow:scroll; float: right;">.card {
position: absolute;
perspective: 600px;
}
.card:hover {
transition: 1s ease;
}
.card .front {
transform: rotateX(0deg) rotateY(0deg);
transform-style: preserve-3d;
backface-visibility: hidden;
transition: all .4s ease-in-out;
}
.card:hover .front {
transform: rotateY(180deg);
}
.card .back {
transform: rotateY(-180deg);
transform-style: preserve-3d;
backface-visibility: hidden;
transition: all .4s ease-in-out;
}
.card:hover .back {
transform: rotateY(0);
}
.card:first-of-type {
transform: rotate(-5deg);
}
.card:nth-of-type(2):hover {
transform: rotate(0) translatex(120px);
}
.card:last-of-type {
transform: rotate(5deg);
}
.card:first-of-type:hover {
transform: rotate(10deg) translatey(180px);
}
</pre>
</section>
</div>
-->
<div class="slide intro">
<header><h1>Animations</h1></header>
<section class="content">
<table class="icons" style="clear: both; margin: 50px auto;">
<tr>
<td><ul class="icons"><li class="chrome">Chrome</li></ul></td>
<td><ul class="icons"><li class="safari">Safari</li></ul></td>
<td><ul class="icons"><li class="firefox">Firefox</li></ul></td>
<td><ul class="icons"><li class="opera">Opera</li></ul></td>
<td><ul class="icons"><li class="ie">IE</li></ul></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td>10</td>
</tr>
</table>
<p> Prefix -webkit- for < iOS9 / Safari 9 and Android <= 4.4.4.</p>
</section>
</div>
<div class="slide normal">
<header><h1>Animation Features (or limitations)</h1></header>
<section class="content">
<ul>
<li>Single, many or infinite iterations</li>
<li>Single or bi-directional</li>
<li>Granular control</li>
<li>Can be initiated on page load</li>
<li>Has more robust JS Hooks</li>
<li>Can be paused</li>
<li>Lowest priority in UI Thread</li>
</ul>
</section>
</div>
<div class="slide normal">
<header>
<h1>Animation Essentials</h1>
</header>
<section class="content">
<ul class="imp">
<li>@keyframes</li>
<li>animation-name</li>
<li>animation-duration</li>
<li>animation-timing-function</li>
<li>animation-iteration-count</li>
<li>animation-direction</li>
<li>animation-play-state</li>
<li>animation-delay</li>
<li>animation-fill-mode</li>
<li>animation (shorthand)</li>
</ul>
</section>
</div>
<div class="slide intro">
<header><h1>@Keyframes</h1></header>
<section class="content">
<pre contenteditable><b>@keyframes</b> ...
<b>@-webkit-keyframes</b> ....</pre>
</section>
</div>
<div class="slide">
<header><h1>Name your keyframe animation</h1></header>
<section class="content">
<pre contenteditable>@keyframes <b>clever_name_here</b> ...
@-webkit-keyframes <b>clever_name_here</b> ...</pre>
<ul>
<li>Identifier
<li>Unquoted
<li>Characters [a-zA-Z0-9], -, _ and ISO 10646 characters U+00A0 and higher
<li>ISO 10646 = Universal Character Set = Unicode standard
<li>[-_a-zA-Z0-9\u00A0-\u10FFFF]
<li>Can't start [0-9], -- , or hyphen+digit
<li>Can contain escaped: <br/>Q&A! may be written as Q\&A\! or Q\26 A\21
</ul>
<p>Don't use keyterms!</p>
</section>
</div>
<div class="slide object">
<header><h1>What's in a name?</h1></header>
<object data="files/name.html"></object>
<a href="files/name.html" target="play" class="objectlink">Try it out!</a>
</div>
<div class="slide">
<header><h1>at-rule</h1></header>
<section class="content">
<pre contenteditable>@keyframes slides <b>{</b>
<b>}</b>
@-webkit-keyframes slides <b>{</b>
<b>}</b></pre>
</section>
</div>
<div class="slide">
<header><h1>Keyframes</h1></header>
<section class="content">
<b class="pencil pencil_01">✎</b>
<pre contenteditable>@keyframes writing {
<b>from</b> {
<i>left: 0;</i>
}
<b>to</b> {
<i>left: 100%;</i>
}
}</pre>
</section>
</div>
<div class="slide">
<header><h1>Keyframes</h1></header>
<section class="content">
<b class="pencil pencil_01">✎</b>
<pre contenteditable>@keyframes writing {
<b>0%</b> {
left: 0;
}
<b>100%</b> {
left: 100%;
}
}</pre>
<p>Don't forget the <b class="imp" style="border-bottom:double 3px;">%</b></p>
<p>Don't quote the animation name</p>
</section>
</div>
<div class="slide object">
<header><h1>0% and 100%</h1></header>
<object data="files/no0or100.html"></object>
<a href="files/no0or100.html" target="play" class="objectlink">Try it out!</a>
</div>
<!-- writing while tired -->
<div class="slide">
<header>
<h1>Granular animation control</h1>
</header>
<section class="content">
<b class="pencil pencil_03">✎</b>
<pre contenteditable>@keyframes writingWhileTired {
<b>0%</b> {
left: 0;
}
<b>10%</b> {
left: 45%;
}
<b>90%</b> {
left: 55%;
}
<b>100%</b> {
left: 100%;
}
}
</pre>
</section>
</div>
<div class="slide object">
<header><h1>!important it isn't</h1></header>
<object data="files/important.html"></object>
<a href="files/important.html" target="play" class="objectlink">Try it out!</a>
</div>
<!-- making a W -->
<div class="slide">
<header>
<h1>Animating multiple properties</h1>
</header>
<section class="content">
<b class="pencil pencil_04">✎</b>
<pre contenteditable>@keyframes <b>W</b> {
0% {
<b>left:</b> 0;
<b>top:</b> 0;
}
25%, 75% {
<b>top:</b> 400px;
}
50% {
<b>top:</b> 50px;
}
100% {
<b>left:</b> 80%;
<b>top:</b> 0;
}
}</pre>
</section>
</div>
<div class="slide object">
<header><h1>Duplicated Keyframes?</h1></header>
<object data="files/repeated_keyframe.html"></object>
<a href="files/repeated_keyframe.html" target="play" class="objectlink">Try it out!</a>
</div>
<!-- 3d transofmr
<div class="slide" id="acsst">
<header>
<h1>Animating CSS Transforms</h1>
</header>
<section class="content">
<b class="pencil pencil_05">✎</b>
<pre contenteditable>@<u></u>keyframes gettingThePencil {
0%{
<u></u>transform:
translate3d(0, 0, 0)
rotate(0deg)
scale(0.5, 0.5);
}
100% {
<u></u>transform:
translate3d(600px, 400px, 0)
rotate(80deg)
scale(1.2, 1.2);
}
}
</pre>
<p style="text-align:center"><span onClick="vendorPrefix('w', 'acsst')">-webkit-</span> | <span onClick="vendorPrefix('r', 'acsst')"> reset </p>
</section>
</div>
<!-- HEADING SLIDE -->
<div class="slide intro">
<header style="margin-top: 25%; box-shadow: -1px -1px 1px rgba(0,0,0,0.2), 1px 1px 1px rgba(0,0,0,0.2)"><h1>But nothing is <br>
animated yet!</h1></header>
</div>
<!-- base CSS -->
<div class="slide normal">
<header><h1>Base CSS</h1></header>
<section class="content"><div class="pencilanim pencil" style="position: absolute;"></div>
<pre contenteditable style="line-height: 1.1"><b> .pencil {
width:100px;
text-align: right;
border-bottom: 10px solid;
}
.pencil::after {
content: '✎';
position: absolute;
bottom: -20px;
right: -10px;
}
</b></pre>
<pre contenteditable>@keyframes drawALine {
0%{
width:0;
color:green;
}
100% {
width: 100%;
color:blue;
}
}</pre>
</section>
</div>
<!-- Name and duration -->
<div class="slide" id="animdur">
<header>
<h1>animation name and duration</h1>
</header>
<section class="content"><div id="animationduration" class="pencil pencilanim"></div>
<pre contenteditable>.pencil { <input type="range" value="3" min="1" max="15" step="1" id="speedrange"/>
<b><u></u>animation-name: drawALine;
<u></u>animation-duration: <span class="changer">3</span>s;</b>
}</pre>
</section>
<script defer>
function changeDuration(){
var speed = document.getElementById('speedrange').value;
var el = document.getElementById('animationduration');
el.style.animation = 'drawALine ' + speed + 's';
var seconds = document.querySelectorAll("#animdur span.changer");
for(var i = 0, j = seconds.length; i < j; i++){
seconds[i].innerHTML = speed;
}
}
document.getElementById('speedrange').addEventListener('change', function() {
changeDuration();
setTimeout(function(){
document.getElementById('animationduration').setAttribute('style', '');
},
document.getElementById('speedrange').value*1000);
});
</script>
</div>
<div class="slide object">
<header><h1>Order of Precedence</h1></header>
<object data="files/specificity2.html"></object>
<a href="files/specificity2.html" target="play" class="objectlink">Try it out!</a>
</div>
<div class="slide object">
<header><h1>Specificity</h1></header>
<object data="files/specificity.html"></object>
<a href="files/specificity.html" target="play" class="objectlink">Try it out!</a>
</div>
<div class="slide object">
<header><h1>!important it isn't</h1></header>
<object data="files/important.html"></object>
<a href="files/important.html" target="play" class="objectlink">Try it out!</a>
</div>
<!-- timing function -->
<div class="slide" id="animtf">
<header style="position:absolute; width: 100%;">
<h1>‘animation-timing-function’</h1>
</header>
<section class="content">
<b id="animationtimingfunc" class="pencil pencilanim"></b>
<pre contenteditable>.pencil {
<u></u>animation-name: drawALine;
<u></u>animation-duration: 5s;
<b><u></u>animation-timing-function: <span class="changer">ease-in-out</span>;</b>
}</pre><select id="tfselect">
<option value="linear">linear</option>
<option value="ease">ease</option>
<option value="ease-in">ease-in</option>
<option value="ease-out">ease-out</option>
<option value="ease-in-out" selected>ease-in-out</option>
<option value="step-start">step-start</option>
<option value="step-end">step-end</option>
<option value="steps(5, start)">steps(5, start)</option>
<option value="steps(5, end)">steps(5, end)</option>
</select>
<pre contenteditable><strong>ease</strong> linear
ease-in ease-out
ease-in-out cubic-bezier(x1, y1, x2, y2)
step-start <span class="notes">/* same as steps(1, start) */</span>
step-end <span class="notes">/* same as steps(1, end) */</span>
steps( X, start|<strong>end</strong>) <span class="notes">/* X = # of steps + when change of value occurs */</span>
</pre>
</section>
<script defer>
function changeTimingFunction(event){
var speed = event.target.value;
console.log(speed)
var seconds = document.querySelectorAll("#animtf span.changer");
for(var i = 0, j = seconds.length; i < j; i++){
seconds[i].innerHTML = speed;
}
var el = document.getElementById('animationtimingfunc');
el.style.animation = 'drawALine 5s ' + speed;
}
document.getElementById('tfselect').addEventListener('change', function(e) {
changeTimingFunction(e);
setTimeout(function(){
document.getElementById('animationtimingfunc').setAttribute('style', '');
},
6000);
});
</script>
</div>
<div class="slide object">
<header><h1>Cubic Bezier</h1></header>
<object data="files/cubicbezier.html"></object>
<a href="files/cubicbezier.html" target="play" class="objectlink">Try it out!</a>
</div>
<div class="slide object">
<header><h1>Cubic Bezier</h1></header>
<object data="files/cubicbezierprint.html"></object>
<a href="files/cubicbezierprint.html" target="play" class="objectlink">Try it out!</a>
</div>
<div class="slide object">
<header><h1>Steps()</h1></header>
<object data="files/steps.html"></object>
<a href="files/steps.html" target="play" class="objectlink">Try it out!</a>
</div>
<div class="slide object">
<header><h1>Steps()</h1></header>
<object data="files/file_steps.html"></object>
<a href="files/file_steps.html" target="play" class="objectlink">Try it out!</a>
</div>
<div class="slide">
<header><h1>steps(4, end)</h1></header>
<section class="content">
<ul class="stepsexplain">
<li><div></div>0% </li>
<li><div></div>25% </li>
<li><div></div>50% </li>
<li><div></div>75% </li>
<li><div></div>100% </li>
</ul>
</section>
</div>
<div class="slide object">
<header><h1>Steps(4, end)</h1></header>
<object data="files/bike.html"></object>
<a href="files/bike.html" target="play" class="objectlink">Try it out!</a>
</div>
<!-- count -->
<div class="slide" id="animic">
<header style="position:absolute; width: 100%;">
<h1>‘animation-iteration-count’</h1>
</header>
<section class="content">
<div class="pencil pencilanim pencilanim_01"></div>
<pre contenteditable>
.pencil {
...
<u></u>animation-name: drawALine;
<u></u>animation-duration: 3s;
<u></u>animation-timing-function: ease-in-out;
<b><u></u>animation-iteration-count: 3;</b>
}</pre>
<p>‘infinite’ or number. Default is ‘1’.</p>
<pre contenteditable><b>-webkit-animation-iteration-count: 3;</b></pre>
</section>
</div>
<div class="slide object">
<header><h1>Partial Iteration?</h1></header>
<object data="files/odditeration.html"></object>
<a href="files/odditeration.html" target="play" class="objectlink">Try it out!</a>
</div>
<div class="slide object">
<header><h1>No Iteration?</h1></header>
<object data="files/nointerations.html"></object>
<a href="files/nointerations.html" target="play" class="objectlink">Try it out!</a>
</div>
<!-- animation delay -->
<div class="slide" id="animdelay">
<header style="position:absolute; width:100%;">
<h1>‘animation-delay’</h1>
</header>
<section class="content"> <b id="animationdelayi" class="pencil pencilanim"></b>
<pre contenteditable>.pencil { <input type="range" value="2" min="-10" max="10" step="0.5" id="delayrange" onChange="changeTime()" /><input type="button" onClick="changeDelay();" value="Start">
<u></u>animation-name: drawALine;
<u></u>animation-duration: 8s;
<u></u>animation-timing-function: ease-in-out;
<u></u>animation-iteration-count: 2;
<b><u></u>animation-delay: <span class="changer">2</span>s;</b>
}</pre>
</section><script defer>
function changeTime(){
var speed = (document.getElementById('delayrange').value * 1).toFixed(1);
var seconds = document.querySelectorAll("#animdelay span.changer");
for(var i = 0, j = seconds.length; i < j; i++){
seconds[i].innerHTML = speed;
var el = document.getElementById('animationdelayi');
el.setAttribute('style', '');
}
}
function changeDelay(){
var speed = (document.getElementById('delayrange').value * 1).toFixed(1);
var el = document.getElementById('animationdelayi');
el.style.animation = "drawALine 8s ease-in-out " + speed + 's 2';
var seconds = document.querySelectorAll("#animdelay span.changer");
for(var i = 0, j = seconds.length; i < j; i++){
seconds[i].innerHTML = speed;
}
}
</script>
</div>
<!-- animation direction -->
<div class="slide" id="animdir"> <i></i>
<header>
<h1>‘animation-direction’</h1>
</header>
<section class="content">
<b id="animationdir" class="pencil pencilanim"></b>
<pre contenteditable>.pencil {
...
<u></u>animation-name: drawALine;
<u></u>animation-duration: 5s;
<u></u>animation-timing-function: ease-in-out;
<u></u>animation-iteration-count: 5;
<b><u></u>animation-direction: <span id="dir_direction" class="linky">normal</span></b>
}</pre>
<p>values: <span data-dir="normal" class="directionChanger">normal</span> | <span class="directionChanger" data-dir="alternate">alternate</span> | <span class="directionChanger" data-dir="reverse">reverse</span> | <span class="directionChanger" data-dir="alternate-reverse">alternate-reverse</span>;</p>
<pre contenteditable><b><u></u>animation-direction: <span class="linky directionChanger">alternate</span>;</b></pre>