|
1 | 1 | <!DOCTYPE html>
|
2 | 2 | <head>
|
3 |
| - <title>Country Flag Icons</title> |
4 |
| - <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
5 |
| - <meta charset="utf-8"> |
6 |
| - <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
7 |
| - <script src="../../webcomponentsjs/webcomponents.min.js"></script> |
8 |
| - <link rel="import" href="../flag-icon.html"> |
9 |
| - <link rel="import" href="json-stringify.html"> |
10 |
| - <link rel="import" href="index-links.html"> |
11 |
| - <style> |
12 |
| - pre { |
13 |
| - display: inline; |
14 |
| - margin: 0; |
15 |
| - } |
16 |
| - </style> |
| 3 | + <title>Country Flag Icons</title> |
| 4 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 5 | + <meta charset="utf-8"> |
| 6 | + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| 7 | + <script src="../../webcomponentsjs/webcomponents.min.js"></script> |
| 8 | + <link rel="import" href="../flag-icon.html"> |
| 9 | + <link rel="import" href="json-stringify.html"> |
| 10 | + <link rel="import" href="index-links.html"> |
| 11 | + <style> |
| 12 | + pre { |
| 13 | + display: inline; |
| 14 | + margin: 0; |
| 15 | + } |
| 16 | + </style> |
17 | 17 | </head>
|
18 | 18 | <body unresolved>
|
19 |
| - <index-links page="index.html"></index-links> |
| 19 | + <index-links page="index.html"></index-links> |
20 | 20 |
|
21 |
| - <h1><flag-icon> Demos</h1> |
| 21 | + <h1><flag-icon> Demos</h1> |
22 | 22 |
|
23 |
| - <template id="test" bind> |
24 |
| - <div style="border:1px solid #DFE8F6;background-color:#EEEEF0;display:inline-block;padding:10px;"> |
25 |
| - <div style="border:1px solid #99BBE8;background-color:#DFE8F6;padding:15px;display:inline-block;vertical-align:top"> |
26 |
| - <table style="display:inline"> |
27 |
| - <tr> |
28 |
| - <th colspan="2"> |
29 |
| - Try and Find a Flag |
30 |
| - </th> |
31 |
| - </tr> |
32 |
| - <tr> |
33 |
| - <td colspan="2" style="padding-bottom:1em"> |
34 |
| - <input type="text" value="{{key}}" style="font-size:larger"> |
35 |
| - </td> |
36 |
| - </tr> |
37 |
| - <tr> |
38 |
| - <td style="vertical-align:top;"><h4 style="margin-top:0">Flag Set:</h4></td> |
39 |
| - <td> |
40 |
| - <input type="radio" name="flagtype" value="country" onchange="classbind(this,'Canada')" checked id="country"><label for="country">Country</label><br> |
41 |
| - <input type="radio" name="flagtype" value="au" onchange="classbind(this,'New South Wales')" id="au"><label for="au">Australian State</label><br> |
42 |
| - <input type="radio" name="flagtype" value="br" onchange="classbind(this,'Rio de Janeiro')" id="br"><label for="br">Brazilian State</label><br> |
43 |
| - <input type="radio" name="flagtype" value="ca" onchange="classbind(this,'Nunavut')" id="ca"><label for="ca">Canadian Province</label><br> |
44 |
| - <input type="radio" name="flagtype" value="de" onchange="classbind(this,'Berlin')" id="de"><label for="de">German State</label><br> |
45 |
| - <input type="radio" name="flagtype" value="es" onchange="classbind(this,'Andaluc\u00EDa')" id="es"><label for="es">Spanish Autonomy</label><br> |
46 |
| - <input type="radio" name="flagtype" value="ru" onchange="classbind(this,'Leningrad')" id="ru"><label for="ru">Russian Region</label><br> |
47 |
| - <input type="radio" name="flagtype" value="us" onchange="classbind(this,'California')" id="us"><label for="us">US State</label><br> |
48 |
| - <input type="radio" name="flagtype" value="maritime" onchange="classbind(this,'alpha')" id="maritime"><label for="maritime">Maritime / ICS</label><br> |
49 |
| - <input type="radio" name="flagtype" value="racing" onchange="classbind(this,'yellow')" id="racing"><label for="racing">NASCAR and IndyCar</label><br> |
50 |
| - </td> |
51 |
| - </tr> |
52 |
| - <tr> |
53 |
| - <td><h4 style="margin-top:5px;margin-bottom:5px;">Render:</h4></td> |
54 |
| - <td> |
55 |
| - <input type="radio" name="render" value="svg" onchange="model.img = false" checked id="svg"><label for="svg">SVG</label> |
56 |
| - <input type="radio" name="render" value="png" onchange="model.img = true" id="png"><label for="png">PNG</label> |
57 |
| - </td> |
58 |
| - </tr> |
59 |
| - <tr> |
60 |
| - <td><h4 style="margin-top:5px;margin-bottom:5px;">Aspect:</h4></td> |
61 |
| - <td> |
62 |
| - <input type="radio" name="aspect" value="auto" onchange="model.square = false" checked id="squarefalse"><label for="squarefalse">Auto</label> |
63 |
| - <input type="radio" name="aspect" value="square" onchange="model.square = true" id="squaretrue"><label for="squaretrue">Square</label> |
64 |
| - </td> |
65 |
| - </tr> |
66 |
| - </table> |
67 |
| - </div> |
68 |
| - <div style="padding: 0 15px 0 25px;display:inline-block;"> |
69 |
| - <flag-icon key="{{key}}" width="150" img="{{img}}" data="{{data}}" aspect="{{aspect}}" square="{{square}}" |
70 |
| - au="{{au}}" br="{{br}}" ca="{{ca}}" de="{{de}}" es="{{es}}" ru="{{ru}}" us="{{us}}" maritime="{{maritime}}" racing="{{racing}}" |
71 |
| - style="margin-left:30px;"></flag-icon> |
72 |
| - <br> |
73 |
| - <json-stringify data="{{data}}"></json-stringify> |
74 |
| - </div> |
75 |
| - </div> |
76 |
| - </template> |
| 23 | + <template id="test" bind> |
| 24 | + <div style="border:1px solid #DFE8F6;background-color:#EEEEF0;display:inline-block;padding:10px;"> |
| 25 | + <div style="border:1px solid #99BBE8;background-color:#DFE8F6;padding:15px;display:inline-block;vertical-align:top"> |
| 26 | + <table style="display:inline"> |
| 27 | + <tr> |
| 28 | + <th colspan="2"> |
| 29 | + Try and Find a Flag |
| 30 | + </th> |
| 31 | + </tr> |
| 32 | + <tr> |
| 33 | + <td colspan="2" style="padding-bottom:1em"> |
| 34 | + <input type="text" value="{{key}}" style="font-size:larger"> |
| 35 | + </td> |
| 36 | + </tr> |
| 37 | + <tr> |
| 38 | + <td style="vertical-align:top;"><h4 style="margin-top:0">Flag Set:</h4></td> |
| 39 | + <td> |
| 40 | + <input type="radio" name="flagtype" value="country" onchange="classbind(this,'Canada')" checked id="country"><label for="country">Country</label><br> |
| 41 | + <input type="radio" name="flagtype" value="au" onchange="classbind(this,'New South Wales')" id="au"><label for="au">Australian State</label><br> |
| 42 | + <input type="radio" name="flagtype" value="br" onchange="classbind(this,'Rio de Janeiro')" id="br"><label for="br">Brazilian State</label><br> |
| 43 | + <input type="radio" name="flagtype" value="ca" onchange="classbind(this,'Nunavut')" id="ca"><label for="ca">Canadian Province</label><br> |
| 44 | + <input type="radio" name="flagtype" value="de" onchange="classbind(this,'Berlin')" id="de"><label for="de">German State</label><br> |
| 45 | + <input type="radio" name="flagtype" value="es" onchange="classbind(this,'Andaluc\u00EDa')" id="es"><label for="es">Spanish Autonomy</label><br> |
| 46 | + <input type="radio" name="flagtype" value="ru" onchange="classbind(this,'Leningrad')" id="ru"><label for="ru">Russian Region</label><br> |
| 47 | + <input type="radio" name="flagtype" value="us" onchange="classbind(this,'California')" id="us"><label for="us">US State</label><br> |
| 48 | + <input type="radio" name="flagtype" value="maritime" onchange="classbind(this,'alpha')" id="maritime"><label for="maritime">Maritime / ICS</label><br> |
| 49 | + <input type="radio" name="flagtype" value="racing" onchange="classbind(this,'yellow')" id="racing"><label for="racing">NASCAR and IndyCar</label><br> |
| 50 | + </td> |
| 51 | + </tr> |
| 52 | + <tr> |
| 53 | + <td><h4 style="margin-top:5px;margin-bottom:5px;">Render:</h4></td> |
| 54 | + <td> |
| 55 | + <input type="radio" name="render" value="svg" onchange="model.img = false" checked id="svg"><label for="svg">SVG</label> |
| 56 | + <input type="radio" name="render" value="png" onchange="model.img = true" id="png"><label for="png">PNG</label> |
| 57 | + </td> |
| 58 | + </tr> |
| 59 | + <tr> |
| 60 | + <td><h4 style="margin-top:5px;margin-bottom:5px;">Aspect:</h4></td> |
| 61 | + <td> |
| 62 | + <input type="radio" name="aspect" value="auto" onchange="model.square = false" checked id="squarefalse"><label for="squarefalse">Auto</label> |
| 63 | + <input type="radio" name="aspect" value="square" onchange="model.square = true" id="squaretrue"><label for="squaretrue">Square</label> |
| 64 | + </td> |
| 65 | + </tr> |
| 66 | + </table> |
| 67 | + </div> |
| 68 | + <div style="padding: 0 15px 0 25px;display:inline-block;"> |
| 69 | + <flag-icon key="{{key}}" width="150" img="{{img}}" data="{{data}}" aspect="{{aspect}}" square="{{square}}" |
| 70 | + au="{{au}}" br="{{br}}" ca="{{ca}}" de="{{de}}" es="{{es}}" ru="{{ru}}" us="{{us}}" maritime="{{maritime}}" racing="{{racing}}" |
| 71 | + style="margin-left:30px;"></flag-icon> |
| 72 | + <br> |
| 73 | + <json-stringify data="{{data}}"></json-stringify> |
| 74 | + </div> |
| 75 | + </div> |
| 76 | + </template> |
77 | 77 |
|
78 |
| - <h2>Many input formats are allowed</h2> |
| 78 | + <h2>Many input formats are allowed</h2> |
79 | 79 |
|
80 |
| - <div style="margin-left:10px;"> |
81 |
| - <flag-icon key="Korea Republic"></flag-icon> <pre><flag-icon key="Korea Republic"></flag-icon></pre> |
82 |
| - <br> |
83 |
| - <flag-icon key="Republic of Korea"></flag-icon> <pre><flag-icon key="Republic of Korea"></flag-icon></pre> |
84 |
| - <br> |
85 |
| - <flag-icon key="Korea, Republic of"></flag-icon> <pre><flag-icon key="Korea, Republic of"></flag-icon></pre> |
86 |
| - <br> |
87 |
| - <flag-icon key="RePUBlic of KOREA"></flag-icon> <pre><flag-icon key="RePUBlic of KOREA"></flag-icon></pre> |
88 |
| - <br> |
89 |
| - <flag-icon key="KR"></flag-icon> <pre><flag-icon key="KR"></flag-icon></pre> |
90 |
| - <br> |
91 |
| - <flag-icon key="KOR"></flag-icon> <pre><flag-icon key="KOR"></flag-icon></pre> |
92 |
| - <br> |
93 |
| - <flag-icon key="410"></flag-icon> <pre><flag-icon key="410"></flag-icon></pre> |
94 |
| - <br> |
95 |
| - <flag-icon key="South Korea"></flag-icon> <pre><flag-icon key="South Korea"></flag-icon></pre> |
96 |
| - </div> |
| 80 | + <div style="margin-left:10px;"> |
| 81 | + <flag-icon key="Korea Republic"></flag-icon> <pre><flag-icon key="Korea Republic"></flag-icon></pre> |
| 82 | + <br> |
| 83 | + <flag-icon key="Republic of Korea"></flag-icon> <pre><flag-icon key="Republic of Korea"></flag-icon></pre> |
| 84 | + <br> |
| 85 | + <flag-icon key="Korea, Republic of"></flag-icon> <pre><flag-icon key="Korea, Republic of"></flag-icon></pre> |
| 86 | + <br> |
| 87 | + <flag-icon key="RePUBlic of KOREA"></flag-icon> <pre><flag-icon key="RePUBlic of KOREA"></flag-icon></pre> |
| 88 | + <br> |
| 89 | + <flag-icon key="KR"></flag-icon> <pre><flag-icon key="KR"></flag-icon></pre> |
| 90 | + <br> |
| 91 | + <flag-icon key="KOR"></flag-icon> <pre><flag-icon key="KOR"></flag-icon></pre> |
| 92 | + <br> |
| 93 | + <flag-icon key="410"></flag-icon> <pre><flag-icon key="410"></flag-icon></pre> |
| 94 | + <br> |
| 95 | + <flag-icon key="South Korea"></flag-icon> <pre><flag-icon key="South Korea"></flag-icon></pre> |
| 96 | + </div> |
97 | 97 |
|
98 |
| - <h3>Including Endonyms</h3> |
| 98 | + <h3>Including Endonyms</h3> |
99 | 99 |
|
100 |
| - <div style="margin-left:10px;"> |
101 |
| - <flag-icon key="Hanguk"></flag-icon> <pre><flag-icon key="Hanguk"></flag-icon></pre> |
102 |
| - <br> |
103 |
| - <flag-icon key="한국"></flag-icon> <pre><flag-icon key="한국"></flag-icon></pre> |
104 |
| - <br> |
105 |
| - <flag-icon key="韓國"></flag-icon> <pre><flag-icon key="韓國"></flag-icon></pre> |
106 |
| - <br> |
107 |
| - <flag-icon key="Nam-josŏn"></flag-icon> <pre><flag-icon key="Nam-josŏn"></flag-icon></pre> |
108 |
| - </div> |
| 100 | + <div style="margin-left:10px;"> |
| 101 | + <flag-icon key="Hanguk"></flag-icon> <pre><flag-icon key="Hanguk"></flag-icon></pre> |
| 102 | + <br> |
| 103 | + <flag-icon key="한국"></flag-icon> <pre><flag-icon key="한국"></flag-icon></pre> |
| 104 | + <br> |
| 105 | + <flag-icon key="韓國"></flag-icon> <pre><flag-icon key="韓國"></flag-icon></pre> |
| 106 | + <br> |
| 107 | + <flag-icon key="Nam-josŏn"></flag-icon> <pre><flag-icon key="Nam-josŏn"></flag-icon></pre> |
| 108 | + </div> |
109 | 109 |
|
110 |
| - <script> |
111 |
| - function classbind(t,text){ |
112 |
| - model.au = false; |
113 |
| - model.br = false; |
114 |
| - model.ca = false; |
115 |
| - model.de = false; |
116 |
| - model.es = false; |
117 |
| - model.ru = false; |
118 |
| - model.us = false; |
119 |
| - model.maritime = false; |
120 |
| - model.racing = false; |
121 |
| - switch(t.value){ |
122 |
| - case 'au': model.au = true; break; |
123 |
| - case 'br': model.br = true; break; |
124 |
| - case 'ca': model.ca = true; break; |
125 |
| - case 'de': model.de = true; break; |
126 |
| - case 'es': model.es = true; break; |
127 |
| - case 'ru': model.ru = true; break; |
128 |
| - case 'us': model.us = true; break; |
129 |
| - case 'maritime': model.maritime = true; break; |
130 |
| - case 'racing': model.racing = true; break; |
131 |
| - } |
132 |
| - model.key = text; |
133 |
| - var sf = document.getElementById('squarefalse'); |
134 |
| - sf.checked = true; |
135 |
| - sf.disabled = t.value !== 'country'; |
136 |
| - document.getElementById('squaretrue').disabled = t.value !== 'country'; |
137 |
| - } |
138 |
| - var model = { |
139 |
| - key: 'Canada', |
140 |
| - img: false, |
141 |
| - aspect: false, |
142 |
| - square: false |
143 |
| - }; |
144 |
| - window.addEventListener('polymer-ready', function(){ |
145 |
| - document.getElementById('test').model = model; |
146 |
| - }); |
147 |
| - </script> |
| 110 | + <script> |
| 111 | + function classbind(t,text){ |
| 112 | + model.au = false; |
| 113 | + model.br = false; |
| 114 | + model.ca = false; |
| 115 | + model.de = false; |
| 116 | + model.es = false; |
| 117 | + model.ru = false; |
| 118 | + model.us = false; |
| 119 | + model.maritime = false; |
| 120 | + model.racing = false; |
| 121 | + switch(t.value){ |
| 122 | + case 'au': model.au = true; break; |
| 123 | + case 'br': model.br = true; break; |
| 124 | + case 'ca': model.ca = true; break; |
| 125 | + case 'de': model.de = true; break; |
| 126 | + case 'es': model.es = true; break; |
| 127 | + case 'ru': model.ru = true; break; |
| 128 | + case 'us': model.us = true; break; |
| 129 | + case 'maritime': model.maritime = true; break; |
| 130 | + case 'racing': model.racing = true; break; |
| 131 | + } |
| 132 | + model.key = text; |
| 133 | + var sf = document.getElementById('squarefalse'); |
| 134 | + sf.checked = true; |
| 135 | + sf.disabled = t.value !== 'country'; |
| 136 | + document.getElementById('squaretrue').disabled = t.value !== 'country'; |
| 137 | + if(!sf.disabled) document.getElementById('squaretrue').checked = model.square; |
| 138 | + } |
| 139 | + var model = { |
| 140 | + key: 'Canada', |
| 141 | + img: false, |
| 142 | + aspect: false, |
| 143 | + square: false |
| 144 | + }; |
| 145 | + window.addEventListener('polymer-ready', function(){ |
| 146 | + document.getElementById('test').model = model; |
| 147 | + }); |
| 148 | + </script> |
148 | 149 | </body>
|
149 | 150 | </html>
|
0 commit comments