Wed, 31 Dec 2014 13:27:57 +0100
Ignore runtime configuration files generated during quality assurance.
michael@0 | 1 | <!DOCTYPE> |
michael@0 | 2 | <head> |
michael@0 | 3 | <style> |
michael@0 | 4 | body { |
michael@0 | 5 | border: 0px; |
michael@0 | 6 | margin: 0px; |
michael@0 | 7 | padding: 0px; |
michael@0 | 8 | } |
michael@0 | 9 | table { |
michael@0 | 10 | border-spacing: 0px; |
michael@0 | 11 | } |
michael@0 | 12 | </style> |
michael@0 | 13 | </head> |
michael@0 | 14 | <body> |
michael@0 | 15 | <div> |
michael@0 | 16 | <table> |
michael@0 | 17 | <tr> |
michael@0 | 18 | <td id="ul"></td> |
michael@0 | 19 | <td id="ur"></td> |
michael@0 | 20 | </tr> |
michael@0 | 21 | <tr> |
michael@0 | 22 | <td id="ll"></td> |
michael@0 | 23 | <td id="lr"></td> |
michael@0 | 24 | </tr> |
michael@0 | 25 | </table> |
michael@0 | 26 | </div> |
michael@0 | 27 | |
michael@0 | 28 | <script> |
michael@0 | 29 | var orientation = location.search.substring(1).split("&"); |
michael@0 | 30 | var angle = parseInt(orientation[0]); |
michael@0 | 31 | var flip = orientation[1] == "flip" ? true : false; |
michael@0 | 32 | |
michael@0 | 33 | // Each id corresponds to a color. |
michael@0 | 34 | var ids = ["ul", "ur", "lr", "ll"]; |
michael@0 | 35 | var colors = [ |
michael@0 | 36 | "rgb(0, 191, 0)", |
michael@0 | 37 | "rgb(0, 255, 1)", |
michael@0 | 38 | "rgb(254, 0, 122)", |
michael@0 | 39 | "rgb(191, 0, 93)", |
michael@0 | 40 | ]; |
michael@0 | 41 | |
michael@0 | 42 | // 'Rotate' the colors according to the angle. |
michael@0 | 43 | colors.unshift.apply(colors, colors.splice((360 - angle) / 90, colors.length)); |
michael@0 | 44 | |
michael@0 | 45 | // 'Flip' the colors if requested. |
michael@0 | 46 | if (flip) { |
michael@0 | 47 | var tmp = colors[0]; |
michael@0 | 48 | colors[0] = colors[1]; |
michael@0 | 49 | colors[1] = tmp; |
michael@0 | 50 | tmp = colors[2]; |
michael@0 | 51 | colors[2] = colors[3]; |
michael@0 | 52 | colors[3] = tmp; |
michael@0 | 53 | } |
michael@0 | 54 | |
michael@0 | 55 | // Construct a style. |
michael@0 | 56 | var style = ""; |
michael@0 | 57 | |
michael@0 | 58 | if (angle == 90 || angle == 270) { |
michael@0 | 59 | style += "div { width: 200px; height: 100px; }\n"; |
michael@0 | 60 | style += "td { width: 100px; height: 50px; }\n"; |
michael@0 | 61 | } else { |
michael@0 | 62 | style += "div { width: 100px; height: 200px; }\n"; |
michael@0 | 63 | style += "td { width: 50px; height: 100px; }\n"; |
michael@0 | 64 | } |
michael@0 | 65 | |
michael@0 | 66 | for (var i = 0 ; i < 4 ; ++i) { |
michael@0 | 67 | style += "#" + ids[i] + " { background-color: " + colors[i] + "; }\n"; |
michael@0 | 68 | } |
michael@0 | 69 | |
michael@0 | 70 | // Apply the style to the document. |
michael@0 | 71 | var sheet = document.createElement('style'); |
michael@0 | 72 | sheet.innerHTML = style; |
michael@0 | 73 | document.body.appendChild(sheet); |
michael@0 | 74 | </script> |
michael@0 | 75 | </body> |