react-magic-card 0.0.1 → 0.0.2

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.
@@ -0,0 +1,15 @@
1
+ .outer {
2
+ position: absolute;
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: center;
6
+ }
7
+
8
+ .inner {
9
+ position: relative;
10
+ }
11
+
12
+ .inner img {
13
+ position: absolute;
14
+ object-fit: "cover";
15
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-magic-card",
3
- "version": "0.0.1",
4
- "description": "animation",
3
+ "version": "0.0.2",
4
+ "description": "image gallery component with framer motion",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "repository": {
@@ -11,6 +11,8 @@
11
11
  },
12
12
  "scripts": {
13
13
  "tsc": "./node_modules/.bin/tsc",
14
+ "copy-css": "cp src/MagicCircle/main.css dist/MagicCircle/main.css",
15
+ "compile": "tsc && npm run copy-css",
14
16
  "test": "test"
15
17
  },
16
18
  "keywords": [
package/readme.md CHANGED
@@ -15,23 +15,23 @@ npm install react-magic-card framer-motion
15
15
  ## Usage
16
16
 
17
17
  ```tsx
18
- import { MagicCircle } from "react-magic-card";
18
+ import { MagicCircle } from 'react-magic-card'
19
19
 
20
20
  function MyComponent() {
21
21
  const images = [
22
22
  {
23
- src: "/1.jpeg",
24
- alt: "1image",
23
+ src: '/1.jpeg',
24
+ alt: '1image'
25
25
  },
26
26
  {
27
- src: "/2.jpeg",
28
- alt: "2image",
27
+ src: '/2.jpeg',
28
+ alt: '2image'
29
29
  },
30
30
  {
31
- src: "/3.jpeg",
32
- alt: "3image",
33
- },
34
- ];
31
+ src: '/3.jpeg',
32
+ alt: '3image'
33
+ }
34
+ ]
35
35
 
36
36
  return (
37
37
  <MagicCircle
@@ -51,14 +51,18 @@ function MyComponent() {
51
51
  selectScale: 1.6,
52
52
  selectRotateX: 40,
53
53
  selectRotateY: 40,
54
- selectRotateZ: -10,
54
+ selectRotateZ: -10
55
55
  }}
56
56
  transition={{ duration: 0.2 }}
57
57
  />
58
- );
58
+ )
59
59
  }
60
60
  ```
61
61
 
62
+ ## use LazyMotion
63
+
64
+ because It is using 「m」 need to wrap it with LazyMotion at the root layout level.
65
+
62
66
  ## Properties
63
67
 
64
68
  - data: An array a images property objects for src and alt.
@@ -84,8 +88,8 @@ function MyComponent() {
84
88
  - rotateZ
85
89
  - selectScale
86
90
  - selectOpacity
87
- - selectRotateY
88
91
  - selectRotateX
92
+ - selectRotateY
89
93
  - selectRotateZ
90
94
 
91
95
  ## Transition property