/
test-iterations-basic.html
106 lines (86 loc) · 2.59 KB
/
test-iterations-basic.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
<!--
Copyright 2012 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<style>
.animContainer {
position: absolute;
left: 0px;
height: 75px;
border-right: 1px solid black;
}
.anim {
left: 0px;
width: 100px;
height: 25px;
background-color: #FAA;
position: relative;
}
#ca {
top: 50px;
width: 280px;
}
#cb {
top: 150px;
width: 100px;
}
#cc {
top: 250px;
width: 100px;
}
#cd {
top: 350px;
width: 280px;
}
</style>
<div>Boxes in each group should line up with each other at end of each iteration (or start if reversed).</div>
<div>Right edge of each box should align with black line at end of test.</div>
<div class="animContainer" id="ca">
<div class="anim a"></div>
<div class="anim b"></div>
<div class="anim c"></div>
</div>
<div class="animContainer" id="cb">
<div class="anim a"></div>
<div class="anim b"></div>
<div class="anim c"></div>
</div>
<div class="animContainer" id="cc">
<div class="anim a"></div>
<div class="anim b"></div>
<div class="anim c"></div>
</div>
<div class="animContainer" id="cd">
<div class="anim a"></div>
<div class="anim b"></div>
<div class="anim c"></div>
</div>
<script src="web-animation.js"></script>
<script>
var containers = ["ca", "cb", "cc", "cd"];
var directions = ["normal", "reverse", "alternate", "alternate-reverse"];
var groups = [];
for (var i = 0; i < directions.length; i++) {
var dir = directions[i];
var group = new ParAnimGroup([], {iterationCount: 2, direction: dir, duration: 4}, undefined, 1);
groups.push(group);
}
for (var i = 0; i < containers.length; i++) {
var container = document.getElementById(containers[i]);
<!-- Test basic use. -->
new Anim(container.getElementsByClassName("a")[0], {left: ["100px", "300px"]}, {duration: 1, iterationCount: 3.4}, groups[i]);
<!-- Test integer iterationCount. -->
new Anim(container.getElementsByClassName("b")[0], {left: ["100px", "180px"]}, {duration: 1, iterationCount: 3.0}, groups[i]);
<!-- Test zero iterationCount. -->
new Anim(container.getElementsByClassName("c")[0], {left: ["180px", "300px"]}, {duration: 1, iterationCount: 0.0}, groups[i]);
}
</script>