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

Unified 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, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v1_0/components-chromium/app-layout/app-scroll-effects/effects/fade-background-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/app-layout/app-scroll-effects/effects/fade-background-extracted.js b/third_party/polymer/v1_0/components-chromium/app-layout/app-scroll-effects/effects/fade-background-extracted.js
new file mode 100644
index 0000000000000000000000000000000000000000..ea2ac26f50ea6c1fb682a0f833f4f2faa4d88bed
--- /dev/null
+++ b/third_party/polymer/v1_0/components-chromium/app-layout/app-scroll-effects/effects/fade-background-extracted.js
@@ -0,0 +1,28 @@
+/**
+ * Upon scrolling past a threshold, fade in the rear background layer and fade out the front
+ * background layer (opacity CSS transitioned over time).
+ */
+ Polymer.AppLayout.registerEffect('fade-background', {
+ /** @this Polymer.AppLayout.ElementWithBackground */
+ setUp: function setUp(config) {
+ var duration = config.duration || '0.5s';
+ this.$.backgroundFrontLayer.style.willChange = 'opacity';
+ this.$.backgroundFrontLayer.style.webkitTransform = 'translateZ(0)';
+ this.$.backgroundFrontLayer.style.transitionProperty = 'opacity';
+ this.$.backgroundFrontLayer.style.transitionDuration = duration;
+ this.$.backgroundRearLayer.style.willChange = 'opacity';
+ this.$.backgroundRearLayer.style.webkitTransform = 'translateZ(0)';
+ this.$.backgroundRearLayer.style.transitionProperty = 'opacity';
+ this.$.backgroundRearLayer.style.transitionDuration = duration;
+ },
+ /** @this Polymer.AppLayout.ElementWithBackground */
+ run: function run(p, y) {
+ if (p >= 1) {
+ this.$.backgroundFrontLayer.style.opacity = 0;
+ this.$.backgroundRearLayer.style.opacity = 1;
+ } else {
+ this.$.backgroundFrontLayer.style.opacity = 1;
+ this.$.backgroundRearLayer.style.opacity = 0;
+ }
+ }
+ });

Powered by Google App Engine
This is Rietveld 408576698