| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var api = {}; | 5 var api = {}; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Enumeration of scene update commands. | 8 * Enumeration of scene update commands. |
| 9 * @enum {number} | 9 * @enum {number} |
| 10 * @const | 10 * @const |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 359 |
| 360 /** | 360 /** |
| 361 * Enumeration of easing type. | 361 * Enumeration of easing type. |
| 362 * @enum {number} | 362 * @enum {number} |
| 363 * @const | 363 * @const |
| 364 */ | 364 */ |
| 365 api.EasingType = { | 365 api.EasingType = { |
| 366 'LINEAR': 0, | 366 'LINEAR': 0, |
| 367 'CUBICBEZIER': 1, | 367 'CUBICBEZIER': 1, |
| 368 'EASEIN': 2, | 368 'EASEIN': 2, |
| 369 'EASEOUT': 3 | 369 'EASEOUT': 3, |
| 370 'EASEINOUT': 4 |
| 370 }; | 371 }; |
| 371 | 372 |
| 372 /** @const */ var DEFAULT_EASING_POW = 2; | 373 /** @const */ var DEFAULT_EASING_POW = 2; |
| 373 /** @const */ var DEFAULT_CUBIC_BEZIER_P1X = 0.25; | 374 /** @const */ var DEFAULT_CUBIC_BEZIER_P1X = 0.25; |
| 374 /** @const */ var DEFAULT_CUBIC_BEZIER_P1Y = 0; | 375 /** @const */ var DEFAULT_CUBIC_BEZIER_P1Y = 0; |
| 375 /** @const */ var DEFAULT_CUBIC_BEZIER_P2X = 0.75; | 376 /** @const */ var DEFAULT_CUBIC_BEZIER_P2X = 0.75; |
| 376 /** @const */ var DEFAULT_CUBIC_BEZIER_P2Y = 1; | 377 /** @const */ var DEFAULT_CUBIC_BEZIER_P2Y = 1; |
| 377 | 378 |
| 378 /** | 379 /** |
| 379 * Abstract easing base class. | 380 * Abstract easing base class. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 } | 413 } |
| 413 } | 414 } |
| 414 | 415 |
| 415 api.OutEasing = class extends api.Easing { | 416 api.OutEasing = class extends api.Easing { |
| 416 constructor(pow = DEFAULT_EASING_POW) { | 417 constructor(pow = DEFAULT_EASING_POW) { |
| 417 super(api.EasingType.EASEOUT); | 418 super(api.EasingType.EASEOUT); |
| 418 this.pow = pow; | 419 this.pow = pow; |
| 419 } | 420 } |
| 420 } | 421 } |
| 421 | 422 |
| 423 api.InOutEasing = class extends api.Easing { |
| 424 constructor(pow = DEFAULT_EASING_POW) { |
| 425 super(api.EasingType.EASEINOUT); |
| 426 this.pow = pow; |
| 427 } |
| 428 } |
| 429 |
| 422 /** | 430 /** |
| 423 * Base animation class. An animation can vary only one object property. | 431 * Base animation class. An animation can vary only one object property. |
| 424 * @struct | 432 * @struct |
| 425 */ | 433 */ |
| 426 api.Animation = class { | 434 api.Animation = class { |
| 427 constructor(elementId, durationMs) { | 435 constructor(elementId, durationMs) { |
| 428 /** @private {number} */ | 436 /** @private {number} */ |
| 429 this.id = -1; | 437 this.id = -1; |
| 430 /** @private {number} */ | 438 /** @private {number} */ |
| 431 this.meshId = elementId; | 439 this.meshId = elementId; |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 if ('updateTab' in dict) { | 662 if ('updateTab' in dict) { |
| 655 this.onUpdateTab(dict['updateTab']); | 663 this.onUpdateTab(dict['updateTab']); |
| 656 } | 664 } |
| 657 if ('removeTab' in dict) { | 665 if ('removeTab' in dict) { |
| 658 this.onRemoveTab(dict['removeTab']); | 666 this.onRemoveTab(dict['removeTab']); |
| 659 } | 667 } |
| 660 | 668 |
| 661 this.onCommandHandlerFinished() | 669 this.onCommandHandlerFinished() |
| 662 } | 670 } |
| 663 }; | 671 }; |
| OLD | NEW |