Chromium Code Reviews| 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 vrShellUi = (function() { | 5 var vrShellUi = (function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 let ui = new scene.Scene(); | 8 let ui = new scene.Scene(); |
| 9 let uiManager; | 9 let uiManager; |
| 10 let nativeCommandHandler; | 10 let nativeCommandHandler; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 y = this.MENU_MODE_SCREEN_ELEVATION; | 89 y = this.MENU_MODE_SCREEN_ELEVATION; |
| 90 z = -this.MENU_MODE_SCREEN_DISTANCE; | 90 z = -this.MENU_MODE_SCREEN_DISTANCE; |
| 91 height = this.MENU_MODE_SCREEN_HEIGHT; | 91 height = this.MENU_MODE_SCREEN_HEIGHT; |
| 92 } else if (this.fullscreen) { | 92 } else if (this.fullscreen) { |
| 93 z = -this.FULLSCREEN_DISTANCE; | 93 z = -this.FULLSCREEN_DISTANCE; |
| 94 } | 94 } |
| 95 | 95 |
| 96 let anim; | 96 let anim; |
| 97 anim = new api.Animation(this.elementId, ANIM_DURATION); | 97 anim = new api.Animation(this.elementId, ANIM_DURATION); |
| 98 anim.setTranslation(0, y, z); | 98 anim.setTranslation(0, y, z); |
| 99 anim.setEasing(new api.InOutEasing(2)); | |
|
cjgrant
2017/02/16 15:10:25
We should probably have a module level constant EA
tiborg
2017/02/16 18:39:33
Set default values for the easing. So, we don't ne
cjgrant
2017/02/16 20:54:07
Acknowledged.
| |
| 99 ui.addAnimation(anim); | 100 ui.addAnimation(anim); |
| 100 anim = new api.Animation(this.elementId, ANIM_DURATION); | 101 anim = new api.Animation(this.elementId, ANIM_DURATION); |
| 101 anim.setSize(height * this.SCREEN_RATIO, height); | 102 anim.setSize(height * this.SCREEN_RATIO, height); |
| 102 anim.setEasing(new api.InEasing(2)); | 103 anim.setEasing(new api.InOutEasing(2)); |
| 103 ui.addAnimation(anim); | 104 ui.addAnimation(anim); |
| 104 } | 105 } |
| 105 | 106 |
| 106 // TODO(crbug/643815): Add a method setting aspect ratio (and possible | 107 // TODO(crbug/643815): Add a method setting aspect ratio (and possible |
| 107 // animation of changing it). | 108 // animation of changing it). |
| 108 | 109 |
| 109 getElementId() { | 110 getElementId() { |
| 110 return this.elementId; | 111 return this.elementId; |
| 111 } | 112 } |
| 112 }; | 113 }; |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 950 nativeCommandHandler.handleCommand(dict); | 951 nativeCommandHandler.handleCommand(dict); |
| 951 } | 952 } |
| 952 | 953 |
| 953 return { | 954 return { |
| 954 initialize: initialize, | 955 initialize: initialize, |
| 955 command: command, | 956 command: command, |
| 956 }; | 957 }; |
| 957 })(); | 958 })(); |
| 958 | 959 |
| 959 window.addEventListener('load', vrShellUi.initialize); | 960 window.addEventListener('load', vrShellUi.initialize); |
| OLD | NEW |