Update {virtual,override,final} to follow C++11 style.
[chromium-blink-merge.git] / third_party / polymer / components / core-animated-pages / demos / shadow.html
blobce315d6f771e720da86fd6e943b95fb16d66364f
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 </style>
32 </head>
33 <body unresolved fullbleed vertical layout>
35 <polymer-element name="grid-toc" attributes="items selected">
36 <template>
37 <style>
38 #container {
39 overflow: auto;
42 .card {
43 position: relative;
44 height: 150px;
45 width: 150px;
46 font-size: 50px;
47 margin: 8px;
48 background-color: tomato;
49 border-radius: 4px;
50 cursor: default;
52 </style>
53 <div id="container" on-tap="{{selectView}}" flex horizontal wrap around-justified layout hero-p>
54 <template repeat="{{item in items}}">
55 <div class="card" vertical center center-justified layout hero-id="item-{{item}}" hero?="{{selected === item + 1 || lastSelected === item + 1}}"><span cross-fade>{{item}}</span></div>
56 </template>
57 </div>
58 </template>
59 <script>
60 Polymer('grid-toc', {
61 selectedChanged: function(old) {
62 this.lastSelected = old;
64 selectView: function(e) {
65 var item = e.target.templateInstance.model.item;
66 if (item !== undefined) {
67 this.fire('grid-toc-select', {item: item});
70 });
71 </script>
72 </polymer-element>
74 <polymer-element name="grid-item" attributes="item isHero">
75 <template>
76 <style>
77 .view {
78 font-size: 250px;
79 background-color: tomato;
81 </style>
82 <div class="view" flex vertical center center-justified layout hero-id="item-{{item}}" hero?="{{isHero}}">
83 <span cross-fade>{{item}}</span>
84 </div>
85 </template>
86 <script>
87 Polymer('grid-item', {
88 isSelected: false
90 </script>
91 </polymer-element>
94 <template is="auto-binding">
95 <core-toolbar class="toolbar">
96 <core-icon-button icon="{{$.pages.selected != 0 ? 'arrow-back' : 'menu'}}" on-tap="{{back}}"></core-icon-button>
97 <div flex>Stuff</div>
98 <core-icon-button icon="more-vert"></core-icon-button>
99 </core-toolbar>
100 <core-animated-pages id="pages" flex selected="0" on-core-animated-pages-transition-end="{{transitionend}}" transitions="cross-fade-all hero-transition">
102 <grid-toc vertical id="toc" layout selected="{{$.pages.selected}}" items="{{items}}" hero-p on-grid-toc-select="{{selectView}}"></grid-toc>
104 <template repeat="{{item in items}}">
105 <grid-item vertical layout item="{{item}}" hero-p isHero="{{$.pages.selected === item + 1 || $.pages.selected === 0}}"></grid-item>
106 </template>
108 </core-animated-pages>
109 </template>
111 <script>
113 addEventListener('template-bound', function(e) {
114 var scope = e.target;
115 var items = [], count=50;
116 for (var i=0; i < count; i++) {
117 items.push(i);
120 scope.items = items;
122 scope.selectView = function(e, detail) {
123 var i = detail.item;
124 this.$.pages.selected = i+1;
127 scope.back = function() {
128 this.lastSelected = this.$.pages.selected;
129 this.$.pages.selected = 0;
132 scope.transitionend = function() {
133 if (this.lastSelected) {
134 this.lastSelected = null;
139 </script>
141 </body>
142 </html>