forked from web-animations/web-animations-js-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-compositor.html
More file actions
47 lines (40 loc) · 1.95 KB
/
test-compositor.html
File metadata and controls
47 lines (40 loc) · 1.95 KB
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
<!--
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>
.anim, .anim2 {
fill: lightsteelblue;
}
.expectation {
fill: red;
}
</style>
<svg>
<rect class="expectation" x="200px" y="10px" width="100px" height="100px"></rect>
<rect class="expectation" x="200px" y="20px" width="200px" height="200px"></rect>
<rect class="anim" x="100px" y="10px" width="100px" height="100px"></rect>
<rect class="anim2" x="100px" y="10px" width="100px" height="100px"></rect>
</svg>
<script src="web-animation.js"></script>
<script>
var rect = document.querySelector(".anim")
var rect2 = document.querySelector(".anim2")
new Animation(rect, {x: ["0px", "400px"]}, 3);
new Animation(rect, {x: ["0px", "200px"], operation: 'add'}, {startDelay: 1, duration: 4});
new Animation(rect, {x: ["0px", "200px"], operation: 'merge'}, {startDelay: 2, duration: 5});
new Animation(rect2, {"-webkit-transform": ["translate(0px, 0px)", "translate(200px, 200px)"]}, 3);
new Animation(rect2, {"-webkit-transform": ["rotate(0deg) translate(0px, 0px)",
"rotate(90deg) translate(100px, 0px)"], operation: 'add'}, {startDelay: 1, duration: 4});
new Animation(rect2, {"-webkit-transform": ["translate(0px, 0px) rotate(0deg) translate(0px, 0px) scale(1, 1)",
"translate(0px, 0px) rotate(0deg) translate(0px, 0px) scale(2, 2)"], operation: 'merge'}, {startDelay: 2, duration: 5});
</script>