~didrocks/+junk/face-detection-15.04

« back to all changes in this revision

Viewing changes to facedetection/www/bower_components/paper-tabs/demo/index.html

  • Committer: Didier Roche
  • Date: 2016-05-10 23:09:11 UTC
  • Revision ID: didier.roche@canonical.com-20160510230911-c7xr490zrj3yrzxd
New version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!doctype html>
 
2
<!--
 
3
@license
 
4
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
 
5
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
 
6
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
 
7
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
 
8
Code distributed by Google as part of the polymer project is also
 
9
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
 
10
-->
 
11
 
 
12
<html>
 
13
  <head>
 
14
 
 
15
    <title>paper-tabs demo</title>
 
16
 
 
17
    <meta charset="utf-8">
 
18
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
 
19
 
 
20
    <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
 
21
 
 
22
    <link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html">
 
23
    <link rel="import" href="../../iron-demo-helpers/demo-snippet.html">
 
24
    <link rel="import" href="../../iron-flex-layout/iron-flex-layout.html">
 
25
    <link rel="import" href="../../iron-pages/iron-pages.html">
 
26
    <link rel="import" href="../../paper-toolbar/paper-toolbar.html">
 
27
    <link rel="import" href="../paper-tab.html">
 
28
    <link rel="import" href="../paper-tabs.html">
 
29
 
 
30
    <style is="custom-style" include="demo-pages-shared-styles">
 
31
      #container {
 
32
        max-width: 600px;
 
33
      }
 
34
 
 
35
      paper-tabs, paper-toolbar {
 
36
        background-color: var(--paper-blue-900);
 
37
        color: #fff;
 
38
      }
 
39
    </style>
 
40
 
 
41
  </head>
 
42
  <body unresolved>
 
43
 
 
44
    <div id="container" class="vertical-section-container centered">
 
45
 
 
46
      <h3>Plain <code>paper-tabs</code>.</h3>
 
47
      <demo-snippet>
 
48
        <template>
 
49
          <paper-tabs selected="0">
 
50
            <paper-tab>ITEM ONE</paper-tab>
 
51
            <paper-tab>ITEM TWO</paper-tab>
 
52
            <paper-tab>ITEM THREE</paper-tab>
 
53
          </paper-tabs>
 
54
        </template>
 
55
      </demo-snippet>
 
56
 
 
57
      <h3>The <code>no-bar</code> attribute disables the selection bar.</h3>
 
58
      <demo-snippet>
 
59
        <template>
 
60
          <style is="custom-style">
 
61
            paper-tabs[no-bar] paper-tab.iron-selected {
 
62
              color: #ffff8d;
 
63
            }
 
64
          </style>
 
65
 
 
66
          <paper-tabs id="plain-tabs" selected="0" no-bar>
 
67
            <paper-tab>ITEM ONE</paper-tab>
 
68
            <paper-tab>ITEM TWO</paper-tab>
 
69
            <paper-tab>ITEM THREE</paper-tab>
 
70
          </paper-tabs>
 
71
        </template>
 
72
      </demo-snippet>
 
73
 
 
74
      <h3>
 
75
        The <code>no-slide</code> attribute prevents the selection bar from
 
76
        animating when the selection changes.
 
77
      </h3>
 
78
      <demo-snippet>
 
79
        <template>
 
80
          <paper-tabs selected="0" no-slide>
 
81
            <paper-tab>ITEM ONE</paper-tab>
 
82
            <paper-tab>ITEM TWO</paper-tab>
 
83
            <paper-tab>ITEM THREE</paper-tab>
 
84
          </paper-tabs>
 
85
        </template>
 
86
      </demo-snippet>
 
87
 
 
88
      <h3>
 
89
        The <code>noink</code> attribute disables the ink ripple animation seen
 
90
        when the user activates a tab (by clicking, tapping, etc.).
 
91
      </h3>
 
92
      <demo-snippet>
 
93
        <template>
 
94
          <paper-tabs selected="0" noink>
 
95
            <paper-tab>ITEM ONE</paper-tab>
 
96
            <paper-tab>ITEM TWO</paper-tab>
 
97
            <paper-tab>ITEM THREE</paper-tab>
 
98
          </paper-tabs>
 
99
        </template>
 
100
      </demo-snippet>
 
101
 
 
102
      <h3>
 
103
        The <code>scrollable</code> attribute causes the tabs to scroll, rather
 
104
        than compress, when there is not enough space. Arrow buttons appear when
 
105
        any of the tabs are not completely visible.
 
106
      </h3>
 
107
      <demo-snippet>
 
108
        <template>
 
109
          <paper-tabs selected="0" scrollable>
 
110
            <paper-tab>NUMBER ONE ITEM</paper-tab>
 
111
            <paper-tab>ITEM TWO</paper-tab>
 
112
            <paper-tab>THE THIRD ITEM</paper-tab>
 
113
            <paper-tab>THE ITEM FOUR</paper-tab>
 
114
            <paper-tab>FIFTH</paper-tab>
 
115
            <paper-tab>THE SIXTH TAB</paper-tab>
 
116
            <paper-tab>NUMBER SEVEN</paper-tab>
 
117
            <paper-tab>EIGHT</paper-tab>
 
118
            <paper-tab>NUMBER NINE</paper-tab>
 
119
            <paper-tab>THE TENTH</paper-tab>
 
120
            <paper-tab>THE ITEM ELEVEN</paper-tab>
 
121
            <paper-tab>TWELFTH ITEM</paper-tab>
 
122
          </paper-tabs>
 
123
        </template>
 
124
      </demo-snippet>
 
125
 
 
126
      <h3>
 
127
        Tab layout is effected by the writing direction of the surrounding area.
 
128
      </h3>
 
129
      <demo-snippet>
 
130
        <template>
 
131
          <div dir="rtl">
 
132
            <paper-tabs selected="0">
 
133
              <paper-tab>ITEM ONE</paper-tab>
 
134
              <paper-tab>ITEM TWO</paper-tab>
 
135
              <paper-tab>ITEM THREE</paper-tab>
 
136
            </paper-tabs>
 
137
            &nbsp;
 
138
            <paper-tabs selected="0" scrollable>
 
139
              <paper-tab>NUMBER ONE ITEM</paper-tab>
 
140
              <paper-tab>ITEM TWO</paper-tab>
 
141
              <paper-tab>THE THIRD ITEM</paper-tab>
 
142
              <paper-tab>THE ITEM FOUR</paper-tab>
 
143
              <paper-tab>FIFTH</paper-tab>
 
144
              <paper-tab>THE SIXTH TAB</paper-tab>
 
145
              <paper-tab>NUMBER SEVEN</paper-tab>
 
146
              <paper-tab>EIGHT</paper-tab>
 
147
              <paper-tab>NUMBER NINE</paper-tab>
 
148
              <paper-tab>THE TENTH</paper-tab>
 
149
              <paper-tab>THE ITEM ELEVEN</paper-tab>
 
150
              <paper-tab>TWELFTH ITEM</paper-tab>
 
151
            </paper-tabs>
 
152
          </div>
 
153
        </template>
 
154
      </demo-snippet>
 
155
 
 
156
      <h3>
 
157
        Use the <code>align-bottom</code> attribute when your tabs are
 
158
        positioned below the content they control. The selection bar will be
 
159
        shown at the top of the tabs.
 
160
      </h3>
 
161
      <demo-snippet>
 
162
        <template>
 
163
          <paper-tabs selected="0" align-bottom>
 
164
            <paper-tab>ITEM ONE</paper-tab>
 
165
            <paper-tab>ITEM TWO</paper-tab>
 
166
            <paper-tab>ITEM THREE</paper-tab>
 
167
          </paper-tabs>
 
168
        </template>
 
169
      </demo-snippet>
 
170
 
 
171
      <h3>
 
172
        Use the <code>link</code> attribute when a <code>paper-tab</code>
 
173
        contains a link. The link will fill the entire tab. <code>paper-tabs</code>
 
174
        implements its own tabindexing and keyboard focus patterns so an anchor
 
175
        placed inside should set <code>tabindex="-1"</code>.
 
176
      </h3>
 
177
      <demo-snippet>
 
178
        <template>
 
179
          <style is="custom-style">
 
180
            paper-tab[link] a {
 
181
              /* These mixins (from iron-flex-layout) center the link text. */
 
182
              @apply(--layout-horizontal);
 
183
              @apply(--layout-center-center);
 
184
              color: #fff;
 
185
              text-decoration: none;
 
186
            }
 
187
          </style>
 
188
 
 
189
          <paper-tabs selected="0">
 
190
            <paper-tab link>
 
191
              <a href="#item1" tabindex="-1">ITEM ONE</a>
 
192
            </paper-tab>
 
193
            <paper-tab link>
 
194
              <a href="#item2" tabindex="-1">ITEM TWO</a>
 
195
            </paper-tab>
 
196
            <paper-tab link>
 
197
              <a href="#item3" tabindex="-1">ITEM THREE</a>
 
198
            </paper-tab>
 
199
          </paper-tabs>
 
200
        </template>
 
201
      </demo-snippet>
 
202
 
 
203
      <h3>
 
204
        Tabs can be used in a <code>paper-toolbar</code>.
 
205
      </h3>
 
206
      <demo-snippet>
 
207
        <template>
 
208
          <style is="custom-style">
 
209
            paper-toolbar {
 
210
              --paper-toolbar-background: var(--paper-blue-900);
 
211
            }
 
212
 
 
213
            .self-end {
 
214
              /* This mixin (from iron-flex-layout) aligns the tabs to the
 
215
                 bottom of the toolbar. */
 
216
              @apply(--layout-self-end);
 
217
            }
 
218
          </style>
 
219
 
 
220
          <paper-toolbar class="tall">
 
221
            <paper-tabs selected="0" class="bottom self-end" style="width: 300px;">
 
222
              <paper-tab>ITEM ONE</paper-tab>
 
223
              <paper-tab>ITEM TWO</paper-tab>
 
224
            </paper-tabs>
 
225
          </paper-toolbar>
 
226
        </template>
 
227
      </demo-snippet>
 
228
 
 
229
      <h3>
 
230
        Use <code>autoselect</code> to enable automatic tab selection.
 
231
      </h3>
 
232
      <demo-snippet>
 
233
        <template>
 
234
          <paper-tabs selected="0" autoselect>
 
235
            <paper-tab>ITEM ONE</paper-tab>
 
236
            <paper-tab>ITEM TWO</paper-tab>
 
237
            <paper-tab>ITEM THREE</paper-tab>
 
238
          </paper-tabs>
 
239
        </template>
 
240
      </demo-snippet>
 
241
 
 
242
      <h3>
 
243
        Use <code>autoselect-delay</code> to adjust the delay between the last
 
244
        keyup event and when the tab is automatically selected (when
 
245
        <code>autoselect</code> is true).
 
246
      </h3>
 
247
      <demo-snippet>
 
248
        <template>
 
249
          <h4>
 
250
            <code>autoselect-delay="0"</code>
 
251
          </h4>
 
252
          <paper-tabs selected="0" no-slide autoselect autoselect-delay="0">
 
253
            <paper-tab>ITEM ONE</paper-tab>
 
254
            <paper-tab>ITEM TWO</paper-tab>
 
255
            <paper-tab>ITEM THREE</paper-tab>
 
256
          </paper-tabs>
 
257
 
 
258
          <h4>
 
259
            <code>autoselect-delay="1000"</code>
 
260
          </h4>
 
261
          <paper-tabs selected="0" autoselect autoselect-delay="1000">
 
262
            <paper-tab>ITEM ONE</paper-tab>
 
263
            <paper-tab>ITEM TWO</paper-tab>
 
264
            <paper-tab>ITEM THREE</paper-tab>
 
265
          </paper-tabs>
 
266
        </template>
 
267
      </demo-snippet>
 
268
 
 
269
      <!--
 
270
      Nested templates are not supported in IE, meaning they can't be used in a
 
271
      demo-snippet. See Polymer/polymer#2495 for more details.
 
272
      -->
 
273
      <!--
 
274
      <h3>J. Bound Selection</h3>
 
275
      <demo-snippet>
 
276
        <template>
 
277
          <template is="dom-bind">
 
278
            <h2>Current Tab: <span>[[selected]]</span></h2>
 
279
            <paper-tabs selected="{{selected}}">
 
280
              <paper-tab>ITEM ONE</paper-tab>
 
281
              <paper-tab>ITEM TWO</paper-tab>
 
282
              <paper-tab>ITEM THREE</paper-tab>
 
283
            </paper-tabs>
 
284
          </template>
 
285
        </template>
 
286
      </demo-snippet>
 
287
 
 
288
      <h3>K. Controlling content</h3>
 
289
      <demo-snippet>
 
290
        <template>
 
291
          <style is="custom-style">
 
292
            iron-pages {
 
293
              border: 1px solid #ccc;
 
294
              border-top: none;
 
295
              padding: 8px;
 
296
            }
 
297
          </style>
 
298
 
 
299
          <template is="dom-bind">
 
300
            <paper-tabs selected="{{selected}}">
 
301
              <paper-tab>ITEM ONE</paper-tab>
 
302
              <paper-tab>ITEM TWO</paper-tab>
 
303
              <paper-tab>ITEM THREE</paper-tab>
 
304
            </paper-tabs>
 
305
            <iron-pages selected="{{selected}}">
 
306
              <div>CONTENT ONE</div>
 
307
              <div>CONTENT TWO</div>
 
308
              <div>CONTENT THREE</div>
 
309
            </iron-pages>
 
310
          </template>
 
311
        </template>
 
312
      </demo-snippet>
 
313
      -->
 
314
 
 
315
    </div>
 
316
 
 
317
  </body>
 
318
</html>