2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3 This code may only be used under the BSD style license found at http://polymer.github.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/CONTRIBUTORS.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/PATENTS.txt
12 `paper-shadow` is a container that renders two shadows on top of each other to
13 create the effect of a lifted piece of paper.
25 <link href=
"../polymer/polymer.html" rel=
"import">
27 <link href=
"paper-shadow.css" rel=
"stylesheet" shim-shadowdom
>
29 <polymer-element name=
"paper-shadow">
33 <div id=
"shadow-bottom" fit animated?=
"[[animated]]" class=
"paper-shadow-bottom-z-[[z]]"></div>
34 <div id=
"shadow-top" fit animated?=
"[[animated]]" class=
"paper-shadow-top-z-[[z]]"></div>
46 * The z-depth of this shadow, from 0-5. Setting this property
47 * after element creation has no effect. Use `setZ()` instead.
56 * Set this to true to animate the shadow when setting a new
68 * Set the z-depth of the shadow. This should be used after element
69 * creation instead of setting the z property directly.
72 * @param {Number} newZ
74 setZ: function(newZ
) {
75 if (this.z
!== newZ
) {
76 this.$['shadow-bottom'].classList
.remove('paper-shadow-bottom-z-' + this.z
);
77 this.$['shadow-bottom'].classList
.add('paper-shadow-bottom-z-' + newZ
);
78 this.$['shadow-top'].classList
.remove('paper-shadow-top-z-' + this.z
);
79 this.$['shadow-top'].classList
.add('paper-shadow-top-z-' + newZ
);