/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
- <!--
- Copyright 2012 Google Inc. All Rights Reserved.
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- -->
- <!DOCTYPE html>
- <style>
- td.anim {
- height: 200px;
- width: 200px;
- }
- </style>
- <table>
- <tr><td id="a" class="anim"></td><td id="b" class="anim"></td><td id="c" class="anim"></td></tr>
- <tr><td id="d" class="anim"></td><td id="e" class="anim"></td><td id="f" class="anim"></td></tr>
- <tr><td id="g" class="anim"></td><td id="h" class="anim"></td><td id="i" class="anim"></td></tr>
- </table>
- <script src="../bootstrap.js"></script>
- <script>
- "use strict";
- var colors = [
- 'aliceblue',
- 'antiquewhite',
- 'aqua',
- 'aquamarine',
- 'azure',
- 'beige',
- 'bisque',
- 'black',
- 'blanchedalmond',
- 'blue',
- 'blueviolet',
- 'brown',
- 'burlywood',
- 'cadetblue',
- 'chartreuse',
- 'chocolate',
- 'coral',
- 'cornflowerblue',
- 'cornsilk',
- 'crimson',
- 'cyan',
- 'darkblue',
- 'darkcyan',
- 'darkgoldenrod',
- 'darkgray',
- 'darkgreen',
- 'darkgrey',
- 'darkkhaki',
- 'darkmagenta',
- 'darkolivegreen',
- 'darkorange',
- 'darkorchid',
- 'darkred',
- 'darksalmon',
- 'darkseagreen',
- 'darkslateblue',
- 'darkslategray',
- 'darkslategrey',
- 'darkturquoise',
- 'darkviolet',
- 'deeppink',
- 'deepskyblue',
- 'dimgray',
- 'dimgrey',
- 'dodgerblue',
- 'firebrick',
- 'floralwhite',
- 'forestgreen',
- 'fuchsia',
- 'gainsboro',
- 'ghostwhite',
- 'gold',
- 'goldenrod',
- 'gray',
- 'green',
- 'greenyellow',
- 'grey',
- 'honeydew',
- 'hotpink',
- 'indianred',
- 'indigo',
- 'ivory',
- 'khaki',
- 'lavender',
- 'lavenderblush',
- 'lawngreen',
- 'lemonchiffon',
- 'lightblue',
- 'lightcoral',
- 'lightcyan',
- 'lightgoldenrodyellow',
- 'lightgray',
- 'lightgreen',
- 'lightgrey',
- 'lightpink',
- 'lightsalmon',
- 'lightseagreen',
- 'lightskyblue',
- 'lightslategray',
- 'lightslategrey',
- 'lightsteelblue',
- 'lightyellow',
- 'lime',
- 'limegreen',
- 'linen',
- 'magenta',
- 'maroon',
- 'mediumaquamarine',
- 'mediumblue',
- 'mediumorchid',
- 'mediumpurple',
- 'mediumseagreen',
- 'mediumslateblue',
- 'mediumspringgreen',
- 'mediumturquoise',
- 'mediumvioletred',
- 'midnightblue',
- 'mintcream',
- 'mistyrose',
- 'moccasin',
- 'navajowhite',
- 'navy',
- 'oldlace',
- 'olive',
- 'olivedrab',
- 'orange',
- 'orangered',
- 'orchid',
- 'palegoldenrod',
- 'palegreen',
- 'paleturquoise',
- 'palevioletred',
- 'papayawhip',
- 'peachpuff',
- 'peru',
- 'pink',
- 'plum',
- 'powderblue',
- 'purple',
- 'red',
- 'rosybrown',
- 'royalblue',
- 'saddlebrown',
- 'salmon',
- 'sandybrown',
- 'seagreen',
- 'seashell',
- 'sienna',
- 'silver',
- 'skyblue',
- 'slateblue',
- 'slategray',
- 'slategrey',
- 'snow',
- 'springgreen',
- 'steelblue',
- 'tan',
- 'teal',
- 'thistle',
- 'tomato',
- 'turquoise',
- 'violet',
- 'wheat',
- 'white',
- 'whitesmoke',
- 'yellow',
- 'yellowgreen'];
- var divs = document.querySelectorAll('td.anim');
- var sliceSize = colors.length / 9;
- for (var i = 0; i < divs.length; i++) {
- var colorsToAnimate = colors.slice(i * sliceSize, (i + 1) * sliceSize);
- var effect = colorsToAnimate.map(function(value) {
- return { backgroundColor: value };
- });
- document.timeline.play(new Animation(divs[i], effect, 4));
- }
- //document.timeline.play(new Animation(document.body,
- // {'backgroundColor': colors}, colors.length * 2 / 60));
- </script>