OLD | NEW |
1 <app> | 1 <app> |
| 2 <import src="../resources/run-after-display.sky" /> |
2 <style> | 3 <style> |
3 * { box-sizing: border-box; } | 4 * { box-sizing: border-box; } |
4 | 5 |
5 t, span { | 6 t, span { |
6 display: inline; | 7 display: inline; |
7 } | 8 } |
8 | 9 |
9 app { | 10 app { |
10 display: flex; | 11 display: flex; |
11 flex-direction: column; | 12 flex-direction: column; |
12 height: 100%; | 13 min-height: 100%; |
13 background-color: #494949; | 14 background-color: #494949; |
14 font-family: sans-serif; | 15 font-family: "Helvetica", sans-serif; |
15 font-size: 16px; | 16 font-size: 16px; |
16 color: #2B2B2B; | 17 color: #2B2B2B; |
17 } | 18 } |
18 | 19 |
19 app-header { | 20 app-header { |
20 display: flex; | 21 display: flex; |
21 background: linear-gradient(#3E77B7, #6C98C4); | 22 background: linear-gradient(#3E77B7, #6C98C4); |
22 padding: 8px; | 23 padding: 8px; |
23 color: white; | 24 color: white; |
24 border-bottom: 1px solid #3E77B7; | 25 border-bottom: 1px solid #3E77B7; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 align-items: center; | 85 align-items: center; |
85 font-size: 1.2em; | 86 font-size: 1.2em; |
86 } | 87 } |
87 | 88 |
88 app-toast { | 89 app-toast { |
89 position: absolute; | 90 position: absolute; |
90 bottom: 32px; | 91 bottom: 32px; |
91 right: 32px; | 92 right: 32px; |
92 max-width: 55%; | 93 max-width: 55%; |
93 box-shadow: 0px 0px 12px 2px rgba(22, 22, 22, 0.4); | 94 box-shadow: 0px 0px 12px 2px rgba(22, 22, 22, 0.4); |
94 background-color: #b0281a; | |
95 background-image: linear-gradient(#E5D658, #DFCF43); | 95 background-image: linear-gradient(#E5D658, #DFCF43); |
96 border: 1px solid #AEA477; | 96 border: 1px solid #AEA477; |
97 padding: 6px; | 97 padding: 6px; |
98 border-radius: 2px; | 98 border-radius: 2px; |
99 display: flex; | 99 display: flex; |
100 align-items: center; | 100 align-items: center; |
101 font-size: 0.8em; | 101 font-size: 0.8em; |
| 102 overflow: hidden; |
102 } | 103 } |
103 | 104 |
104 app-toast-header { | 105 app-toast-header { |
105 flex-shrink: 0; | 106 flex-shrink: 0; |
106 margin-right: 6px; | 107 margin-right: 6px; |
107 } | 108 } |
108 | 109 |
| 110 app-toast-close-box { |
| 111 position: absolute; |
| 112 top: 3px; |
| 113 right: 3px; |
| 114 width: 1em; |
| 115 overflow: hidden; |
| 116 text-align: center; |
| 117 outline: 1px solid #AEA477; |
| 118 } |
| 119 |
109 .tip-icon { | 120 .tip-icon { |
110 font-weight: bold; | 121 font-weight: bold; |
111 font-size: 24px; | 122 font-size: 24px; |
112 border-radius: 16px; | 123 border-radius: 16px; |
113 width: 32px; | 124 width: 32px; |
114 height: 32px; | 125 height: 32px; |
115 border: 2px solid black; | 126 border: 2px solid black; |
116 line-height: 30px; | 127 line-height: 30px; |
117 text-align: center; | 128 text-align: center; |
118 } | 129 } |
119 | 130 |
120 .tip-price { | 131 .tip-price { |
121 font-weight: bold; | 132 font-weight: bold; |
122 } | 133 } |
123 | 134 |
124 .input-text { | 135 .input-text { |
125 margin-left: 8px; | 136 margin-left: 8px; |
126 } | 137 } |
127 | 138 |
128 .route-result { | 139 .route-result { |
129 margin: 16px 16px 0 16px; | 140 margin: 16px 16px 0 16px; |
| 141 outline: 1px solid black; |
130 } | 142 } |
131 | 143 |
132 .route-title { | 144 .route-title { |
133 flex: 1; | 145 flex: 1; |
134 } | 146 } |
135 | 147 |
136 .airline { | 148 .airline { |
137 border-radius: 2px; | 149 border-radius: 2px; |
138 align-items: center; | 150 align-items: center; |
139 padding: 8px; | 151 padding: 8px; |
(...skipping 20 matching lines...) Expand all Loading... |
160 a { | 172 a { |
161 text-decoration: none; | 173 text-decoration: none; |
162 color: #1155CC; | 174 color: #1155CC; |
163 } | 175 } |
164 </style> | 176 </style> |
165 <app-header> | 177 <app-header> |
166 <app-title> | 178 <app-title> |
167 <t>Search</t> | 179 <t>Search</t> |
168 </app-title> | 180 </app-title> |
169 <app-menu-button> | 181 <app-menu-button> |
170 <img src="images/menu-white.png" class="menu-icon"> | 182 <img src="resources/menu-white.png" class="menu-icon"> |
171 </app-menu-button> | 183 </app-menu-button> |
172 </app-header> | 184 </app-header> |
173 <app-toolbar> | 185 <app-toolbar> |
174 <app-search-input> | 186 <app-search-input> |
175 <span class="input-icon"> | 187 <span class="input-icon"> |
176 <img src="/sky/examples/flights/images/magnifying-glass.png" style="widt
h: 16px"> | 188 <img src="resources/magnifying-glass.png" style="width: 16px"> |
177 </span> | 189 </span> |
178 <span class="input-text"><t>flights today to dc by price</t></span> | 190 <span class="input-text"><t>flights today to dc by price</t></span> |
179 </app-search-input> | 191 </app-search-input> |
180 </app-toolbar> | 192 </app-toolbar> |
181 <app-scrollable> | 193 <app-scrollable> |
182 <app-panel class="route-result"> | 194 <app-panel class="route-result"> |
183 <app-panel-header> | 195 <app-panel-header> |
184 <div class="route-title"> | 196 <div class="route-title"> |
185 <t>SFO to DCA</t> | 197 <t>SFO to DCA</t> |
186 </div> | 198 </div> |
187 <app-menu-button> | 199 <app-menu-button> |
188 <img src="images/menu-enabled.png" class="menu-icon-inner"> | 200 <img src="resources/menu-enabled.png" class="menu-icon-inner"> |
189 </app-menu-button> | 201 </app-menu-button> |
190 </app-panel-header> | 202 </app-panel-header> |
191 <app-panel-content class="airline"> | 203 <app-panel-content class="airline"> |
192 <div class="airline-logo"> | 204 <div class="airline-logo"> |
193 <img class="airline-logo-image" src="images/virgin-america.jpg"> | 205 <img class="airline-logo-image" src="resources/virgin-america.jpg"> |
194 </div> | 206 </div> |
195 <div class="airline-name"> | 207 <div class="airline-name"> |
196 <t>Virgin America</t> | 208 <t>Virgin America</t> |
197 </div> | 209 </div> |
198 <div class="airline-best-price"> | 210 <div class="airline-best-price"> |
199 <t><a>$800</a></t> | 211 <t><a>$800</a></t> |
200 </div> | 212 </div> |
201 </app-panel-content> | 213 </app-panel-content> |
202 <app-panel-content class="airline"> | 214 <app-panel-content class="airline"> |
203 <div class="airline-logo"> | 215 <div class="airline-logo"> |
204 <img class="airline-logo-image" src="images/ba.jpg"> | 216 <img class="airline-logo-image" src="resources/ba.jpg"> |
205 </div> | 217 </div> |
206 <div class="airline-name"> | 218 <div class="airline-name"> |
207 <t>British Airways</t> | 219 <t>British Airways</t> |
208 </div> | 220 </div> |
209 <div class="airline-best-price"> | 221 <div class="airline-best-price"> |
210 <t><a>$700</a></t> | 222 <t><a>$700</a></t> |
211 </div> | 223 </div> |
212 </app-panel-content> | 224 </app-panel-content> |
213 <app-panel-content class="airline"> | 225 <app-panel-content class="airline"> |
214 <div class="airline-logo"> | 226 <div class="airline-logo"> |
215 <img class="airline-logo-image" src="images/united.jpg"> | 227 <img class="airline-logo-image" src="resources/united.jpg"> |
216 </div> | 228 </div> |
217 <div class="airline-name"> | 229 <div class="airline-name"> |
218 <t>United</t> | 230 <t>United</t> |
219 </div> | 231 </div> |
220 <div class="airline-best-price"> | 232 <div class="airline-best-price"> |
221 <t><a>$667</a></t> | 233 <t><a>$667</a></t> |
222 </div> | 234 </div> |
223 </app-panel-content> | 235 </app-panel-content> |
224 <app-panel-content class="airline"> | 236 <app-panel-content class="airline"> |
225 <div class="airline-logo"> | 237 <div class="airline-logo"> |
226 <img class="airline-logo-image" src="images/delta.jpg"> | 238 <img class="airline-logo-image" src="resources/delta.jpg"> |
227 </div> | 239 </div> |
228 <div class="airline-name"> | 240 <div class="airline-name"> |
229 <t>Delta</t> | 241 <t>Delta</t> |
230 </div> | 242 </div> |
231 <div class="airline-best-price"> | 243 <div class="airline-best-price"> |
232 <t><a>$450</a></t> | 244 <t><a>$450</a></t> |
233 </div> | 245 </div> |
234 </app-panel-content> | 246 </app-panel-content> |
235 </app-panel> | 247 </app-panel> |
236 <app-panel class="route-result"> | 248 <app-panel class="route-result"> |
237 <app-panel-header> | 249 <app-panel-header> |
238 <div class="route-title"> | 250 <div class="route-title"> |
239 <t>SJC to DCA</t> | 251 <t>SJC to DCA</t> |
240 </div> | 252 </div> |
241 <app-menu-button> | 253 <app-menu-button> |
242 <img src="images/menu-enabled.png" class="menu-icon-inner"> | 254 <img src="resources/menu-enabled.png" class="menu-icon-inner"> |
243 </app-menu-button> | 255 </app-menu-button> |
244 </app-panel-header> | 256 </app-panel-header> |
245 <app-panel-content class="airline"> | 257 <app-panel-content class="airline"> |
246 <div class="airline-logo"> | 258 <div class="airline-logo"> |
247 <img class="airline-logo-image" src="images/virgin-america.jpg"> | 259 <img class="airline-logo-image" src="resources/virgin-america.jpg"> |
248 </div> | 260 </div> |
249 <div class="airline-name"> | 261 <div class="airline-name"> |
250 <t>Virgin America</t> | 262 <t>Virgin America</t> |
251 </div> | 263 </div> |
252 <div class="airline-best-price"> | 264 <div class="airline-best-price"> |
253 <t><a>$1500</a></t> | 265 <t><a>$1500</a></t> |
254 </div> | 266 </div> |
255 </app-panel-content> | 267 </app-panel-content> |
256 <app-panel-content class="airline"> | 268 <app-panel-content class="airline"> |
257 <div class="airline-logo"> | 269 <div class="airline-logo"> |
258 <img class="airline-logo-image" src="images/jetblue.jpg"> | 270 <img class="airline-logo-image" src="resources/jetblue.jpg"> |
259 </div> | 271 </div> |
260 <div class="airline-name"> | 272 <div class="airline-name"> |
261 <t>jetBlue</t> | 273 <t>jetBlue</t> |
262 </div> | 274 </div> |
263 <div class="airline-best-price"> | 275 <div class="airline-best-price"> |
264 <t><a>$650</a></t> | 276 <t><a>$650</a></t> |
265 </div> | 277 </div> |
266 </app-panel-content> | 278 </app-panel-content> |
267 <app-panel-content class="airline"> | 279 <app-panel-content class="airline"> |
268 <div class="airline-logo"> | 280 <div class="airline-logo"> |
269 <img class="airline-logo-image" src="images/united.jpg"> | 281 <img class="airline-logo-image" src="resources/united.jpg"> |
270 </div> | 282 </div> |
271 <div class="airline-name"> | 283 <div class="airline-name"> |
272 <t>United</t> | 284 <t>United</t> |
273 </div> | 285 </div> |
274 <div class="airline-best-price"> | 286 <div class="airline-best-price"> |
275 <t><a>$367</a></t> | 287 <t><a>$367</a></t> |
276 </div> | 288 </div> |
277 </app-panel-content> | 289 </app-panel-content> |
278 </app-panel> | 290 </app-panel> |
279 </app-scrollable> | 291 </app-scrollable> |
280 <app-toast> | 292 <app-toast> |
281 <app-toast-header> | 293 <app-toast-header> |
282 <div class="tip-icon"> | 294 <div class="tip-icon"> |
283 <t>?</t> | 295 <t>?</t> |
284 </div> | 296 </div> |
285 </app-toast-header> | 297 </app-toast-header> |
286 <app-toast-content> | 298 <app-toast-content> |
287 <t>Flights are <span class="tip-price">$200</span> cheaper tomorrow.</t> | 299 <t>Flights are <span class="tip-price">$200</span> cheaper tomorrow.</t> |
288 </app-toast-content> | 300 </app-toast-content> |
| 301 <app-toast-close-box> |
| 302 X |
| 303 </app-toast-close-box> |
289 </app-toast> | 304 </app-toast> |
| 305 <script> |
| 306 import "dart:sky"; |
| 307 import "dart:sky.internals" as internals; |
| 308 import "dart:async"; |
| 309 |
| 310 var app; |
| 311 |
| 312 bool imagesLoaded() { |
| 313 var images = window.document.querySelectorAll('img'); |
| 314 for (var i = 0; i < images.length; i++) { |
| 315 if (!images[i].complete) |
| 316 return false; |
| 317 } |
| 318 return true; |
| 319 } |
| 320 |
| 321 void checkImagesLoaded() { |
| 322 if (!imagesLoaded()) { |
| 323 new Timer(new Duration(seconds:10), checkImagesLoaded); |
| 324 return; |
| 325 } |
| 326 runAfterDisplay(() { |
| 327 internals.notifyTestComplete(""); |
| 328 }); |
| 329 } |
| 330 void main() { |
| 331 window.addEventListener("load", (_) { |
| 332 var input = document.querySelector('.input-text'); |
| 333 window.getSelection().selectAllChildren(input.firstChild); |
| 334 checkImagesLoaded(); |
| 335 }); |
| 336 } |
| 337 </script> |
290 </app> | 338 </app> |
OLD | NEW |