wgge 2.0.40 → 2.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
export const EASING_FLAT = (x) => x;
|
|
2
2
|
export const EASING_EXPONENTIAL_IN = (x, e = 2) => Math.pow(x, e);
|
|
3
|
+
export const EASING_EXPONENTIAL_OUT = (x, e = 2) => 1 - Math.pow(1 - x, e);
|
|
3
4
|
export const EASING_EXPONENTIAL_IN_OUT = (x, e = 2) => (x <= 0.5) ? Math.pow(x * 2, e) / 2 : 1 - Math.pow(2 - x * 2, e) / 2;
|
|
4
5
|
export const EASING_QUAD_IN = EASING_EXPONENTIAL_IN;
|
|
6
|
+
export const EASING_QUAD_OUT = EASING_EXPONENTIAL_OUT;
|
|
5
7
|
export const EASING_QUAD_IN_OUT = EASING_EXPONENTIAL_IN_OUT;
|
|
6
8
|
export const EASING_CUBIC_IN = (x) => EASING_EXPONENTIAL_IN(x, 3);
|
|
9
|
+
export const EASING_CUBIC_OUT = (x) => EASING_EXPONENTIAL_OUT(x, 3);
|
|
7
10
|
export const EASING_CUBIC_IN_OUT = (x) => EASING_EXPONENTIAL_IN_OUT(x, 3);
|
|
8
11
|
export const EASING_SPHERE_IN = (v) => 1 - Math.sqrt(1 - Math.pow(v, 2));
|
|
9
12
|
export const EASING_SPHERE_OUT = (v) => Math.sqrt(1 - Math.pow(1 - v, 2));
|
|
10
|
-
export const
|
|
13
|
+
export const EASING_SIN_IN = (x) => Math.sin((x - 1) * Math.PI * 0.5) + 1;
|
|
14
|
+
export const EASING_SIN_OUT = (x) => Math.sin(x * Math.PI * 0.5);
|
|
15
|
+
export const EASING_SIN_IN_OUT = (x) => 0.5 + (Math.sin((x - 0.5) * Math.PI) / 2);
|
|
11
16
|
|
|
12
17
|
export default class ProgressValue {
|
|
13
18
|
start;
|
|
@@ -30,7 +30,7 @@ export default class ControlsController extends ControllerBase {
|
|
|
30
30
|
|
|
31
31
|
onKeyDown(event) {
|
|
32
32
|
const key = event.keyCode ? event.keyCode : event.charCode;
|
|
33
|
-
if (this.model.logPressedKeys.get()) console.log(key);
|
|
33
|
+
if (this.model.logPressedKeys.get()) console.log(`key pressed: ${key}`);
|
|
34
34
|
this.model.triggerEvent(`key-down-${key}`);
|
|
35
35
|
this.model.triggerEvent(`key-down`, key);
|
|
36
36
|
}
|