select-animation 1.2.2 → 1.2.4
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/package.json +5 -1
- package/readme.md +11 -0
- package/select-animation.js +7 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "select-animation",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "High-performance JavaScript animation engine for organic & fluid motion",
|
|
5
5
|
"main": "select-animation.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/housseynCheriet/Select-Animation"
|
|
12
12
|
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/housseynCheriet/Select-Animation/issues"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://selectjs.vercel.app",
|
|
13
17
|
"keywords": [
|
|
14
18
|
"animation",
|
|
15
19
|
"javascript",
|
package/readme.md
CHANGED
|
@@ -235,6 +235,17 @@ This interactive playground allows you to tweak properties, easing types, and se
|
|
|
235
235
|
|
|
236
236
|
---
|
|
237
237
|
|
|
238
|
+
[](https://www.npmjs.com/package/select-animation)
|
|
239
|
+
[](https://github.com/housseynCheriet/Select-Animation)
|
|
240
|
+
|
|
241
|
+
A high-performance, lightweight JavaScript animation engine.
|
|
242
|
+
|
|
243
|
+
**Support our project:** [selectjs.vercel.app](https://selectjs.vercel.app)
|
|
244
|
+
**NPM Package:** [npmjs.com/package/select-animation](https://www.npmjs.com/package/select-animation)
|
|
245
|
+
**Source Code:** [github.com/housseynCheriet/Select-Animation](https://github.com/housseynCheriet/Select-Animation)
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
238
249
|
# ⚙ Internal Architecture
|
|
239
250
|
|
|
240
251
|
The engine includes:
|
package/select-animation.js
CHANGED
|
@@ -690,21 +690,20 @@
|
|
|
690
690
|
return n + (t - n) / 2 + Math.sin(e * Math.PI / (a / c.vibrationStep) + 3 * Math.PI / 2) * (t - n) / 2
|
|
691
691
|
}, "vibration"],
|
|
692
692
|
cubicbezier: [function(e, n, t, a, c) {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
if (c.impair && (c.boucleType == "returnRepeat" || c.boucleType == "repeatReturn")) {
|
|
697
|
-
q = -1, qq = 1;
|
|
693
|
+
let q = 1, qq = 0, sol;
|
|
694
|
+
if (c.impair && (c.boucleType === "returnRepeat" || c.boucleType === "repeatReturn")) {
|
|
695
|
+
q = -1; qq = 1;
|
|
698
696
|
}
|
|
699
|
-
|
|
700
|
-
r = 1 - b,
|
|
697
|
+
let b = e / a, r = 1 - b,
|
|
701
698
|
l = Number(q * c.cubicbezier[0] + qq),
|
|
702
699
|
o = Number(q * c.cubicbezier[2] + qq);
|
|
700
|
+
|
|
703
701
|
if ((sol = solveCubic(3 * l - 3 * o + 1, 0 - 6 * l + 3 * o, 3 * l, 0 - b))) {
|
|
704
702
|
b = sol;
|
|
705
703
|
r = 1 - b;
|
|
706
704
|
}
|
|
707
|
-
|
|
705
|
+
let y = (r = 1 - b) * r * r * 0 + 3 * r * r * b * Number(q * c.cubicbezier[1] + qq) + 3 * r * b * b * Number(q * c.cubicbezier[3] + qq) + b * b * b * 1;
|
|
706
|
+
return n + y * t;
|
|
708
707
|
}, "cubicbezier"]
|
|
709
708
|
};
|
|
710
709
|
|