react-magic-card 0.1.10 → 0.1.11
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/MagicStraight/index.js +20 -4
- package/package.json +1 -1
|
@@ -70,12 +70,28 @@ const MagicStraight = ({ images, height, width, start, controller, wheelDelay, v
|
|
|
70
70
|
// Swipe Function of the mobile.
|
|
71
71
|
const handleTouchMove = (0, react_1.useCallback)((e) => {
|
|
72
72
|
const touch = e.touches[0];
|
|
73
|
-
const delta = hasPick
|
|
74
|
-
|
|
73
|
+
const delta = hasPick
|
|
74
|
+
? touch.clientX
|
|
75
|
+
: !vertical
|
|
76
|
+
? touch.clientX
|
|
77
|
+
: touch.clientY;
|
|
78
|
+
if (hasPick
|
|
79
|
+
? delta < touchStartX
|
|
80
|
+
: !vertical
|
|
81
|
+
? delta < touchStartX
|
|
82
|
+
: delta < touchStartY)
|
|
75
83
|
shiftLeft();
|
|
76
|
-
if (hasPick
|
|
84
|
+
if (hasPick
|
|
85
|
+
? delta > touchStartX
|
|
86
|
+
: !vertical
|
|
87
|
+
? delta > touchStartX
|
|
88
|
+
: delta > touchStartY)
|
|
77
89
|
shiftRight();
|
|
78
|
-
hasPick
|
|
90
|
+
hasPick
|
|
91
|
+
? setTouchStartX(delta)
|
|
92
|
+
: !vertical
|
|
93
|
+
? setTouchStartX(delta)
|
|
94
|
+
: setTouchStartY(delta);
|
|
79
95
|
}, [hasPick, shiftLeft, shiftRight, touchStartX, touchStartY, vertical]);
|
|
80
96
|
// Main functional, exit function if ref and hasDelayed does not exist.
|
|
81
97
|
(0, react_1.useEffect)(() => {
|