OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 Copyright (c) 2015 The Polymer Project Authors. All rights reserved. |
| 3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 6 Code distributed by Google as part of the polymer project is also |
| 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 8 --> |
| 9 <link rel="import" href="../../../polymer/polymer.html"> |
| 10 <link rel="import" href="../../../paper-styles/paper-styles.html"> |
| 11 <link rel="import" href="../../neon-shared-element-animatable-behavior.html"> |
| 12 |
| 13 <dom-module id="squares-page"> |
| 14 |
| 15 <style> |
| 16 |
| 17 .header { |
| 18 height: 40%; |
| 19 background: var(--color-one); |
| 20 } |
| 21 |
| 22 .body { |
| 23 text-align: center; |
| 24 padding: 8px; |
| 25 } |
| 26 |
| 27 .square { |
| 28 display: inline-block; |
| 29 width: 150px; |
| 30 height: 150px; |
| 31 margin: 8px; |
| 32 background: var(--color-two); |
| 33 } |
| 34 |
| 35 </style> |
| 36 |
| 37 <template> |
| 38 |
| 39 <div id="header" class="header"></div> |
| 40 |
| 41 <div class="body"> |
| 42 <div class="square"></div> |
| 43 <div class="square"></div> |
| 44 <div class="square"></div> |
| 45 <div class="square"></div> |
| 46 </div> |
| 47 |
| 48 </template> |
| 49 |
| 50 </dom-module> |
| 51 |
| 52 <script> |
| 53 |
| 54 Polymer({ |
| 55 |
| 56 is: 'squares-page', |
| 57 |
| 58 behaviors: [ |
| 59 Polymer.NeonSharedElementAnimatableBehavior |
| 60 ], |
| 61 |
| 62 properties: { |
| 63 |
| 64 sharedElements: { |
| 65 value: function() { |
| 66 return { |
| 67 'hero': this.$.header |
| 68 } |
| 69 } |
| 70 }, |
| 71 |
| 72 animationConfig: { |
| 73 value: function() { |
| 74 var squares = Polymer.dom(this.root).querySelectorAll('.square'); |
| 75 var squaresArray = Array.prototype.slice.call(squares); |
| 76 return { |
| 77 'entry': [{ |
| 78 name: 'hero-animation', |
| 79 id: 'hero', |
| 80 toPage: this |
| 81 }, { |
| 82 name: 'cascaded-animation', |
| 83 animation: 'transform-animation', |
| 84 transformFrom: 'translateY(100%)', |
| 85 nodes: squaresArray |
| 86 }], |
| 87 |
| 88 'exit': [{ |
| 89 name: 'slide-up-animation', |
| 90 node: this.$.header |
| 91 }, { |
| 92 name: 'cascaded-animation', |
| 93 animation: 'transform-animation', |
| 94 transformTo: 'translateY(60vh)', |
| 95 nodes: squaresArray |
| 96 }] |
| 97 }; |
| 98 } |
| 99 } |
| 100 } |
| 101 |
| 102 }); |
| 103 |
| 104 </script> |
OLD | NEW |