3
Copyright (c) 2015 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
10
<link rel="import" href="../../../polymer/polymer.html">
11
<link rel="import" href="../../../iron-flex-layout/iron-flex-layout.html">
12
<link rel="import" href="../../neon-shared-element-animatable-behavior.html">
13
<link rel="import" href="../../../paper-styles/typography.html">
14
<link rel="import" href="../../../paper-styles/color.html">
15
<link rel="import" href="../shared-styles.html">
17
<dom-module id="animated-grid">
19
<style include="shared-styles"></style>
28
display: inline-block;
31
width: calc(100% / 6);
32
height: calc(100% / 3);
34
@apply(--paper-font-title);
35
@apply(--layout-vertical);
36
@apply(--layout-center-center);
39
.tile:nth-of-type(1) {
40
width: calc(100% / 3);
41
height: calc(100% / 3 * 2);
44
.tile:nth-of-type(4) {
45
width: calc(100% / 3);
48
.tile:nth-of-type(5) {
49
width: calc(100% / 3);
50
height: calc(100% / 3 * 2);
53
.tile:nth-of-type(8) {
54
width: calc(100% / 3);
55
height: calc(100% / 3);
58
.tile:nth-of-type(9) {
60
top: calc(100% / 3 * 2);
62
width: calc(100% / 6);
63
height: calc(100% / 3);
66
.tile:nth-of-type(10) {
68
top: calc(100% / 3 * 2);
69
left: calc(100% / 6);;
70
width: calc(100% / 6);
71
height: calc(100% / 3);
76
<template is="dom-repeat" items="[[config]]">
77
<div class$="[[_computeTileClass(item.color)]]">
78
<span>[[item.value]]</span>
93
Polymer.NeonSharedElementAnimatableBehavior
102
{value: 1, color: 'blue'},
103
{value: 2, color: 'red'},
104
{value: 3, color: 'blue'},
105
{value: 4, color: 'green'},
106
{value: 5, color: 'yellow'},
107
{value: 6, color: 'blue'},
108
{value: 7, color: 'red'},
109
{value: 8, color: 'green'},
110
{value: 9, color: 'yellow'},
111
{value: 10, color: 'red'}
121
name: 'ripple-animation',
125
name: 'hero-animation',
139
_computeTileClass: function(color) {
140
return 'tile ' + color + '-300';
143
_onClick: function(event) {
144
var target = event.target;
145
while (target !== this && !target._templateInstance) {
146
target = target.parentNode;
149
// configure the page animation
150
this.sharedElements = {
154
this.animationConfig['exit'][0].gesture = {
159
this.fire('tile-click', {
161
data: target._templateInstance.item