Add an exponential backoff to rechecking the app list doodle.
[chromium-blink-merge.git] / third_party / polymer / components-chromium / core-transition / demo.html
blob44a6e592ced1295013a0ec307d2e508774b3ce7f
1 <!doctype html>
2 <!--
3 Copyright 2013 The Polymer Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file.
6 -->
7 <html>
8 <head>
10 <meta charset="utf-8">
11 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
12 <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
14 <title>core-transition</title>
16 <script src="../webcomponentsjs/webcomponents.js"></script>
18 <link href="core-transition-css.html" rel="import">
20 <style>
21 #animate-me {
22 background-color: lime;
23 position: fixed;
24 top: 100px;
25 width: 100%;
26 height: 100%;
28 </style>
30 </head>
31 <body unresolved>
33 <div id="animate-me" hidden></div>
35 <select id="sel" onchange="setup();">
36 <option value="core-transition-fade" selected>core-transition-fade</option>
37 <option value="core-transition-center">core-transition-center</option>
38 <option value="core-transition-top">core-transition-top</option>
39 <option value="core-transition-bottom">core-transition-bottom</option>
40 <option value="core-transition-left">core-transition-left</option>
41 <option value="core-transition-right">core-transition-right</option>
42 </select>
44 <button onclick="stuff();">toggle</button>
46 <script>
48 document.addEventListener('polymer-ready', function() {
49 // initial setup
50 setup();
51 document.getElementById('animate-me').removeAttribute('hidden');
52 });
54 var meta;
55 var transition;
56 var state = {
57 opened: false
60 function getMeta() {
61 if (!meta) {
62 meta = document.createElement('core-meta');
63 meta.type = 'transition';
65 return meta;
68 function setup() {
69 var target = document.getElementById('animate-me');
71 if (transition) {
72 transition.teardown(target);
75 var value = document.getElementById('sel').selectedOptions[0].value;
76 transition = getMeta().byId(value);
77 transition.setup(target);
80 function stuff() {
81 var target = document.getElementById('animate-me');
82 state.opened = !state.opened;
83 transition.go(target, state);
85 </script>
86 </body>
87 </html>