Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: third_party/polymer/v1_0/components-chromium/app-layout/app-scroll-effects/effects/fade-background-extracted.js

Issue 1984963002: Roll Polymer elements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /**
2 * Upon scrolling past a threshold, fade in the rear background layer and fade out the front
3 * background layer (opacity CSS transitioned over time).
4 */
5 Polymer.AppLayout.registerEffect('fade-background', {
6 /** @this Polymer.AppLayout.ElementWithBackground */
7 setUp: function setUp(config) {
8 var duration = config.duration || '0.5s';
9 this.$.backgroundFrontLayer.style.willChange = 'opacity';
10 this.$.backgroundFrontLayer.style.webkitTransform = 'translateZ(0)';
11 this.$.backgroundFrontLayer.style.transitionProperty = 'opacity';
12 this.$.backgroundFrontLayer.style.transitionDuration = duration;
13 this.$.backgroundRearLayer.style.willChange = 'opacity';
14 this.$.backgroundRearLayer.style.webkitTransform = 'translateZ(0)';
15 this.$.backgroundRearLayer.style.transitionProperty = 'opacity';
16 this.$.backgroundRearLayer.style.transitionDuration = duration;
17 },
18 /** @this Polymer.AppLayout.ElementWithBackground */
19 run: function run(p, y) {
20 if (p >= 1) {
21 this.$.backgroundFrontLayer.style.opacity = 0;
22 this.$.backgroundRearLayer.style.opacity = 1;
23 } else {
24 this.$.backgroundFrontLayer.style.opacity = 1;
25 this.$.backgroundRearLayer.style.opacity = 0;
26 }
27 }
28 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698