OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <meta name="viewport" content="width=device-width, user-scalable=no"> |
| 3 <script src="resources/web-animations-api-check.js"></script> |
| 4 <container id="container"></container> |
| 5 <script> |
| 6 var N = 1000; |
| 7 var duration = 1000; |
| 8 var targets = []; |
| 9 |
| 10 function startAnimation(element) { |
| 11 element.animate([ |
| 12 {opacity: 0}, |
| 13 {opacity: 1}, |
| 14 ], duration); |
| 15 } |
| 16 |
| 17 function startAllAnimations() { |
| 18 for (var i in targets) |
| 19 startAnimation(targets[i]); |
| 20 setTimeout(startAllAnimations, duration); |
| 21 } |
| 22 |
| 23 for (var i = 0; i < N; i++) { |
| 24 var target = document.createElement('target'); |
| 25 container.appendChild(target); |
| 26 targets.push(target); |
| 27 } |
| 28 |
| 29 startAllAnimations(); |
| 30 |
| 31 requestAnimationFrame(function() { |
| 32 window.measurementReady = true; |
| 33 }); |
| 34 </script> |
| 35 |
| 36 <style> |
| 37 target { |
| 38 display: inline-block; |
| 39 width: 9px; height: 9px; |
| 40 background: orange; |
| 41 } |
| 42 body { |
| 43 margin: 0; |
| 44 overflow: hidden; |
| 45 } |
| 46 container { |
| 47 display: flex; |
| 48 flex-flow: row wrap; |
| 49 width: 550px; |
| 50 height: 800px; |
| 51 background: magenta; |
| 52 } |
| 53 </style> |
OLD | NEW |