OLD | NEW |
---|---|
(Empty) | |
1 <html> | |
2 <style> | |
3 div { | |
4 position: relative; | |
5 height: 100px; | |
6 width: 100px; | |
7 background: blue; | |
8 } | |
9 </style> | |
10 <body> | |
11 <p> | |
12 Each section below has two boxes, the top runs on the main thread, the bottom | |
13 on the compositor. | |
14 </p><p> | |
15 This test is successful if the boxes are mostly in sync and all finish at the | |
16 same time. | |
17 </p> | |
18 <hr> | |
19 | |
20 Steps for easing timing function is set to 9 | |
21 <br> | |
22 <div id="test1a">MT</div> | |
23 <div id="test1b">CT</div> | |
24 <hr> | |
25 | |
26 Per-keyframe steps easing function | |
27 <br> | |
28 <div id="test2a">MT</div> | |
29 <div id="test2b">CT</div> | |
30 | |
31 <script> | |
32 var transformKeyframes = [ | |
dstockwell
2014/12/19 02:00:55
nit: no need to indent this script
loyso (OOO)
2014/12/19 02:50:23
Ok. That was inspired by compositor-animation-play
| |
33 {transform: 'translateX(0px)'}, | |
34 {transform: 'translateX(500px)'} | |
35 ]; | |
36 var leftKeyframes = [ | |
37 {left: '0'}, | |
38 {left: '500px'} | |
39 ]; | |
40 var player1a = test1a.animate(leftKeyframes, { | |
41 duration: 6000, | |
42 iterations: Infinity, | |
43 easing: 'steps(9)' | |
44 }); | |
45 var player1b = test1b.animate(transformKeyframes, { | |
46 duration: 6000, | |
47 iterations: Infinity, | |
48 easing: 'steps(9)' | |
49 }); | |
50 | |
51 var transformKeyframesEasing = [ | |
52 {transform: 'translateX(0px)', easing: 'steps(18)'}, | |
53 {transform: 'translateX(250px)', easing: 'steps(9)'}, | |
54 {transform: 'translateX(500px)'} | |
55 ]; | |
56 var leftKeyframesEasing = [ | |
57 {left: '0', easing: 'steps(18)'}, | |
58 {left: '250px', easing: 'steps(9)'}, | |
59 {left: '500px'} | |
60 ]; | |
61 var player2a = test2a.animate(leftKeyframesEasing, { | |
62 duration: 6000, | |
63 iterations: Infinity | |
64 }); | |
65 var player2b = test2b.animate(transformKeyframesEasing, { | |
66 duration: 6000, | |
67 iterations: Infinity | |
68 }); | |
69 </script> | |
70 </body> | |
71 </html> | |
OLD | NEW |