ziko 0.38.1 → 0.40.0
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/dist/ziko.cjs +962 -1360
- package/dist/ziko.js +962 -1360
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +902 -1342
- package/package.json +1 -1
- package/src/data/index.js +2 -2
- package/src/data/string/checkers.js +27 -0
- package/src/data/string/converters.js +24 -0
- package/src/data/string/index.js +2 -1
- package/src/data/string-dep/index.js +1 -0
- package/src/events/types/clipboard.d.ts +2 -2
- package/src/events/types/focus.d.ts +2 -2
- package/src/events/types/pointer.d.ts +2 -2
- package/src/hooks/use-state.js +11 -8
- package/src/index.js +2 -1
- package/src/math/index.js +17 -17
- package/src/reactivity/hooks/UI/index.js +1 -1
- package/src/reactivity/hooks/UI/useRoot.js +3 -3
- package/src/time/animation/index.js +88 -70
- package/src/time/clocks/clock.js +62 -0
- package/src/time/clocks/index.js +3 -0
- package/src/time/clocks/scheduler.js +69 -0
- package/src/time/clocks/tick.js +34 -0
- package/src/time/converters/index.js +1 -0
- package/src/time/delay/index.js +2 -0
- package/src/time/delay/sleep.js +3 -0
- package/src/time/delay/timeout.js +15 -0
- package/src/time/ease/index.js +77 -0
- package/src/time/index.js +6 -9
- package/src/time/loop/index.js +67 -51
- package/src/time/utils/index.js +2 -2
- package/src/ui/__methods__/attrs.js +49 -0
- package/src/ui/__methods__/index.js +2 -1
- package/src/ui/__methods__/style.js +34 -0
- package/src/ui/__utils__/index.js +2 -2
- package/src/ui/constructors/{ZikoUIElement.js → UIElement.js} +23 -64
- package/src/ui/constructors/{ZikoUINode.js → UINode.js} +2 -2
- package/src/ui/constructors/style/index.js +2 -1
- package/src/ui/flex/index.js +8 -8
- package/src/ui/graphics/canvas.js +2 -2
- package/src/ui/graphics/svg.js +2 -2
- package/src/ui/grid/index.js +4 -4
- package/src/ui/index.js +2 -2
- package/src/ui/suspense/index.js +3 -3
- package/src/ui/tags/index.d.ts.txt +125 -125
- package/src/ui/tags/index.js +12 -16
- package/src/ui/text/index.js +2 -2
- package/src/ui/wrapper/index.js +3 -3
- package/src/time/utils/ease.js +0 -144
- /package/src/data/{string → string-dep}/patterns.js +0 -0
- /package/src/data/{string → string-dep}/string.js +0 -0
|
@@ -1,140 +1,140 @@
|
|
|
1
|
-
import
|
|
1
|
+
import UIElement from "../elements/UIElement.js";
|
|
2
2
|
interface HtmlTags {
|
|
3
|
-
a:
|
|
4
|
-
abbr:
|
|
5
|
-
address:
|
|
6
|
-
area:
|
|
7
|
-
article:
|
|
8
|
-
aside:
|
|
9
|
-
audio:
|
|
10
|
-
b:
|
|
11
|
-
base:
|
|
12
|
-
bdi:
|
|
13
|
-
bdo:
|
|
14
|
-
blockquote:
|
|
15
|
-
body:
|
|
16
|
-
br:
|
|
17
|
-
button:
|
|
18
|
-
canvas:
|
|
19
|
-
caption:
|
|
20
|
-
cite:
|
|
21
|
-
code:
|
|
22
|
-
col:
|
|
23
|
-
colgroup:
|
|
24
|
-
data:
|
|
25
|
-
datalist:
|
|
26
|
-
dd:
|
|
27
|
-
del:
|
|
28
|
-
details:
|
|
29
|
-
dfn:
|
|
30
|
-
dialog:
|
|
31
|
-
div:
|
|
32
|
-
dl:
|
|
33
|
-
dt:
|
|
34
|
-
em:
|
|
35
|
-
embed:
|
|
36
|
-
fieldset:
|
|
37
|
-
figcaption:
|
|
38
|
-
figure:
|
|
39
|
-
footer:
|
|
40
|
-
form:
|
|
41
|
-
h1:
|
|
42
|
-
h2:
|
|
43
|
-
h3:
|
|
44
|
-
h4:
|
|
45
|
-
h5:
|
|
46
|
-
h6:
|
|
47
|
-
head:
|
|
48
|
-
header:
|
|
49
|
-
hgroup:
|
|
50
|
-
hr:
|
|
51
|
-
html:
|
|
52
|
-
i:
|
|
53
|
-
iframe:
|
|
54
|
-
img:
|
|
55
|
-
input:
|
|
56
|
-
ins:
|
|
57
|
-
kbd:
|
|
58
|
-
label:
|
|
59
|
-
legend:
|
|
60
|
-
li:
|
|
61
|
-
link:
|
|
62
|
-
main:
|
|
63
|
-
map:
|
|
64
|
-
mark:
|
|
65
|
-
meta:
|
|
66
|
-
meter:
|
|
67
|
-
nav:
|
|
68
|
-
noscript:
|
|
69
|
-
object:
|
|
70
|
-
ol:
|
|
71
|
-
optgroup:
|
|
72
|
-
option:
|
|
73
|
-
output:
|
|
74
|
-
p:
|
|
75
|
-
param:
|
|
76
|
-
picture:
|
|
77
|
-
pre:
|
|
78
|
-
progress:
|
|
79
|
-
q:
|
|
80
|
-
rp:
|
|
81
|
-
rt:
|
|
82
|
-
ruby:
|
|
83
|
-
s:
|
|
84
|
-
samp:
|
|
85
|
-
script:
|
|
86
|
-
section:
|
|
87
|
-
select:
|
|
88
|
-
small:
|
|
89
|
-
source:
|
|
90
|
-
span:
|
|
91
|
-
strong:
|
|
92
|
-
style:
|
|
93
|
-
sub:
|
|
94
|
-
summary:
|
|
95
|
-
sup:
|
|
96
|
-
table:
|
|
97
|
-
tbody:
|
|
98
|
-
td:
|
|
99
|
-
template:
|
|
100
|
-
textarea:
|
|
101
|
-
tfoot:
|
|
102
|
-
th:
|
|
103
|
-
thead:
|
|
104
|
-
time:
|
|
105
|
-
title:
|
|
106
|
-
tr:
|
|
107
|
-
track:
|
|
108
|
-
u:
|
|
109
|
-
ul:
|
|
110
|
-
var:
|
|
111
|
-
video:
|
|
112
|
-
wbr:
|
|
3
|
+
a: UIElement;
|
|
4
|
+
abbr: UIElement;
|
|
5
|
+
address: UIElement;
|
|
6
|
+
area: UIElement;
|
|
7
|
+
article: UIElement;
|
|
8
|
+
aside: UIElement;
|
|
9
|
+
audio: UIElement;
|
|
10
|
+
b: UIElement;
|
|
11
|
+
base: UIElement;
|
|
12
|
+
bdi: UIElement;
|
|
13
|
+
bdo: UIElement;
|
|
14
|
+
blockquote: UIElement;
|
|
15
|
+
body: UIElement;
|
|
16
|
+
br: UIElement;
|
|
17
|
+
button: UIElement;
|
|
18
|
+
canvas: UIElement;
|
|
19
|
+
caption: UIElement;
|
|
20
|
+
cite: UIElement;
|
|
21
|
+
code: UIElement;
|
|
22
|
+
col: UIElement;
|
|
23
|
+
colgroup: UIElement;
|
|
24
|
+
data: UIElement;
|
|
25
|
+
datalist: UIElement;
|
|
26
|
+
dd: UIElement;
|
|
27
|
+
del: UIElement;
|
|
28
|
+
details: UIElement;
|
|
29
|
+
dfn: UIElement;
|
|
30
|
+
dialog: UIElement;
|
|
31
|
+
div: UIElement;
|
|
32
|
+
dl: UIElement;
|
|
33
|
+
dt: UIElement;
|
|
34
|
+
em: UIElement;
|
|
35
|
+
embed: UIElement;
|
|
36
|
+
fieldset: UIElement;
|
|
37
|
+
figcaption: UIElement;
|
|
38
|
+
figure: UIElement;
|
|
39
|
+
footer: UIElement;
|
|
40
|
+
form: UIElement;
|
|
41
|
+
h1: UIElement;
|
|
42
|
+
h2: UIElement;
|
|
43
|
+
h3: UIElement;
|
|
44
|
+
h4: UIElement;
|
|
45
|
+
h5: UIElement;
|
|
46
|
+
h6: UIElement;
|
|
47
|
+
head: UIElement;
|
|
48
|
+
header: UIElement;
|
|
49
|
+
hgroup: UIElement;
|
|
50
|
+
hr: UIElement;
|
|
51
|
+
html: UIElement;
|
|
52
|
+
i: UIElement;
|
|
53
|
+
iframe: UIElement;
|
|
54
|
+
img: UIElement;
|
|
55
|
+
input: UIElement;
|
|
56
|
+
ins: UIElement;
|
|
57
|
+
kbd: UIElement;
|
|
58
|
+
label: UIElement;
|
|
59
|
+
legend: UIElement;
|
|
60
|
+
li: UIElement;
|
|
61
|
+
link: UIElement;
|
|
62
|
+
main: UIElement;
|
|
63
|
+
map: UIElement;
|
|
64
|
+
mark: UIElement;
|
|
65
|
+
meta: UIElement;
|
|
66
|
+
meter: UIElement;
|
|
67
|
+
nav: UIElement;
|
|
68
|
+
noscript: UIElement;
|
|
69
|
+
object: UIElement;
|
|
70
|
+
ol: UIElement;
|
|
71
|
+
optgroup: UIElement;
|
|
72
|
+
option: UIElement;
|
|
73
|
+
output: UIElement;
|
|
74
|
+
p: UIElement;
|
|
75
|
+
param: UIElement;
|
|
76
|
+
picture: UIElement;
|
|
77
|
+
pre: UIElement;
|
|
78
|
+
progress: UIElement;
|
|
79
|
+
q: UIElement;
|
|
80
|
+
rp: UIElement;
|
|
81
|
+
rt: UIElement;
|
|
82
|
+
ruby: UIElement;
|
|
83
|
+
s: UIElement;
|
|
84
|
+
samp: UIElement;
|
|
85
|
+
script: UIElement;
|
|
86
|
+
section: UIElement;
|
|
87
|
+
select: UIElement;
|
|
88
|
+
small: UIElement;
|
|
89
|
+
source: UIElement;
|
|
90
|
+
span: UIElement;
|
|
91
|
+
strong: UIElement;
|
|
92
|
+
style: UIElement;
|
|
93
|
+
sub: UIElement;
|
|
94
|
+
summary: UIElement;
|
|
95
|
+
sup: UIElement;
|
|
96
|
+
table: UIElement;
|
|
97
|
+
tbody: UIElement;
|
|
98
|
+
td: UIElement;
|
|
99
|
+
template: UIElement;
|
|
100
|
+
textarea: UIElement;
|
|
101
|
+
tfoot: UIElement;
|
|
102
|
+
th: UIElement;
|
|
103
|
+
thead: UIElement;
|
|
104
|
+
time: UIElement;
|
|
105
|
+
title: UIElement;
|
|
106
|
+
tr: UIElement;
|
|
107
|
+
track: UIElement;
|
|
108
|
+
u: UIElement;
|
|
109
|
+
ul: UIElement;
|
|
110
|
+
var: UIElement;
|
|
111
|
+
video: UIElement;
|
|
112
|
+
wbr: UIElement;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
interface SvgTags {
|
|
116
|
-
svg:
|
|
117
|
-
circle:
|
|
118
|
-
rect:
|
|
119
|
-
line:
|
|
120
|
-
path:
|
|
121
|
-
g:
|
|
122
|
-
text:
|
|
116
|
+
svg: UIElement;
|
|
117
|
+
circle: UIElement;
|
|
118
|
+
rect: UIElement;
|
|
119
|
+
line: UIElement;
|
|
120
|
+
path: UIElement;
|
|
121
|
+
g: UIElement;
|
|
122
|
+
text: UIElement;
|
|
123
123
|
//...
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
interface MathTags {
|
|
127
|
-
math:
|
|
128
|
-
mrow:
|
|
129
|
-
mi:
|
|
130
|
-
mo:
|
|
131
|
-
mn:
|
|
132
|
-
ms:
|
|
127
|
+
math: UIElement;
|
|
128
|
+
mrow: UIElement;
|
|
129
|
+
mi: UIElement;
|
|
130
|
+
mo: UIElement;
|
|
131
|
+
mn: UIElement;
|
|
132
|
+
ms: UIElement;
|
|
133
133
|
//...
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
export type Tags = HtmlTags & SvgTags & MathTags & {
|
|
137
|
-
[key: string]:
|
|
137
|
+
[key: string]: UIElement;
|
|
138
138
|
};
|
|
139
139
|
|
|
140
140
|
declare const tags: Tags;
|
package/src/ui/tags/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import UIElement from "../constructors/UIElement.js";
|
|
2
2
|
import { HTMLTags, SVGTags } from "./tags-list.js";
|
|
3
3
|
import { isStateGetter } from "../../hooks/use-state.js";
|
|
4
4
|
const _h=(tag, type, attributes, ...children)=>{
|
|
5
5
|
const { name, style, ...attrs } = attributes;
|
|
6
|
-
let element = new
|
|
6
|
+
let element = new UIElement(tag, name, type);
|
|
7
7
|
style && element.style(style);
|
|
8
8
|
attrs && element.setAttr(attrs);
|
|
9
9
|
children && element.append(...children);
|
|
@@ -19,27 +19,23 @@ const tags = new Proxy({}, {
|
|
|
19
19
|
let type ;
|
|
20
20
|
if(HTMLTags.includes(tag)) type = 'html'
|
|
21
21
|
if(SVGTags.includes(tag)) type = 'svg'
|
|
22
|
-
|
|
22
|
+
return (...args)=>{
|
|
23
23
|
console.log(isStateGetter(args[0]))
|
|
24
|
-
// if(typeof args[0] === 'function') {
|
|
25
|
-
// console.log(args[0], args[0]?.() instanceof StateGetter)
|
|
26
|
-
// globalThis.a = args[0]
|
|
27
|
-
// console.log({t : a.constructor})
|
|
28
|
-
// }
|
|
29
24
|
if(
|
|
30
25
|
['string', 'number'].includes(typeof args[0])
|
|
31
|
-
|| args[0] instanceof
|
|
26
|
+
|| args[0] instanceof UIElement
|
|
32
27
|
|| (typeof args[0] === 'function' && args[0]().isStateGetter())
|
|
33
|
-
) return new
|
|
34
|
-
|
|
28
|
+
) return new UIElement({element : tag, name : tag, type}).append(...args);
|
|
29
|
+
// console.log(args[0])
|
|
30
|
+
return new UIElement({element : tag}).setAttr(args.shift()).append(...args)
|
|
35
31
|
}
|
|
36
|
-
// if(SVGTags.includes(tag)) return (...args) => new
|
|
32
|
+
// if(SVGTags.includes(tag)) return (...args) => new UIElement(tag,"",{el_type : "svg"}).append(...args);
|
|
37
33
|
// return (...args)=>{
|
|
38
|
-
// if(!(args[0] instanceof
|
|
34
|
+
// if(!(args[0] instanceof UIElement) && args[0] instanceof Object){
|
|
39
35
|
// let attributes = args.shift()
|
|
40
|
-
// return new
|
|
36
|
+
// return new UIElement(tag).setAttr(attributes).append(...args)
|
|
41
37
|
// }
|
|
42
|
-
// return new
|
|
38
|
+
// return new UIElement(tag).append(...args);
|
|
43
39
|
// }
|
|
44
40
|
// // switch(tag){
|
|
45
41
|
// case "html" : globalThis?.document?.createElement("html")
|
|
@@ -49,7 +45,7 @@ const tags = new Proxy({}, {
|
|
|
49
45
|
// case "meta" :
|
|
50
46
|
// case "srcipt":
|
|
51
47
|
// case "body" : return null; break;
|
|
52
|
-
// default : return new
|
|
48
|
+
// default : return new UIElement(tag);
|
|
53
49
|
// }
|
|
54
50
|
}
|
|
55
51
|
});
|
package/src/ui/text/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
class ZikoUIText extends
|
|
1
|
+
import UINode from "../constructors/UINode.js";
|
|
2
|
+
class ZikoUIText extends UINode {
|
|
3
3
|
constructor(...value) {
|
|
4
4
|
super("span", "text", false, ...value);
|
|
5
5
|
this.element = globalThis?.document?.createTextNode(...value)
|
package/src/ui/wrapper/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
class ZikoUIXMLWrapper extends
|
|
1
|
+
import UIElement from "../constructors/UIElement.js";
|
|
2
|
+
class ZikoUIXMLWrapper extends UIElement{
|
|
3
3
|
constructor(XMLContent, type){
|
|
4
|
-
super("div", "")
|
|
4
|
+
super({element : "div", name : ""})
|
|
5
5
|
this.element.append(type==="svg"?svg2dom(XMLContent):html2dom(XMLContent))
|
|
6
6
|
}
|
|
7
7
|
}
|
package/src/time/utils/ease.js
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
const Ease={
|
|
2
|
-
Linear:function(t){
|
|
3
|
-
return t;
|
|
4
|
-
},
|
|
5
|
-
InSin(t){
|
|
6
|
-
return 1 - Math.cos((t * Math.PI) / 2);
|
|
7
|
-
},
|
|
8
|
-
OutSin(t){
|
|
9
|
-
return Math.sin((t * Math.PI) / 2);
|
|
10
|
-
},
|
|
11
|
-
InOutSin(t){
|
|
12
|
-
return -(Math.cos(Math.PI * t) - 1) / 2;
|
|
13
|
-
},
|
|
14
|
-
InQuad(t){
|
|
15
|
-
return t**2;
|
|
16
|
-
},
|
|
17
|
-
OutQuad(t){
|
|
18
|
-
return 1 - Math.pow((1 - t),2)
|
|
19
|
-
},
|
|
20
|
-
InOutQuad(t){
|
|
21
|
-
return t < 0.5 ? 2 * Math.pow(t,2) : 1 - Math.pow(-2 * t + 2, 2) / 2;
|
|
22
|
-
},
|
|
23
|
-
InCubic(t){
|
|
24
|
-
return t**3;
|
|
25
|
-
},
|
|
26
|
-
OutCubic(t){
|
|
27
|
-
return 1 - Math.pow((1 - t),3)
|
|
28
|
-
},
|
|
29
|
-
InOutCubic(t){
|
|
30
|
-
return t < 0.5 ? 4 * Math.pow(t,3) : 1 - Math.pow(-2 * t + 2, 3) / 2;
|
|
31
|
-
},
|
|
32
|
-
InQuart(t){
|
|
33
|
-
return t**4;
|
|
34
|
-
},
|
|
35
|
-
OutQuart(t){
|
|
36
|
-
return 1 - Math.pow((1 - t),4);
|
|
37
|
-
},
|
|
38
|
-
InOutQuart(t){
|
|
39
|
-
return t < 0.5 ? 8 * Math.pow(t,4) : 1 - Math.pow(-2 * t + 2, 4) / 2;
|
|
40
|
-
},
|
|
41
|
-
InQuint(t){
|
|
42
|
-
return t**5;
|
|
43
|
-
},
|
|
44
|
-
OutQuint(t){
|
|
45
|
-
return 1 - Math.pow((1 - t),5);
|
|
46
|
-
},
|
|
47
|
-
InOutQuint(t){
|
|
48
|
-
return t < 0.5 ? 16 * Math.pow(t,5) : 1 - Math.pow(-2 * t + 2, 5) / 2;
|
|
49
|
-
},
|
|
50
|
-
InExpo(t){
|
|
51
|
-
return t === 0 ? 0 : Math.pow(2, 10 * t - 10);
|
|
52
|
-
},
|
|
53
|
-
OutExpo(t){
|
|
54
|
-
return t === 1 ? 1 : 1 - Math.pow(2, -10 * t);
|
|
55
|
-
},
|
|
56
|
-
InOutExpo(t){
|
|
57
|
-
return t === 0? 0: t === 1? 1: t < 0.5 ? Math.pow(2, 20 * t - 10) / 2: (2 - Math.pow(2, -20 * t + 10)) / 2;
|
|
58
|
-
},
|
|
59
|
-
InCirc(t){
|
|
60
|
-
return 1 - Math.sqrt(1 - Math.pow(t, 2));
|
|
61
|
-
},
|
|
62
|
-
OutCirc(t){
|
|
63
|
-
return Math.sqrt(1 - Math.pow(t - 1, 2));
|
|
64
|
-
},
|
|
65
|
-
InOutCic(t){
|
|
66
|
-
return t < 0.5? (1 - Math.sqrt(1 - Math.pow(2 * t, 2))) / 2: (Math.sqrt(1 - Math.pow(-2 * t + 2, 2)) + 1) / 2;
|
|
67
|
-
},
|
|
68
|
-
Arc(t){
|
|
69
|
-
return 1 - Math.sin(Math.acos(t));
|
|
70
|
-
},
|
|
71
|
-
Back(t){
|
|
72
|
-
// To Be Changed
|
|
73
|
-
let x=1
|
|
74
|
-
return Math.pow(t, 2) * ((x + 1) * t - x);
|
|
75
|
-
},
|
|
76
|
-
Elastic(t){
|
|
77
|
-
return -2*Math.pow(2, 10 * (t - 1)) * Math.cos(20 * Math.PI * t / 3 * t);
|
|
78
|
-
},
|
|
79
|
-
InBack(t){
|
|
80
|
-
const c1 = 1.70158;
|
|
81
|
-
const c3 = c1 + 1;
|
|
82
|
-
return c3 *Math.pow(t,3)- c1 * (t**2);
|
|
83
|
-
},
|
|
84
|
-
OutBack(t){
|
|
85
|
-
const c1 = 1.70158;
|
|
86
|
-
const c3 = c1 + 1;
|
|
87
|
-
return 1 + c3 * Math.pow(t - 1, 3) + c1 * Math.pow(t - 1, 2);
|
|
88
|
-
},
|
|
89
|
-
InOutBack(t){
|
|
90
|
-
const c1 = 1.70158;
|
|
91
|
-
const c2 = c1 * 1.525;
|
|
92
|
-
return t < 0.5
|
|
93
|
-
? (Math.pow(2 * t, 2) * ((c2 + 1) * 2 * t - c2)) / 2
|
|
94
|
-
: (Math.pow(2 * t - 2, 2) * ((c2 + 1) * (t * 2 - 2) + c2) + 2) / 2;
|
|
95
|
-
},
|
|
96
|
-
InElastic(t){
|
|
97
|
-
const c4 = (2 * Math.PI) / 3;return t === 0
|
|
98
|
-
? 0
|
|
99
|
-
: t === 1
|
|
100
|
-
? 1
|
|
101
|
-
: -Math.pow(2, 10 * t - 10) * Math.sin((t * 10 - 10.75) * c4);
|
|
102
|
-
},
|
|
103
|
-
OutElastic(t){
|
|
104
|
-
const c4 = (2 * Math.PI) / 3;
|
|
105
|
-
return t === 0
|
|
106
|
-
? 0
|
|
107
|
-
: t === 1
|
|
108
|
-
? 1
|
|
109
|
-
: Math.pow(2, -10 * t) * Math.sin((t * 10 - 0.75) * c4) + 1;
|
|
110
|
-
},
|
|
111
|
-
InOutElastic(t){
|
|
112
|
-
const c5 = (2 * Math.PI) / 4.5;
|
|
113
|
-
return t === 0
|
|
114
|
-
? 0
|
|
115
|
-
: t === 1
|
|
116
|
-
? 1
|
|
117
|
-
: t < 0.5
|
|
118
|
-
? -(Math.pow(2, 20 * t - 10) * Math.sin((20 * t - 11.125) * c5)) / 2
|
|
119
|
-
: (Math.pow(2, -20 * t + 10) * Math.sin((20 * t - 11.125) * c5)) / 2 + 1;
|
|
120
|
-
},
|
|
121
|
-
InBounce(t){
|
|
122
|
-
return 1 - Ease.OutBounce(1-t);
|
|
123
|
-
},
|
|
124
|
-
OutBounce(t){
|
|
125
|
-
const n1 = 7.5625;
|
|
126
|
-
const d1 = 2.75;
|
|
127
|
-
if (t < 1 / d1) {
|
|
128
|
-
return n1 * t * t;
|
|
129
|
-
} else if (t < 2 / d1) {
|
|
130
|
-
return n1 * (t -= 1.5 / d1) * t + 0.75;
|
|
131
|
-
} else if (t < 2.5 / d1) {
|
|
132
|
-
return n1 * (t -= 2.25 / d1) * t + 0.9375;
|
|
133
|
-
} else {
|
|
134
|
-
return n1 * (t -= 2.625 / d1) * t + 0.984375;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
},
|
|
138
|
-
InOutBounce(t){
|
|
139
|
-
return t < 0.5
|
|
140
|
-
? (1 - Ease.OutBounce(1 - 2 * t)) / 2
|
|
141
|
-
: (1 + Ease.OutBounce(2 * t - 1)) / 2;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
export default Ease
|
|
File without changes
|
|
File without changes
|