invert () {

    let willChange = [];

    if (this.first_.layout === null)
      throw new Error ('You must call first() before invert()');

    if (this.last_.layout === null)
      throw new Error ('You must call last() before invert()');

    // Update the invert values.
    this.invert_.x = this.first_.layout.left - this.last_.layout.left;
    this.invert_.y = this.first_.layout.top - this.last_.layout.top;
    this.invert_.sx = this.first_.layout.width / this.last_.layout.width;
    this.invert_.sy = this.first_.layout.height / this.last_.layout.height;
    this.invert_.a = this.last_.opacity - this.first_.opacity;

    // Apply the transform.
    if (this.updateTransform_) {
      this.element_.style.transformOrigin = '0 0';
      this.element_.style.transform =
          `translate(${this.invert_.x}px, ${this.invert_.y}px)
           scale(${this.invert_.sx}, ${this.invert_.sy})`;

      willChange.push('transform');
    }

    if (this.updateOpacity_) {
      this.element_.style.opacity = this.first_.opacity;
      willChange.push('opacity');
    }

    this.element_.style.willChange = willChange.join(',');
  }
Moves the element back to its start position, size, and opacity by applying
changes to its transform and opacity values.