Update {virtual,override,final} to follow C++11 style.
[chromium-blink-merge.git] / third_party / polymer / components / core-animated-pages / demos / grid.html
blob559e150403b295484c39890c0b8c27daacbcf3b4
1 <!--
2 @license
3 Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 Code distributed by Google as part of the polymer project is also
8 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 -->
10 <!doctype html>
11 <html>
12 <head>
14 <script src="../../webcomponentsjs/webcomponents.js"></script>
16 <link href="../../core-icons/core-icons.html" rel="import">
17 <link href="../../core-icon-button/core-icon-button.html" rel="import">
18 <link href="../../core-toolbar/core-toolbar.html" rel="import">
19 <link href="../core-animated-pages.html" rel="import">
21 <style>
22 body {
23 font-family: sans-serif;
26 .toolbar {
27 background-color: steelblue;
30 #container {
31 overflow: auto;
34 .card {
35 position: relative;
36 height: 150px;
37 width: 150px;
38 font-size: 50px;
39 margin: 8px;
40 background-color: tomato;
41 border-radius: 4px;
42 cursor: default;
45 .view {
46 font-size: 250px;
47 background-color: tomato;
50 </style>
52 </head>
53 <body unresolved fullbleed vertical layout>
54 <template is="auto-binding">
55 <core-toolbar class="toolbar">
56 <core-icon-button icon="{{$.pages.selected != 0 ? 'arrow-back' : 'menu'}}" on-tap="{{back}}"></core-icon-button>
57 <div flex>Stuff</div>
58 <core-icon-button icon="more-vert"></core-icon-button>
59 </core-toolbar>
60 <core-animated-pages id="pages" flex selected="0" on-core-animated-pages-transition-end="{{transitionend}}" transitions="cross-fade-all hero-transition">
62 <section vertical layout>
64 <div id="container" flex horizontal wrap around-justified layout hero-p>
65 <template repeat="{{item in items}}">
66 <div class="card" vertical center center-justified layout hero-id="item-{{item}}" hero?="{{$.pages.selected === item + 1 || lastSelected === item + 1}}" on-tap="{{selectView}}"><span cross-fade>{{item}}</span></div>
67 </template>
68 </div>
70 </section>
72 <template repeat="{{item in items}}">
73 <section vertical layout>
74 <div class="view" flex vertical center center-justified layout hero-id="item-{{item}}" hero?="{{$.pages.selected === item + 1 || $.pages.selected === 0}}"><span cross-fade>{{item}}</span></div>
75 </section>
76 </template>
78 </core-animated-pages>
79 </template>
81 <script>
83 addEventListener('template-bound', function(e) {
84 var scope = e.target;
85 var items = [], count=50;
86 for (var i=0; i < count; i++) {
87 items.push(i);
90 scope.items = items;
92 scope.selectView = function(e) {
93 var i = e.target.templateInstance.model.item;
94 this.$.pages.selected = i+1;
97 scope.back = function() {
98 this.lastSelected = this.$.pages.selected;
99 console.log(this.lastSelected);
100 this.$.pages.selected = 0;
103 scope.transitionend = function() {
104 if (this.lastSelected) {
105 this.lastSelected = null;
110 </script>
112 </body>
113 </html>