chnobli 0.1.5 → 0.1.7
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/.editorconfig +11 -0
- package/.prettierignore +4 -0
- package/.prettierrc +6 -0
- package/.vscode/settings.json +4 -0
- package/auto-docs/easing.js.html +342 -0
- package/auto-docs/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/auto-docs/fonts/OpenSans-Bold-webfont.svg +1830 -0
- package/auto-docs/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/auto-docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/auto-docs/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
- package/auto-docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/auto-docs/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/auto-docs/fonts/OpenSans-Italic-webfont.svg +1830 -0
- package/auto-docs/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/auto-docs/fonts/OpenSans-Light-webfont.eot +0 -0
- package/auto-docs/fonts/OpenSans-Light-webfont.svg +1831 -0
- package/auto-docs/fonts/OpenSans-Light-webfont.woff +0 -0
- package/auto-docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/auto-docs/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
- package/auto-docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/auto-docs/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/auto-docs/fonts/OpenSans-Regular-webfont.svg +1831 -0
- package/auto-docs/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/auto-docs/global.html +4810 -0
- package/auto-docs/index.html +65 -0
- package/auto-docs/scripts/linenumber.js +25 -0
- package/auto-docs/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/auto-docs/scripts/prettify/lang-css.js +2 -0
- package/auto-docs/scripts/prettify/prettify.js +28 -0
- package/auto-docs/styles/jsdoc-default.css +358 -0
- package/auto-docs/styles/prettify-jsdoc.css +111 -0
- package/auto-docs/styles/prettify-tomorrow.css +132 -0
- package/dist/animation/Animation.d.ts +36 -0
- package/dist/animation/Animation.d.ts.map +1 -0
- package/dist/animation/Animation.js +230 -0
- package/dist/animation/Animation.js.map +1 -0
- package/dist/animation/animation.d.ts +36 -0
- package/dist/animation/animation.d.ts.map +1 -0
- package/dist/animation/animation.js +230 -0
- package/dist/animation/animation.js.map +1 -0
- package/dist/animation/public.d.ts +55 -0
- package/dist/animation/public.d.ts.map +1 -0
- package/dist/animation/public.js +104 -0
- package/dist/animation/public.js.map +1 -0
- package/dist/chnobli.d.ts +15 -0
- package/dist/chnobli.d.ts.map +1 -0
- package/dist/chnobli.js +63 -0
- package/dist/chnobli.js.map +1 -0
- package/dist/property/BasicProperty.d.ts +38 -0
- package/dist/property/BasicProperty.d.ts.map +1 -0
- package/dist/property/BasicProperty.js +72 -0
- package/dist/property/BasicProperty.js.map +1 -0
- package/dist/property/ClassProperty.d.ts +32 -0
- package/dist/property/ClassProperty.d.ts.map +1 -0
- package/dist/property/ClassProperty.js +108 -0
- package/dist/property/ClassProperty.js.map +1 -0
- package/dist/property/Property.d.ts +13 -0
- package/dist/property/Property.d.ts.map +1 -0
- package/dist/property/Property.js +20 -0
- package/dist/property/Property.js.map +1 -0
- package/dist/property/StyleProperty.d.ts +25 -0
- package/dist/property/StyleProperty.d.ts.map +1 -0
- package/dist/property/StyleProperty.js +221 -0
- package/dist/property/StyleProperty.js.map +1 -0
- package/dist/property/TransformProperty.d.ts +15 -0
- package/dist/property/TransformProperty.d.ts.map +1 -0
- package/dist/property/TransformProperty.js +43 -0
- package/dist/property/TransformProperty.js.map +1 -0
- package/dist/property/TransformXYProperty.d.ts +28 -0
- package/dist/property/TransformXYProperty.d.ts.map +1 -0
- package/dist/property/TransformXYProperty.js +65 -0
- package/dist/property/TransformXYProperty.js.map +1 -0
- package/dist/responsive/ResponsiveEvent.d.ts +17 -0
- package/dist/responsive/ResponsiveEvent.d.ts.map +1 -0
- package/dist/responsive/ResponsiveEvent.js +45 -0
- package/dist/responsive/ResponsiveEvent.js.map +1 -0
- package/dist/responsive/TestEvent.d.ts +11 -0
- package/dist/responsive/TestEvent.d.ts.map +1 -0
- package/dist/responsive/TestEvent.js +26 -0
- package/dist/responsive/TestEvent.js.map +1 -0
- package/dist/responsive/event.d.ts +10 -0
- package/dist/responsive/event.d.ts.map +1 -0
- package/dist/responsive/event.js +39 -0
- package/dist/responsive/event.js.map +1 -0
- package/dist/scroll/Scroll.d.ts +27 -0
- package/dist/scroll/Scroll.d.ts.map +1 -0
- package/dist/scroll/Scroll.js +132 -0
- package/dist/scroll/Scroll.js.map +1 -0
- package/dist/scroll/ScrollEvent.d.ts +17 -0
- package/dist/scroll/ScrollEvent.d.ts.map +1 -0
- package/dist/scroll/ScrollEvent.js +39 -0
- package/dist/scroll/ScrollEvent.js.map +1 -0
- package/dist/scroll/public.d.ts +7 -0
- package/dist/scroll/public.d.ts.map +1 -0
- package/dist/scroll/public.js +17 -0
- package/dist/scroll/public.js.map +1 -0
- package/dist/stagger/stagger.d.ts +13 -0
- package/dist/stagger/stagger.d.ts.map +1 -0
- package/dist/stagger/stagger.js +35 -0
- package/dist/stagger/stagger.js.map +1 -0
- package/dist/target/BaseTarget.old.d.ts +33 -0
- package/dist/target/BaseTarget.old.d.ts.map +1 -0
- package/dist/target/BaseTarget.old.js +73 -0
- package/dist/target/BaseTarget.old.js.map +1 -0
- package/dist/target/DomTarget.d.ts +41 -0
- package/dist/target/DomTarget.d.ts.map +1 -0
- package/dist/target/DomTarget.js +230 -0
- package/dist/target/DomTarget.js.map +1 -0
- package/dist/target/Target.d.ts +22 -0
- package/dist/target/Target.d.ts.map +1 -0
- package/dist/target/Target.js +21 -0
- package/dist/target/Target.js.map +1 -0
- package/dist/target/TestDomNode.d.ts +14 -0
- package/dist/target/TestDomNode.d.ts.map +1 -0
- package/dist/target/TestDomNode.js +55 -0
- package/dist/target/TestDomNode.js.map +1 -0
- package/dist/timeline/Nested.d.ts +30 -0
- package/dist/timeline/Nested.d.ts.map +1 -0
- package/dist/timeline/Nested.js +51 -0
- package/dist/timeline/Nested.js.map +1 -0
- package/dist/timeline/TimeLine.d.ts +32 -0
- package/dist/timeline/TimeLine.d.ts.map +1 -0
- package/dist/timeline/TimeLine.js +288 -0
- package/dist/timeline/TimeLine.js.map +1 -0
- package/dist/timeline/public.d.ts +120 -0
- package/dist/timeline/public.d.ts.map +1 -0
- package/dist/timeline/public.js +301 -0
- package/dist/timeline/public.js.map +1 -0
- package/dist/timing/AnimationFrameTicker.d.ts +32 -0
- package/dist/timing/AnimationFrameTicker.d.ts.map +1 -0
- package/dist/timing/AnimationFrameTicker.js +134 -0
- package/dist/timing/AnimationFrameTicker.js.map +1 -0
- package/dist/timing/Ease.d.ts +6 -0
- package/dist/timing/Ease.d.ts.map +1 -0
- package/dist/timing/Ease.js +15 -0
- package/dist/timing/Ease.js.map +1 -0
- package/dist/timing/TestTicker.d.ts +19 -0
- package/dist/timing/TestTicker.d.ts.map +1 -0
- package/dist/timing/TestTicker.js +81 -0
- package/dist/timing/TestTicker.js.map +1 -0
- package/dist/timing/Ticker.d.ts +14 -0
- package/dist/timing/Ticker.d.ts.map +1 -0
- package/dist/timing/Ticker.js +2 -0
- package/dist/timing/Ticker.js.map +1 -0
- package/dist/timing/Timing.d.ts +62 -0
- package/dist/timing/Timing.d.ts.map +1 -0
- package/dist/timing/Timing.js +257 -0
- package/dist/timing/Timing.js.map +1 -0
- package/dist/timing/easing.d.ts +158 -0
- package/dist/timing/easing.d.ts.map +1 -0
- package/dist/timing/easing.js +273 -0
- package/dist/timing/easing.js.map +1 -0
- package/dist/utils/Events.d.ts +9 -0
- package/dist/utils/Events.d.ts.map +1 -0
- package/dist/utils/Events.js +35 -0
- package/dist/utils/Events.js.map +1 -0
- package/dist/utils/internal.d.ts +2 -0
- package/dist/utils/internal.d.ts.map +1 -0
- package/dist/utils/internal.js +6 -0
- package/dist/utils/internal.js.map +1 -0
- package/dist/utils/motionpath.d.ts +16 -0
- package/dist/utils/motionpath.d.ts.map +1 -0
- package/dist/utils/motionpath.js +41 -0
- package/dist/utils/motionpath.js.map +1 -0
- package/dist/utils/utils.d.ts +43 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +93 -0
- package/dist/utils/utils.js.map +1 -0
- package/dist/values/ColorValue.d.ts +12 -0
- package/dist/values/ColorValue.d.ts.map +1 -0
- package/dist/values/ColorValue.js +133 -0
- package/dist/values/ColorValue.js.map +1 -0
- package/dist/values/StyleValue.d.ts +40 -0
- package/dist/values/StyleValue.d.ts.map +1 -0
- package/dist/values/StyleValue.js +149 -0
- package/dist/values/StyleValue.js.map +1 -0
- package/dist/values/Value.d.ts +13 -0
- package/dist/values/Value.d.ts.map +1 -0
- package/dist/values/Value.js +38 -0
- package/dist/values/Value.js.map +1 -0
- package/dist/values/defaultcolors.d.ts +2 -0
- package/dist/values/defaultcolors.d.ts.map +1 -0
- package/dist/values/defaultcolors.js +149 -0
- package/dist/values/defaultcolors.js.map +1 -0
- package/package.json +11 -7
- package/src/animation/{animation.js → Animation.ts} +56 -54
- package/src/animation/{public.js → public.ts} +23 -18
- package/src/{chnobli.js → chnobli.ts} +11 -12
- package/src/property/BasicProperty.ts +91 -0
- package/src/property/ClassProperty.ts +132 -0
- package/src/property/Property.ts +33 -0
- package/src/property/StyleProperty.ts +273 -0
- package/src/property/TransformProperty.ts +56 -0
- package/src/property/TransformXYProperty.ts +88 -0
- package/src/responsive/ResponsiveEvent.ts +60 -0
- package/src/responsive/{testevent.js → TestEvent.ts} +12 -10
- package/src/scroll/{scroll.js → Scroll.ts} +53 -35
- package/src/scroll/ScrollEvent.ts +53 -0
- package/src/scroll/public.ts +20 -0
- package/src/stagger/stagger.ts +45 -0
- package/src/target/{basetarget.js → BaseTarget.old.ts} +25 -26
- package/src/target/DomTarget.ts +281 -0
- package/src/target/Target.ts +48 -0
- package/src/target/{testdomnode.js → TestDomNode.ts} +18 -15
- package/src/tests/{properties.test.js → properties.test.ts} +54 -49
- package/src/tests/{timeline.test.js → timeline.test.ts} +92 -75
- package/src/tests/{timing.test.js → timing.test.ts} +25 -22
- package/src/tests/{usecases.test.js → usecases.test.ts} +13 -10
- package/src/tests/{values.test.js → values.test.ts} +21 -21
- package/src/timeline/{nested.js → Nested.ts} +18 -12
- package/src/timeline/{timeline.js → TimeLine.ts} +100 -60
- package/src/timeline/{public.js → public.ts} +75 -60
- package/src/timing/{ticker.js → AnimationFrameTicker.ts} +36 -21
- package/src/timing/{ease.js → Ease.ts} +6 -5
- package/src/timing/{testticker.js → TestTicker.ts} +27 -24
- package/src/timing/Ticker.ts +11 -0
- package/src/timing/{timing.js → Timing.ts} +72 -63
- package/src/timing/{easing.js → easing.ts} +52 -43
- package/src/utils/{events.js → Events.ts} +12 -11
- package/src/utils/internal.ts +10 -0
- package/src/utils/{motionpath.js → motionpath.ts} +36 -13
- package/src/utils/utils.ts +110 -0
- package/src/values/{colorvalue.js → ColorValue.ts} +46 -47
- package/src/values/StyleValue.ts +186 -0
- package/src/values/{value.js → Value.ts} +14 -12
- package/src/values/{defaultcolors.js → defaultcolors.ts} +2 -2
- package/tsconfig.build.json +19 -0
- package/tsconfig.json +17 -108
- package/src/animation/property.js +0 -556
- package/src/responsive/event.js +0 -46
- package/src/scroll/event.js +0 -41
- package/src/scroll/public.js +0 -17
- package/src/stagger/stagger.js +0 -42
- package/src/target/domtarget.js +0 -266
- package/src/target/target.js +0 -22
- package/src/utils/internal.js +0 -7
- package/src/utils/utils.js +0 -107
- package/src/values/stylevalue.js +0 -148
package/.editorconfig
ADDED
package/.prettierignore
ADDED
package/.prettierrc
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<title>JSDoc: Source: easing.js</title>
|
|
6
|
+
|
|
7
|
+
<script src="scripts/prettify/prettify.js"> </script>
|
|
8
|
+
<script src="scripts/prettify/lang-css.js"> </script>
|
|
9
|
+
<!--[if lt IE 9]>
|
|
10
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
11
|
+
<![endif]-->
|
|
12
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
13
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
14
|
+
</head>
|
|
15
|
+
|
|
16
|
+
<body>
|
|
17
|
+
|
|
18
|
+
<div id="main">
|
|
19
|
+
|
|
20
|
+
<h1 class="page-title">Source: easing.js</h1>
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
<section>
|
|
28
|
+
<article>
|
|
29
|
+
<pre class="prettyprint source linenums"><code>/*
|
|
30
|
+
Adapted from https://github.com/sveltejs/svelte
|
|
31
|
+
Distributed under MIT License https://github.com/sveltejs/svelte/blob/main/LICENSE.md
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
import bezierEasing from 'bezier-easing';
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @param {number} t
|
|
38
|
+
* @returns {number}
|
|
39
|
+
*/
|
|
40
|
+
export function linear(t) {
|
|
41
|
+
return t;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @param {number} t
|
|
46
|
+
* @returns {number}
|
|
47
|
+
*/
|
|
48
|
+
export function backInOut(t) {
|
|
49
|
+
const s = 1.70158 * 1.525;
|
|
50
|
+
if ((t *= 2) < 1) return 0.5 * (t * t * ((s + 1) * t - s));
|
|
51
|
+
return 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @param {number} t
|
|
56
|
+
* @returns {number}
|
|
57
|
+
*/
|
|
58
|
+
export function backIn(t) {
|
|
59
|
+
const s = 1.70158;
|
|
60
|
+
return t * t * ((s + 1) * t - s);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @param {number} t
|
|
65
|
+
* @returns {number}
|
|
66
|
+
*/
|
|
67
|
+
export function backOut(t) {
|
|
68
|
+
const s = 1.70158;
|
|
69
|
+
return --t * t * ((s + 1) * t + s) + 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @param {number} t
|
|
74
|
+
* @returns {number}
|
|
75
|
+
*/
|
|
76
|
+
export function bounceOut(t) {
|
|
77
|
+
const a = 4.0 / 11.0;
|
|
78
|
+
const b = 8.0 / 11.0;
|
|
79
|
+
const c = 9.0 / 10.0;
|
|
80
|
+
const ca = 4356.0 / 361.0;
|
|
81
|
+
const cb = 35442.0 / 1805.0;
|
|
82
|
+
const cc = 16061.0 / 1805.0;
|
|
83
|
+
const t2 = t * t;
|
|
84
|
+
return t < a
|
|
85
|
+
? 7.5625 * t2
|
|
86
|
+
: t < b
|
|
87
|
+
? 9.075 * t2 - 9.9 * t + 3.4
|
|
88
|
+
: t < c
|
|
89
|
+
? ca * t2 - cb * t + cc
|
|
90
|
+
: 10.8 * t * t - 20.52 * t + 10.72;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @param {number} t
|
|
95
|
+
* @returns {number}
|
|
96
|
+
*/
|
|
97
|
+
export function bounceInOut(t) {
|
|
98
|
+
return t < 0.5 ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0)) : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @param {number} t
|
|
103
|
+
* @returns {number}
|
|
104
|
+
*/
|
|
105
|
+
export function bounceIn(t) {
|
|
106
|
+
return 1.0 - bounceOut(1.0 - t);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @param {number} t
|
|
111
|
+
* @returns {number}
|
|
112
|
+
*/
|
|
113
|
+
export function circInOut(t) {
|
|
114
|
+
if ((t *= 2) < 1) return -0.5 * (Math.sqrt(1 - t * t) - 1);
|
|
115
|
+
return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* @param {number} t
|
|
120
|
+
* @returns {number}
|
|
121
|
+
*/
|
|
122
|
+
export function circIn(t) {
|
|
123
|
+
return 1.0 - Math.sqrt(1.0 - t * t);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* @param {number} t
|
|
128
|
+
* @returns {number}
|
|
129
|
+
*/
|
|
130
|
+
export function circOut(t) {
|
|
131
|
+
return Math.sqrt(1 - --t * t);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @param {number} t
|
|
136
|
+
* @returns {number}
|
|
137
|
+
*/
|
|
138
|
+
export function cubicInOut(t) {
|
|
139
|
+
return t < 0.5 ? 4.0 * t * t * t : 0.5 * Math.pow(2.0 * t - 2.0, 3.0) + 1.0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* @param {number} t
|
|
144
|
+
* @returns {number}
|
|
145
|
+
*/
|
|
146
|
+
export function cubicIn(t) {
|
|
147
|
+
return t * t * t;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @param {number} t
|
|
152
|
+
* @returns {number}
|
|
153
|
+
*/
|
|
154
|
+
export function cubicOut(t) {
|
|
155
|
+
const f = t - 1.0;
|
|
156
|
+
return f * f * f + 1.0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* @param {number} t
|
|
161
|
+
* @returns {number}
|
|
162
|
+
*/
|
|
163
|
+
export function elasticInOut(t) {
|
|
164
|
+
return t < 0.5
|
|
165
|
+
? 0.5 * Math.sin(((+13.0 * Math.PI) / 2) * 2.0 * t) * Math.pow(2.0, 10.0 * (2.0 * t - 1.0))
|
|
166
|
+
: 0.5 *
|
|
167
|
+
Math.sin(((-13.0 * Math.PI) / 2) * (2.0 * t - 1.0 + 1.0)) *
|
|
168
|
+
Math.pow(2.0, -10.0 * (2.0 * t - 1.0)) +
|
|
169
|
+
1.0;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @param {number} t
|
|
174
|
+
* @returns {number}
|
|
175
|
+
*/
|
|
176
|
+
export function elasticIn(t) {
|
|
177
|
+
return Math.sin((13.0 * t * Math.PI) / 2) * Math.pow(2.0, 10.0 * (t - 1.0));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @param {number} t
|
|
182
|
+
* @returns {number}
|
|
183
|
+
*/
|
|
184
|
+
export function elasticOut(t) {
|
|
185
|
+
return Math.sin((-13.0 * (t + 1.0) * Math.PI) / 2) * Math.pow(2.0, -10.0 * t) + 1.0;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* @param {number} t
|
|
190
|
+
* @returns {number}
|
|
191
|
+
*/
|
|
192
|
+
export function expoInOut(t) {
|
|
193
|
+
return t === 0.0 || t === 1.0
|
|
194
|
+
? t
|
|
195
|
+
: t < 0.5
|
|
196
|
+
? +0.5 * Math.pow(2.0, 20.0 * t - 10.0)
|
|
197
|
+
: -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* @param {number} t
|
|
202
|
+
* @returns {number}
|
|
203
|
+
*/
|
|
204
|
+
export function expoIn(t) {
|
|
205
|
+
return t === 0.0 ? t : Math.pow(2.0, 10.0 * (t - 1.0));
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @param {number} t
|
|
210
|
+
* @returns {number}
|
|
211
|
+
*/
|
|
212
|
+
export function expoOut(t) {
|
|
213
|
+
return t === 1.0 ? t : 1.0 - Math.pow(2.0, -10.0 * t);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* @param {number} t
|
|
218
|
+
* @returns {number}
|
|
219
|
+
*/
|
|
220
|
+
export function quadInOut(t) {
|
|
221
|
+
t /= 0.5;
|
|
222
|
+
if (t < 1) return 0.5 * t * t;
|
|
223
|
+
t--;
|
|
224
|
+
return -0.5 * (t * (t - 2) - 1);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* @param {number} t
|
|
229
|
+
* @returns {number}
|
|
230
|
+
*/
|
|
231
|
+
export function quadIn(t) {
|
|
232
|
+
return t * t;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* @param {number} t
|
|
237
|
+
* @returns {number}
|
|
238
|
+
*/
|
|
239
|
+
export function quadOut(t) {
|
|
240
|
+
return -t * (t - 2.0);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* @param {number} t
|
|
245
|
+
* @returns {number}
|
|
246
|
+
*/
|
|
247
|
+
export function quartInOut(t) {
|
|
248
|
+
return t < 0.5 ? +8.0 * Math.pow(t, 4.0) : -8.0 * Math.pow(t - 1.0, 4.0) + 1.0;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* @param {number} t
|
|
253
|
+
* @returns {number}
|
|
254
|
+
*/
|
|
255
|
+
export function quartIn(t) {
|
|
256
|
+
return Math.pow(t, 4.0);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @param {number} t
|
|
261
|
+
* @returns {number}
|
|
262
|
+
*/
|
|
263
|
+
export function quartOut(t) {
|
|
264
|
+
return Math.pow(t - 1.0, 3.0) * (1.0 - t) + 1.0;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* @param {number} t
|
|
269
|
+
* @returns {number}
|
|
270
|
+
*/
|
|
271
|
+
export function quintInOut(t) {
|
|
272
|
+
if ((t *= 2) < 1) return 0.5 * t * t * t * t * t;
|
|
273
|
+
return 0.5 * ((t -= 2) * t * t * t * t + 2);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* @param {number} t
|
|
278
|
+
* @returns {number}
|
|
279
|
+
*/
|
|
280
|
+
export function quintIn(t) {
|
|
281
|
+
return t * t * t * t * t;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* @param {number} t
|
|
286
|
+
* @returns {number}
|
|
287
|
+
*/
|
|
288
|
+
export function quintOut(t) {
|
|
289
|
+
return --t * t * t * t * t + 1;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* @param {number} t
|
|
294
|
+
* @returns {number}
|
|
295
|
+
*/
|
|
296
|
+
export function sineInOut(t) {
|
|
297
|
+
return -0.5 * (Math.cos(Math.PI * t) - 1);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* @param {number} t
|
|
302
|
+
* @returns {number}
|
|
303
|
+
*/
|
|
304
|
+
export function sineIn(t) {
|
|
305
|
+
const v = Math.cos(t * Math.PI * 0.5);
|
|
306
|
+
if (Math.abs(v) < 1e-14) return 1;
|
|
307
|
+
else return 1 - v;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* @param {number} t
|
|
312
|
+
* @returns {number}
|
|
313
|
+
*/
|
|
314
|
+
export function sineOut(t) {
|
|
315
|
+
return Math.sin((t * Math.PI) / 2);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export function cubicBezier(x1, y1, x2, y2) {
|
|
319
|
+
return bezierEasing(x1, y1, x2, y2);
|
|
320
|
+
}</code></pre>
|
|
321
|
+
</article>
|
|
322
|
+
</section>
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
</div>
|
|
328
|
+
|
|
329
|
+
<nav>
|
|
330
|
+
<h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#backIn">backIn</a></li><li><a href="global.html#backInOut">backInOut</a></li><li><a href="global.html#backOut">backOut</a></li><li><a href="global.html#bounceIn">bounceIn</a></li><li><a href="global.html#bounceInOut">bounceInOut</a></li><li><a href="global.html#bounceOut">bounceOut</a></li><li><a href="global.html#circIn">circIn</a></li><li><a href="global.html#circInOut">circInOut</a></li><li><a href="global.html#circOut">circOut</a></li><li><a href="global.html#cubicIn">cubicIn</a></li><li><a href="global.html#cubicInOut">cubicInOut</a></li><li><a href="global.html#cubicOut">cubicOut</a></li><li><a href="global.html#elasticIn">elasticIn</a></li><li><a href="global.html#elasticInOut">elasticInOut</a></li><li><a href="global.html#elasticOut">elasticOut</a></li><li><a href="global.html#expoIn">expoIn</a></li><li><a href="global.html#expoInOut">expoInOut</a></li><li><a href="global.html#expoOut">expoOut</a></li><li><a href="global.html#linear">linear</a></li><li><a href="global.html#quadIn">quadIn</a></li><li><a href="global.html#quadInOut">quadInOut</a></li><li><a href="global.html#quadOut">quadOut</a></li><li><a href="global.html#quartIn">quartIn</a></li><li><a href="global.html#quartInOut">quartInOut</a></li><li><a href="global.html#quartOut">quartOut</a></li><li><a href="global.html#quintIn">quintIn</a></li><li><a href="global.html#quintInOut">quintInOut</a></li><li><a href="global.html#quintOut">quintOut</a></li><li><a href="global.html#sineIn">sineIn</a></li><li><a href="global.html#sineInOut">sineInOut</a></li><li><a href="global.html#sineOut">sineOut</a></li></ul>
|
|
331
|
+
</nav>
|
|
332
|
+
|
|
333
|
+
<br class="clear">
|
|
334
|
+
|
|
335
|
+
<footer>
|
|
336
|
+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.2</a> on Sat Jan 13 2024 11:54:27 GMT+0100 (Central European Standard Time)
|
|
337
|
+
</footer>
|
|
338
|
+
|
|
339
|
+
<script> prettyPrint(); </script>
|
|
340
|
+
<script src="scripts/linenumber.js"> </script>
|
|
341
|
+
</body>
|
|
342
|
+
</html>
|
|
Binary file
|