| OLD | NEW |
| (Empty) |
| 1 <!-- | |
| 2 Copyright 2012 Google Inc. All Rights Reserved. | |
| 3 | |
| 4 Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 you may not use this file except in compliance with the License. | |
| 6 You may obtain a copy of the License at | |
| 7 | |
| 8 http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | |
| 10 Unless required by applicable law or agreed to in writing, software | |
| 11 distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 See the License for the specific language governing permissions and | |
| 14 limitations under the License. | |
| 15 --> | |
| 16 | |
| 17 <!DOCTYPE html><meta charset="UTF-8"> | |
| 18 <style> | |
| 19 .animContainer { | |
| 20 position: absolute; | |
| 21 left: 0px; | |
| 22 } | |
| 23 | |
| 24 .anim { | |
| 25 left: 0px; | |
| 26 width: 100px; | |
| 27 height: 25px; | |
| 28 background-color: #FAA; | |
| 29 position: relative; | |
| 30 } | |
| 31 | |
| 32 .expected { | |
| 33 height: 25px; | |
| 34 border-right: 1px solid black; | |
| 35 } | |
| 36 | |
| 37 #ca { | |
| 38 top: 50px; | |
| 39 width: 280px; | |
| 40 } | |
| 41 | |
| 42 #cb { | |
| 43 top: 150px; | |
| 44 width: 100px; | |
| 45 } | |
| 46 | |
| 47 #cc { | |
| 48 top: 250px; | |
| 49 width: 100px; | |
| 50 } | |
| 51 | |
| 52 #cd { | |
| 53 top: 350px; | |
| 54 width: 280px; | |
| 55 } | |
| 56 </style> | |
| 57 | |
| 58 <div>Boxes in each group should line up with each other at end of each | |
| 59 iteration (or start if reversed).</div> | |
| 60 <div>Right edge of each box should align with black line at end of test.</div> | |
| 61 | |
| 62 <div class="animContainer" id="ca"> | |
| 63 <div class="expected" style="width: 280px;"><div class="anim a" id="a"></div><
/div> | |
| 64 <div class="expected" style="width: 280px;"><div class="anim b" id="b"></div><
/div> | |
| 65 <div class="expected" style="width: 280px;"><div class="anim c" id="c"></div><
/div> | |
| 66 </div> | |
| 67 | |
| 68 <div class="animContainer" id="cb"> | |
| 69 <div class="expected" style="width: 200px;"><div class="anim a" id="d"></div><
/div> | |
| 70 <div class="expected" style="width: 200px;"><div class="anim b" id="e"></div><
/div> | |
| 71 <div class="expected" style="width: 280px;"><div class="anim c" id="f"></div><
/div> | |
| 72 </div> | |
| 73 | |
| 74 <div class="animContainer" id="cc"> | |
| 75 <div class="expected" style="width: 200px;"><div class="anim a" id="g"></div><
/div> | |
| 76 <div class="expected" style="width: 200px;"><div class="anim b" id="h"></div><
/div> | |
| 77 <div class="expected" style="width: 280px;"><div class="anim c" id="i"></div><
/div> | |
| 78 </div> | |
| 79 | |
| 80 <div class="animContainer" id="cd"> | |
| 81 <div class="expected" style="width: 280px;"><div class="anim a" id="j"></div><
/div> | |
| 82 <div class="expected" style="width: 280px;"><div class="anim b" id="k"></div><
/div> | |
| 83 <div class="expected" style="width: 280px;"><div class="anim c" id="l"></div><
/div> | |
| 84 </div> | |
| 85 | |
| 86 <div style="height: 400px;"></div> | |
| 87 | |
| 88 <script src="../bootstrap.js"></script> | |
| 89 <script> | |
| 90 "use strict"; | |
| 91 | |
| 92 var containers = ["ca", "cb", "cc", "cd"]; | |
| 93 | |
| 94 var directions = ["normal", "reverse", "alternate", "alternate-reverse"]; | |
| 95 | |
| 96 for (var i = 0; i < directions.length; i++) { | |
| 97 var dir = directions[i]; | |
| 98 var container = document.getElementById(containers[i]); | |
| 99 | |
| 100 document.timeline.play( | |
| 101 new AnimationGroup([ | |
| 102 // Test basic use. | |
| 103 new Animation(container.getElementsByClassName("a")[0], | |
| 104 [{left: "100px"}, {left: "300px"}], | |
| 105 {duration: 1 * 1000, iterations: 3.4, fill: 'forwards'}), | |
| 106 // Test integer iterations. | |
| 107 new Animation(container.getElementsByClassName("b")[0], | |
| 108 [{left: "100px"}, {left: "180px"}], | |
| 109 {duration: 1 * 1000, iterations: 3.0, fill: 'forwards'}), | |
| 110 // Test zero iterations. | |
| 111 new Animation(container.getElementsByClassName("c")[0], | |
| 112 [{left: "180px"}, {left: "300px"}], | |
| 113 {duration: 1 * 1000, iterations: 0.0, fill: 'forwards'}), | |
| 114 ], {iterations: 2, direction: dir, duration: 4 * 1000, fill: 'forwards
'})); | |
| 115 } | |
| 116 </script> | |
| OLD | NEW |