8 Polymer.NeonSharedElementAnimationBehavior
11 configure: function(config) {
12 var shared = this.findSharedElements(config);
17 var fromRect = shared.from.getBoundingClientRect();
18 var toRect = shared.to.getBoundingClientRect();
20 var deltaLeft = fromRect.left - toRect.left;
21 var deltaTop = fromRect.top - toRect.top;
22 var deltaWidth = fromRect.width / toRect.width;
23 var deltaHeight = fromRect.height / toRect.height;
25 this.setPrefixedProperty(shared.to, 'transformOrigin', '0 0');
26 shared.to.style.zIndex = 10000;
27 shared.from.style.visibility = 'hidden';
29 this._effect = new KeyframeEffect(shared.to, [
30 {'transform': 'translate(' + deltaLeft + 'px,' + deltaTop + 'px) scale(' + deltaWidth + ',' + deltaHeight + ')'},
32 ], this.timingFromConfig(config));
37 complete: function(config) {
38 var shared = this.findSharedElements(config);
42 shared.to.style.zIndex = '';
43 shared.from.style.visibility = '';