/**
@license
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
*/
import"../app-scroll-effects-behavior.js";import{ElementWithBackground as r,registerEffect as a}from"../../helpers/helpers.js";a("fade-background",{setUp:function setUp(r){var a={},e=r.duration||"0.5s";a.backgroundFrontLayer=this._getDOMRef("backgroundFrontLayer"),a.backgroundRearLayer=this._getDOMRef("backgroundRearLayer"),a.backgroundFrontLayer.style.willChange="opacity",a.backgroundFrontLayer.style.webkitTransform="translateZ(0)",a.backgroundFrontLayer.style.transitionProperty="opacity",a.backgroundFrontLayer.style.transitionDuration=e,a.backgroundRearLayer.style.willChange="opacity",a.backgroundRearLayer.style.webkitTransform="translateZ(0)",a.backgroundRearLayer.style.transitionProperty="opacity",a.backgroundRearLayer.style.transitionDuration=e,this._fxFadeBackground=a},run:function run(r,a){var e=this._fxFadeBackground;r>=1?(e.backgroundFrontLayer.style.opacity=0,e.backgroundRearLayer.style.opacity=1):(e.backgroundFrontLayer.style.opacity=1,e.backgroundRearLayer.style.opacity=0)},tearDown:function tearDown(){delete this._fxFadeBackground}});