| 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 .anim { | |
| 20 left: 50px; | |
| 21 width: 100px; | |
| 22 height: 100px; | |
| 23 background-color: lightsteelblue; | |
| 24 position: absolute; | |
| 25 } | |
| 26 | |
| 27 #a { | |
| 28 top: 0px | |
| 29 } | |
| 30 | |
| 31 #b { | |
| 32 top: 100px; | |
| 33 } | |
| 34 | |
| 35 #c { | |
| 36 top: 200px | |
| 37 } | |
| 38 | |
| 39 #d { | |
| 40 top: 300px; | |
| 41 } | |
| 42 | |
| 43 #e { | |
| 44 top: 400px; | |
| 45 } | |
| 46 | |
| 47 #f { | |
| 48 top: 500px; | |
| 49 } | |
| 50 | |
| 51 #g { | |
| 52 top: 600px; | |
| 53 left: 200px; | |
| 54 } | |
| 55 | |
| 56 #expectation { | |
| 57 position: absolute; | |
| 58 top: 0px; | |
| 59 left: 200px; | |
| 60 width: 100px; | |
| 61 height: 700px; | |
| 62 background: red; | |
| 63 } | |
| 64 </style> | |
| 65 | |
| 66 <div id=expectation></div> | |
| 67 | |
| 68 <div> | |
| 69 <div id="a" class="anim"></div> | |
| 70 <div id="b" class="anim"></div> | |
| 71 <div id="c" class="anim"></div> | |
| 72 <div id="d" class="anim"></div> | |
| 73 <div id="e" class="anim"></div> | |
| 74 <div id="f" class="anim"></div> | |
| 75 <div id="g" class="anim"></div> | |
| 76 </div> | |
| 77 | |
| 78 <div style="height: 750px"></div> | |
| 79 | |
| 80 <script src="../bootstrap.js"></script> | |
| 81 <script> | |
| 82 "use strict"; | |
| 83 | |
| 84 var dt = document.timeline; | |
| 85 | |
| 86 dt.play(new Animation(document.querySelector("#a"), | |
| 87 [{left: "100px"}, {left: "200px"}], {delay: 1 * 1000, duration: 1 * 1000, fi
ll: 'forwards'})); | |
| 88 dt.play(new Animation(document.querySelector("#b"), {left: "200px"}, | |
| 89 {delay: 1 * 1000, duration: 1 * 1000, fill: 'forwards'})); | |
| 90 dt.play(new Animation(document.querySelector("#c"), | |
| 91 [{left: "100px"}, {left: "200px"}], {duration: 2 * 1000, fill: 'forwards'}))
; | |
| 92 dt.play(new Animation(document.querySelector("#d"), {left: "200px"}, | |
| 93 {duration: 2 * 1000, fill: 'forwards'})); | |
| 94 dt.play(new Animation(document.querySelector("#e"), [ | |
| 95 {offset: 0, left: "100px"}, | |
| 96 {offset: 1, left: "200px"}, | |
| 97 ], {duration: 2 * 1000, fill: 'forwards'})); | |
| 98 dt.play(new Animation(document.querySelector("#f"), [ | |
| 99 {offset: 0, left: "200px"}, | |
| 100 {offset: 0.25, left: "100px"}, | |
| 101 {offset: 1, left: "200px"} | |
| 102 ], {duration: 2 * 1000, fill: 'forwards'})); | |
| 103 dt.play(new Animation(document.querySelector("#g"), new KeyframeEffect([ | |
| 104 {offset: 0.25, left: "200px"}, | |
| 105 {offset: 0.5, left: "100px"}, | |
| 106 {offset: 0.75, left: "200px"} | |
| 107 ], "add"), {duration: 2 * 1000, fill: 'forwards'})); | |
| 108 | |
| 109 </script> | |
| OLD | NEW |