react-magic-card 0.1.10 → 0.1.12

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/README.md CHANGED
@@ -61,28 +61,28 @@ function MyComponent() {
61
61
  }
62
62
  ```
63
63
 
64
- | Property | Meaning |
65
- | ---------------- | ------------------------------------------------------------------------ |
66
- | images | array of images and objects containing the src and alt properties. |
67
- | width | width of the single image. |
68
- | height | height of the single image. |
69
- | start | index number of the starting scale position. |
70
- | controller | diameter plus the value of the controller is the size of the controller. |
71
- | className | className of the component. |
72
- | classImages | className of the images. |
73
- | classImageSelect | className of the select image. |
74
- | classImageUnique | className of the index number is assigned to the end. |
75
- | animate | object in the animation property. |
76
- | initial | object in the animation property. |
77
- | transition | object in the transition property. |
78
- | pickTransition | object in the transition property. |
79
- | pickProperty | object in the pick property. |
80
-
81
- | Only MagicCircle | Meaning |
82
- | ---------------- | ---------------------------------------------------- |
83
- | radius | radius of the circle. |
84
- | dynamic | dynamic or static for rotation the default true. |
85
- | clockwise | direction of rotation when dynamic the default true. |
64
+ | Property | Meaning |
65
+ | ---------------- | ----------------------------------------------------------------------- |
66
+ | images | array of images and objects containing the src and alt properties |
67
+ | width | width of the single image |
68
+ | height | height of the single image |
69
+ | start | index number of the starting scale position |
70
+ | controller | diameter plus the value of the controller is the size of the controller |
71
+ | className | className of the component |
72
+ | classImages | className of the images |
73
+ | classImageSelect | className of the select image |
74
+ | classImageUnique | className of the index number is assigned to the end |
75
+ | animate | object in the animation property |
76
+ | initial | object in the animation property |
77
+ | transition | object in the transition property |
78
+ | pickTransition | object in the transition property |
79
+ | pickProperty | object in the pick property |
80
+
81
+ | Only MagicCircle | Meaning |
82
+ | ---------------- | --------------------------------------------------- |
83
+ | radius | radius of the circle |
84
+ | dynamic | dynamic or static for rotation the default true |
85
+ | clockwise | direction of rotation when dynamic the default true |
86
86
 
87
87
  | Only MagicStraight | Meaning |
88
88
  | ------------------ | --------------------------------------- |
@@ -10,5 +10,4 @@
10
10
 
11
11
  .inner img {
12
12
  position: absolute;
13
- object-fit: 'cover';
14
13
  }
@@ -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 ? touch.clientX : touch.clientY;
74
- if (hasPick ? delta < touchStartX : delta < touchStartY)
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 ? delta > touchStartX : delta > touchStartY)
84
+ if (hasPick
85
+ ? delta > touchStartX
86
+ : !vertical
87
+ ? delta > touchStartX
88
+ : delta > touchStartY)
77
89
  shiftRight();
78
- hasPick ? setTouchStartX(delta) : setTouchStartY(delta);
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)(() => {
@@ -3,7 +3,3 @@
3
3
  align-items: center;
4
4
  justify-content: center;
5
5
  }
6
-
7
- .outer img {
8
- object-fit: 'cover';
9
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-magic-card",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "image gallery component with framer motion",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -20,8 +20,10 @@
20
20
  },
21
21
  "keywords": [
22
22
  "react",
23
- "illust",
23
+ "art",
24
24
  "photograph",
25
+ "illust",
26
+ "gallery",
25
27
  "animation"
26
28
  ],
27
29
  "license": "MIT",