| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <style type="text/css" media="screen"> | |
| .box { | |
| position: relative; | |
| margin: 10px; | |
| left: 0; | |
| width: 100px; | |
| height: 100px; | |
| background-color: blue; | |
| -webkit-animation-duration: 2s; | |
| -webkit-animation-timing-function: ease-in; | |
| } | |
| #box1 { | |
| -webkit-animation-name: move; | |
| } | |
| @-webkit-keyframes move { | |
| from { | |
| opacity: 0; | |
| left: 100px; | |
| } | |
| 25% { | |
| opacity: 0.25; | |
| } | |
| 50% { | |
| left: 200px; | |
| -webkit-animation-timing-function: linear; | |
| } | |
| to { | |
| left: 400px; | |
| } | |
| } | |
| #box2 { | |
| -webkit-animation-name: move2; | |
| } | |
| @-webkit-keyframes move2 { | |
| from { | |
| opacity: 0; | |
| -webkit-transform: translateX(100px); | |
| } | |
| 25% { | |
| opacity: 0.25; | |
| } | |
| 50% { | |
| -webkit-transform: translateX(200px); | |
| -webkit-animation-timing-function: linear; | |
| } | |
| to { | |
| -webkit-transform: translateX(400px); | |
| } | |
| } | |
| </style> | |
| <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script> | |
| <script type="text/javascript" charset="utf-8"> | |
| const expectedValues = [ | |
| // [animation-name, time, element-id, property, expected-value, tolerance] | |
| ["move", 0.5, "box1", "left", 132, 15], | |
| ["move2", 0.5, "box2", "webkitTransform.4", 132, 15], | |
| ["move", 1.5, "box1", "left", 300, 15], | |
| ["move2", 1.5, "box2", "webkitTransform.4", 300, 15], | |
| ]; | |
| runAnimationTest(expectedValues); | |
| </script> | |
| </head> | |
| <body> | |
| <div id="box1" class="box"></div> | |
| <div id="box2" class="box"></div> | |
| <div id="result"> | |
| </div> | |
| </body> | |
| </html> |