/polymer-globe/polymer/polymer-all/web-animations-js/test/testcases/test-color-names.html

https://github.com/sidhantp/webgl-globe · HTML · 196 lines · 175 code · 6 blank · 15 comment · 0 complexity · 9dae73b2c6f650bfe519ffc6da3625bc MD5 · raw file

  1. <!--
  2. Copyright 2012 Google Inc. All Rights Reserved.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. -->
  13. <!DOCTYPE html>
  14. <style>
  15. td.anim {
  16. height: 200px;
  17. width: 200px;
  18. }
  19. </style>
  20. <table>
  21. <tr><td id="a" class="anim"></td><td id="b" class="anim"></td><td id="c" class="anim"></td></tr>
  22. <tr><td id="d" class="anim"></td><td id="e" class="anim"></td><td id="f" class="anim"></td></tr>
  23. <tr><td id="g" class="anim"></td><td id="h" class="anim"></td><td id="i" class="anim"></td></tr>
  24. </table>
  25. <script src="../bootstrap.js"></script>
  26. <script>
  27. "use strict";
  28. var colors = [
  29. 'aliceblue',
  30. 'antiquewhite',
  31. 'aqua',
  32. 'aquamarine',
  33. 'azure',
  34. 'beige',
  35. 'bisque',
  36. 'black',
  37. 'blanchedalmond',
  38. 'blue',
  39. 'blueviolet',
  40. 'brown',
  41. 'burlywood',
  42. 'cadetblue',
  43. 'chartreuse',
  44. 'chocolate',
  45. 'coral',
  46. 'cornflowerblue',
  47. 'cornsilk',
  48. 'crimson',
  49. 'cyan',
  50. 'darkblue',
  51. 'darkcyan',
  52. 'darkgoldenrod',
  53. 'darkgray',
  54. 'darkgreen',
  55. 'darkgrey',
  56. 'darkkhaki',
  57. 'darkmagenta',
  58. 'darkolivegreen',
  59. 'darkorange',
  60. 'darkorchid',
  61. 'darkred',
  62. 'darksalmon',
  63. 'darkseagreen',
  64. 'darkslateblue',
  65. 'darkslategray',
  66. 'darkslategrey',
  67. 'darkturquoise',
  68. 'darkviolet',
  69. 'deeppink',
  70. 'deepskyblue',
  71. 'dimgray',
  72. 'dimgrey',
  73. 'dodgerblue',
  74. 'firebrick',
  75. 'floralwhite',
  76. 'forestgreen',
  77. 'fuchsia',
  78. 'gainsboro',
  79. 'ghostwhite',
  80. 'gold',
  81. 'goldenrod',
  82. 'gray',
  83. 'green',
  84. 'greenyellow',
  85. 'grey',
  86. 'honeydew',
  87. 'hotpink',
  88. 'indianred',
  89. 'indigo',
  90. 'ivory',
  91. 'khaki',
  92. 'lavender',
  93. 'lavenderblush',
  94. 'lawngreen',
  95. 'lemonchiffon',
  96. 'lightblue',
  97. 'lightcoral',
  98. 'lightcyan',
  99. 'lightgoldenrodyellow',
  100. 'lightgray',
  101. 'lightgreen',
  102. 'lightgrey',
  103. 'lightpink',
  104. 'lightsalmon',
  105. 'lightseagreen',
  106. 'lightskyblue',
  107. 'lightslategray',
  108. 'lightslategrey',
  109. 'lightsteelblue',
  110. 'lightyellow',
  111. 'lime',
  112. 'limegreen',
  113. 'linen',
  114. 'magenta',
  115. 'maroon',
  116. 'mediumaquamarine',
  117. 'mediumblue',
  118. 'mediumorchid',
  119. 'mediumpurple',
  120. 'mediumseagreen',
  121. 'mediumslateblue',
  122. 'mediumspringgreen',
  123. 'mediumturquoise',
  124. 'mediumvioletred',
  125. 'midnightblue',
  126. 'mintcream',
  127. 'mistyrose',
  128. 'moccasin',
  129. 'navajowhite',
  130. 'navy',
  131. 'oldlace',
  132. 'olive',
  133. 'olivedrab',
  134. 'orange',
  135. 'orangered',
  136. 'orchid',
  137. 'palegoldenrod',
  138. 'palegreen',
  139. 'paleturquoise',
  140. 'palevioletred',
  141. 'papayawhip',
  142. 'peachpuff',
  143. 'peru',
  144. 'pink',
  145. 'plum',
  146. 'powderblue',
  147. 'purple',
  148. 'red',
  149. 'rosybrown',
  150. 'royalblue',
  151. 'saddlebrown',
  152. 'salmon',
  153. 'sandybrown',
  154. 'seagreen',
  155. 'seashell',
  156. 'sienna',
  157. 'silver',
  158. 'skyblue',
  159. 'slateblue',
  160. 'slategray',
  161. 'slategrey',
  162. 'snow',
  163. 'springgreen',
  164. 'steelblue',
  165. 'tan',
  166. 'teal',
  167. 'thistle',
  168. 'tomato',
  169. 'turquoise',
  170. 'violet',
  171. 'wheat',
  172. 'white',
  173. 'whitesmoke',
  174. 'yellow',
  175. 'yellowgreen'];
  176. var divs = document.querySelectorAll('td.anim');
  177. var sliceSize = colors.length / 9;
  178. for (var i = 0; i < divs.length; i++) {
  179. var colorsToAnimate = colors.slice(i * sliceSize, (i + 1) * sliceSize);
  180. var effect = colorsToAnimate.map(function(value) {
  181. return { backgroundColor: value };
  182. });
  183. document.timeline.play(new Animation(divs[i], effect, 4));
  184. }
  185. //document.timeline.play(new Animation(document.body,
  186. // {'backgroundColor': colors}, colors.length * 2 / 60));
  187. </script>