@vived/app 4.7.0 → 4.8.1
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.
- package/lib/Components/Ease/Entites/AllLinearEase.d.ts +22 -0
- package/lib/Components/Ease/Entites/AllLinearEase.js +29 -0
- package/lib/Components/Ease/Entites/EaseEntity.d.ts +21 -0
- package/lib/Components/Ease/Entites/EaseEntity.js +8 -0
- package/lib/Components/Ease/index.d.ts +2 -0
- package/lib/Components/Ease/index.js +14 -0
- package/lib/Utilities/easeFunctions.d.ts +19 -0
- package/lib/Utilities/easeFunctions.js +178 -0
- package/lib/Utilities/index.d.ts +1 -0
- package/lib/Utilities/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AppObject } from "../../../AppObject";
|
|
2
|
+
import { EaseEntity } from "./EaseEntity";
|
|
3
|
+
export declare class AllLinearEase extends EaseEntity {
|
|
4
|
+
linearFn: (val: number) => number;
|
|
5
|
+
linear: (val: number) => number;
|
|
6
|
+
quadIn: (val: number) => number;
|
|
7
|
+
quadOut: (val: number) => number;
|
|
8
|
+
quadInOut: (val: number) => number;
|
|
9
|
+
cubicIn: (val: number) => number;
|
|
10
|
+
cubicOut: (val: number) => number;
|
|
11
|
+
cubicInOut: (val: number) => number;
|
|
12
|
+
sinIn: (val: number) => number;
|
|
13
|
+
sinOut: (val: number) => number;
|
|
14
|
+
sinInOut: (val: number) => number;
|
|
15
|
+
expIn: (val: number) => number;
|
|
16
|
+
expOut: (val: number) => number;
|
|
17
|
+
expInOut: (val: number) => number;
|
|
18
|
+
circleIn: (val: number) => number;
|
|
19
|
+
circleOut: (val: number) => number;
|
|
20
|
+
circleInOut: (val: number) => number;
|
|
21
|
+
constructor(appObject: AppObject);
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AllLinearEase = void 0;
|
|
4
|
+
const EaseEntity_1 = require("./EaseEntity");
|
|
5
|
+
class AllLinearEase extends EaseEntity_1.EaseEntity {
|
|
6
|
+
constructor(appObject) {
|
|
7
|
+
super(appObject, EaseEntity_1.EaseEntity.type);
|
|
8
|
+
this.linearFn = (val) => {
|
|
9
|
+
return val;
|
|
10
|
+
};
|
|
11
|
+
this.linear = this.linearFn;
|
|
12
|
+
this.quadIn = this.linearFn;
|
|
13
|
+
this.quadOut = this.linearFn;
|
|
14
|
+
this.quadInOut = this.linearFn;
|
|
15
|
+
this.cubicIn = this.linearFn;
|
|
16
|
+
this.cubicOut = this.linearFn;
|
|
17
|
+
this.cubicInOut = this.linearFn;
|
|
18
|
+
this.sinIn = this.linearFn;
|
|
19
|
+
this.sinOut = this.linearFn;
|
|
20
|
+
this.sinInOut = this.linearFn;
|
|
21
|
+
this.expIn = this.linearFn;
|
|
22
|
+
this.expOut = this.linearFn;
|
|
23
|
+
this.expInOut = this.linearFn;
|
|
24
|
+
this.circleIn = this.linearFn;
|
|
25
|
+
this.circleOut = this.linearFn;
|
|
26
|
+
this.circleInOut = this.linearFn;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.AllLinearEase = AllLinearEase;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AppObjectEntity } from "../../../AppObject";
|
|
2
|
+
import { EaseFn } from "../../../Types";
|
|
3
|
+
export declare abstract class EaseEntity extends AppObjectEntity {
|
|
4
|
+
static type: string;
|
|
5
|
+
abstract linear: EaseFn;
|
|
6
|
+
abstract quadIn: EaseFn;
|
|
7
|
+
abstract quadOut: EaseFn;
|
|
8
|
+
abstract quadInOut: EaseFn;
|
|
9
|
+
abstract cubicIn: EaseFn;
|
|
10
|
+
abstract cubicOut: EaseFn;
|
|
11
|
+
abstract cubicInOut: EaseFn;
|
|
12
|
+
abstract sinIn: EaseFn;
|
|
13
|
+
abstract sinOut: EaseFn;
|
|
14
|
+
abstract sinInOut: EaseFn;
|
|
15
|
+
abstract expIn: EaseFn;
|
|
16
|
+
abstract expOut: EaseFn;
|
|
17
|
+
abstract expInOut: EaseFn;
|
|
18
|
+
abstract circleIn: EaseFn;
|
|
19
|
+
abstract circleOut: EaseFn;
|
|
20
|
+
abstract circleInOut: EaseFn;
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EaseEntity = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
class EaseEntity extends AppObject_1.AppObjectEntity {
|
|
6
|
+
}
|
|
7
|
+
exports.EaseEntity = EaseEntity;
|
|
8
|
+
EaseEntity.type = "EaseEntity";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./Entites/EaseEntity"), exports);
|
|
14
|
+
__exportStar(require("./Entites/AllLinearEase"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare function easeLinear(x: number): number;
|
|
2
|
+
export declare function quadIn(x: number): number;
|
|
3
|
+
export declare function quadOut(x: number): number;
|
|
4
|
+
export declare function quadInOut(x: number): number;
|
|
5
|
+
export declare function cubicIn(x: number): number;
|
|
6
|
+
export declare function cubicOut(x: number): number;
|
|
7
|
+
export declare function cubicInOut(x: number): number;
|
|
8
|
+
export declare function expoIn(x: number): number;
|
|
9
|
+
export declare function expoOut(x: number): number;
|
|
10
|
+
export declare function expoInOut(x: number): number;
|
|
11
|
+
export declare function sinIn(x: number): number;
|
|
12
|
+
export declare function sinOut(x: number): number;
|
|
13
|
+
export declare function sinInOut(x: number): number;
|
|
14
|
+
export declare function quartIn(x: number): number;
|
|
15
|
+
export declare function quartOut(x: number): number;
|
|
16
|
+
export declare function quartInOut(x: number): number;
|
|
17
|
+
export declare function quintIn(x: number): number;
|
|
18
|
+
export declare function quintOut(x: number): number;
|
|
19
|
+
export declare function quintInOut(x: number): number;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.quintInOut = exports.quintOut = exports.quintIn = exports.quartInOut = exports.quartOut = exports.quartIn = exports.sinInOut = exports.sinOut = exports.sinIn = exports.expoInOut = exports.expoOut = exports.expoIn = exports.cubicInOut = exports.cubicOut = exports.cubicIn = exports.quadInOut = exports.quadOut = exports.quadIn = exports.easeLinear = void 0;
|
|
4
|
+
function easeLinear(x) {
|
|
5
|
+
if (x <= 0)
|
|
6
|
+
return 0;
|
|
7
|
+
if (x >= 1)
|
|
8
|
+
return 1;
|
|
9
|
+
return x;
|
|
10
|
+
}
|
|
11
|
+
exports.easeLinear = easeLinear;
|
|
12
|
+
function quadIn(x) {
|
|
13
|
+
if (x <= 0)
|
|
14
|
+
return 0;
|
|
15
|
+
if (x >= 1)
|
|
16
|
+
return 1;
|
|
17
|
+
return x * x;
|
|
18
|
+
}
|
|
19
|
+
exports.quadIn = quadIn;
|
|
20
|
+
function quadOut(x) {
|
|
21
|
+
if (x <= 0)
|
|
22
|
+
return 0;
|
|
23
|
+
if (x >= 1)
|
|
24
|
+
return 1;
|
|
25
|
+
return x * (2 - x);
|
|
26
|
+
}
|
|
27
|
+
exports.quadOut = quadOut;
|
|
28
|
+
function quadInOut(x) {
|
|
29
|
+
if (x <= 0)
|
|
30
|
+
return 0;
|
|
31
|
+
if (x >= 1)
|
|
32
|
+
return 1;
|
|
33
|
+
if (x < 0.5) {
|
|
34
|
+
return 2 * x * x;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
return 1 - Math.pow(-2 * x + 2, 2) / 2;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.quadInOut = quadInOut;
|
|
41
|
+
function cubicIn(x) {
|
|
42
|
+
if (x <= 0)
|
|
43
|
+
return 0;
|
|
44
|
+
if (x >= 1)
|
|
45
|
+
return 1;
|
|
46
|
+
return x * x * x;
|
|
47
|
+
}
|
|
48
|
+
exports.cubicIn = cubicIn;
|
|
49
|
+
function cubicOut(x) {
|
|
50
|
+
if (x <= 0)
|
|
51
|
+
return 0;
|
|
52
|
+
if (x >= 1)
|
|
53
|
+
return 1;
|
|
54
|
+
return --x * x * x + 1;
|
|
55
|
+
}
|
|
56
|
+
exports.cubicOut = cubicOut;
|
|
57
|
+
function cubicInOut(x) {
|
|
58
|
+
if (x <= 0)
|
|
59
|
+
return 0;
|
|
60
|
+
if (x >= 1)
|
|
61
|
+
return 1;
|
|
62
|
+
x *= 2;
|
|
63
|
+
if (x <= 1) {
|
|
64
|
+
return (x * x * x) / 2;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
return ((x -= 2) * x * x + 2) / 2;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.cubicInOut = cubicInOut;
|
|
71
|
+
function expoIn(x) {
|
|
72
|
+
if (x <= 0)
|
|
73
|
+
return 0;
|
|
74
|
+
if (x >= 1)
|
|
75
|
+
return 1;
|
|
76
|
+
return Math.pow(2, 10 * x - 10);
|
|
77
|
+
}
|
|
78
|
+
exports.expoIn = expoIn;
|
|
79
|
+
function expoOut(x) {
|
|
80
|
+
if (x <= 0)
|
|
81
|
+
return 0;
|
|
82
|
+
if (x >= 1)
|
|
83
|
+
return 1;
|
|
84
|
+
return 1 - Math.pow(2, -10 * x);
|
|
85
|
+
}
|
|
86
|
+
exports.expoOut = expoOut;
|
|
87
|
+
function expoInOut(x) {
|
|
88
|
+
if (x <= 0)
|
|
89
|
+
return 0;
|
|
90
|
+
if (x >= 1)
|
|
91
|
+
return 1;
|
|
92
|
+
return x < 0.5
|
|
93
|
+
? Math.pow(2, 20 * x - 10) / 2
|
|
94
|
+
: (2 - Math.pow(2, -20 * x + 10)) / 2;
|
|
95
|
+
}
|
|
96
|
+
exports.expoInOut = expoInOut;
|
|
97
|
+
function sinIn(x) {
|
|
98
|
+
if (x <= 0)
|
|
99
|
+
return 0;
|
|
100
|
+
if (x >= 1)
|
|
101
|
+
return 1;
|
|
102
|
+
return 1 - Math.cos((x * Math.PI) / 2);
|
|
103
|
+
}
|
|
104
|
+
exports.sinIn = sinIn;
|
|
105
|
+
function sinOut(x) {
|
|
106
|
+
if (x <= 0)
|
|
107
|
+
return 0;
|
|
108
|
+
if (x >= 1)
|
|
109
|
+
return 1;
|
|
110
|
+
return Math.sin((x * Math.PI) / 2);
|
|
111
|
+
}
|
|
112
|
+
exports.sinOut = sinOut;
|
|
113
|
+
function sinInOut(x) {
|
|
114
|
+
if (x <= 0)
|
|
115
|
+
return 0;
|
|
116
|
+
if (x >= 1)
|
|
117
|
+
return 1;
|
|
118
|
+
return -(Math.cos(Math.PI * x) - 1) / 2;
|
|
119
|
+
}
|
|
120
|
+
exports.sinInOut = sinInOut;
|
|
121
|
+
function quartIn(x) {
|
|
122
|
+
if (x <= 0)
|
|
123
|
+
return 0;
|
|
124
|
+
if (x >= 1)
|
|
125
|
+
return 1;
|
|
126
|
+
return x * x * x * x;
|
|
127
|
+
}
|
|
128
|
+
exports.quartIn = quartIn;
|
|
129
|
+
function quartOut(x) {
|
|
130
|
+
if (x <= 0)
|
|
131
|
+
return 0;
|
|
132
|
+
if (x >= 1)
|
|
133
|
+
return 1;
|
|
134
|
+
return 1 - Math.pow(1 - x, 4);
|
|
135
|
+
}
|
|
136
|
+
exports.quartOut = quartOut;
|
|
137
|
+
function quartInOut(x) {
|
|
138
|
+
if (x <= 0)
|
|
139
|
+
return 0;
|
|
140
|
+
if (x >= 1)
|
|
141
|
+
return 1;
|
|
142
|
+
if (x < 0.5) {
|
|
143
|
+
return 8 * x * x * x * x;
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
return 1 - Math.pow(-2 * x + 2, 4) / 2;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
exports.quartInOut = quartInOut;
|
|
150
|
+
function quintIn(x) {
|
|
151
|
+
if (x <= 0)
|
|
152
|
+
return 0;
|
|
153
|
+
if (x >= 1)
|
|
154
|
+
return 1;
|
|
155
|
+
return x * x * x * x * x;
|
|
156
|
+
}
|
|
157
|
+
exports.quintIn = quintIn;
|
|
158
|
+
function quintOut(x) {
|
|
159
|
+
if (x <= 0)
|
|
160
|
+
return 0;
|
|
161
|
+
if (x >= 1)
|
|
162
|
+
return 1;
|
|
163
|
+
return 1 - Math.pow(1 - x, 5);
|
|
164
|
+
}
|
|
165
|
+
exports.quintOut = quintOut;
|
|
166
|
+
function quintInOut(x) {
|
|
167
|
+
if (x <= 0)
|
|
168
|
+
return 0;
|
|
169
|
+
if (x >= 1)
|
|
170
|
+
return 1;
|
|
171
|
+
if (x < 0.5) {
|
|
172
|
+
return 16 * x * x * x * x * x;
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
return 1 - Math.pow(-2 * x + 2, 5) / 2;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
exports.quintInOut = quintInOut;
|
package/lib/Utilities/index.d.ts
CHANGED
package/lib/Utilities/index.js
CHANGED
|
@@ -13,3 +13,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
__exportStar(require("./degreesToRadians"), exports);
|
|
14
14
|
__exportStar(require("./LengthConverters"), exports);
|
|
15
15
|
__exportStar(require("./generateUniqueID"), exports);
|
|
16
|
+
__exportStar(require("./easeFunctions"), exports);
|