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