| OLD | NEW |
| (Empty) | |
| 1 /** |
| 2 * While scrolling down, fade in the rear background layer and fade out the fr
ont background |
| 3 * layer (opacity interpolated based on scroll position). |
| 4 */ |
| 5 Polymer.AppLayout.registerEffect('blend-background', { |
| 6 /** @this Polymer.AppLayout.ElementWithBackground */ |
| 7 setUp: function setUp() { |
| 8 this.$.backgroundFrontLayer.style.willChange = 'opacity'; |
| 9 this.$.backgroundFrontLayer.style.webkitTransform = 'translateZ(0)'; |
| 10 this.$.backgroundRearLayer.style.willChange = 'opacity'; |
| 11 this.$.backgroundRearLayer.style.webkitTransform = 'translateZ(0)'; |
| 12 this.$.backgroundRearLayer.style.opacity = 0; |
| 13 }, |
| 14 /** @this Polymer.AppLayout.ElementWithBackground */ |
| 15 run: function run(p, y) { |
| 16 this.$.backgroundFrontLayer.style.opacity = 1 - p; |
| 17 this.$.backgroundRearLayer.style.opacity = p; |
| 18 } |
| 19 }); |
| OLD | NEW |