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
13 <title>core-animated-pages
</title>
15 <script src=
"../../webcomponentsjs/webcomponents.js"></script>
16 <link href=
"../core-animated-pages.html" rel=
"import">
20 font-family: 'Roboto
2', 'Helvetica Neue', Helvetica, Arial, sans-serif;
37 <polymer-element name=
"music-demo">
50 display: inline-block;
56 background-color: #fff;
57 box-shadow:
0 2px
10px
0 rgba(
0,
0,
0,
0.16);
84 box-shadow:
0 6px
20px
0 rgba(
0,
0,
0,
0.19);
107 <core-animated-pages selected=
"{{page}}" transitions=
"hero-transition" on-core-animated-pages-transition-end=
"{{complete}}">
111 <div class=
"chip-container" hero-p
on-tap=
"{{transition}}">
113 <template repeat=
"{{items as item}}">
115 <div class=
"chip" hero-id=
"{{item.artist}}-{{item.album}}" hero?=
"{{selectedAlbum === item }}">
116 <div class=
"chip-top" style=
"background:{{item.color}};" hero-id=
"{{item.artist}}-{{item.album}}-art" hero?=
"{{selectedAlbum === item}}"></div>
117 <div class=
"chip-bottom">
118 <div class=
"chip-album-title">{{item.album}}
</div>
119 <div class=
"chip-artist">{{item.artist}}
</div>
128 <section id=
"details">
130 <div class=
"card" layout horizontal
hero-id=
"{{selectedAlbum.artist}}-{{selectedAlbum.album}}" hero
on-tap=
"{{transition}}">
131 <div class=
"card-left" style=
"background:{{selectedAlbum.color}};" hero-id=
"{{selectedAlbum.artist}}-{{selectedAlbum.album}}-art" hero
></div>
132 <div class=
"card-right" flex
>
133 <div layout horizontal center
>
135 <div class=
"card-icon" style=
"background:{{selectedAlbum.color}};"></div>
138 <div class=
"card-album-title">{{selectedAlbum.album}}
</div>
139 <div class=
"card-album-artist">{{selectedAlbum.artist}}
</div>
147 </core-animated-pages>
152 Polymer('music-demo', {
157 { artist
: 'Tycho', album
: 'Fragments', color
: '#f4db33' },
158 { artist
: 'Tycho', album
: 'Past Prologue', color
: '#972ff8' },
159 { artist
: 'Tycho', album
: 'Spectre', color
: '#7dd6fe' },
160 { artist
: 'Tycho', album
: 'Awake', color
: '#dc3c84' }
165 transition: function(e
) {
166 if (this.page
=== 0 && e
.target
.templateInstance
.model
.item
) {
167 this.selectedAlbum
= e
.target
.templateInstance
.model
.item
;
178 <div class=
"green"></div>
180 <music-demo></music-demo>