anim-3d-obj 1.1.74 → 1.2.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.
- package/README.md +50 -73
- package/package.json +1 -10
package/README.md
CHANGED
|
@@ -12,25 +12,6 @@ The program does the leg work with regard to calculating translationZ depth and
|
|
|
12
12
|
- [Parallel divs animated x and y axis in tandem](https://codesandbox.io/s/anim-3d-obj-2-sides-simple-4057y7)
|
|
13
13
|
- [Obj Skeleton](https://codesandbox.io/s/anim-3d-obj-skeleton-5dlk70)
|
|
14
14
|
|
|
15
|
-
## Config
|
|
16
|
-
|
|
17
|
-
Animations are optional. Either or both of `anim1` or `anim2` can be applied to the component.
|
|
18
|
-
|
|
19
|
-
```typescript
|
|
20
|
-
const anim1 = {
|
|
21
|
-
border: "", // while testing reveal the animation wrapper
|
|
22
|
-
degreesHi: -45, // degrees if spin
|
|
23
|
-
degreesLow: 45, // degrees if spin
|
|
24
|
-
delay: 0, // start delay in seconds
|
|
25
|
-
direction: "normal", //normal alternating reverse
|
|
26
|
-
duration: 8, // seconds
|
|
27
|
-
fillMode: "forwards", // none forwards backwards both
|
|
28
|
-
iterationCount: "infinite", // number or infinte
|
|
29
|
-
name: "Y360", // ** ANIMATIONS
|
|
30
|
-
timing: "ease-in-out", // linear ease ease-in-out
|
|
31
|
-
};
|
|
32
|
-
```
|
|
33
|
-
|
|
34
15
|
`** ANIMATIONS`
|
|
35
16
|
|
|
36
17
|
- `fadeInkf`: fade object in from 0 to 1 Opacity: [demo](https://codesandbox.io/s/anim-3d-obj-fadeinkf-1fozww)
|
|
@@ -43,7 +24,6 @@ const anim1 = {
|
|
|
43
24
|
- `swingDecay`: Swing component with decay: [demo](https://codesandbox.io/s/anim-3d-obj-swingdecay-cku0e1)
|
|
44
25
|
- `noAnim`: no animation place holder
|
|
45
26
|
|
|
46
|
-
|
|
47
27
|
`X-AXIS Animations`
|
|
48
28
|
- `X360`: rotate 360 degrees on the x-axis: [demo](https://codesandbox.io/s/anim-3d-obj-x360-7kiuhw)
|
|
49
29
|
- `wobX`: wobble on x-axis (degreesHi <-> degreesLow): [demo](https://codesandbox.io/s/anim-3d-obj-wobx-ldwek7)
|
|
@@ -63,68 +43,65 @@ const anim1 = {
|
|
|
63
43
|
- `fwdy918`: spin object on y-axis from 90 degrees to 180 degrees: [demo](https://codesandbox.io/s/anim-3d-obj-fwdy918-gnym88)
|
|
64
44
|
- `fwdy1827`: spin object on y-axis from 180 degrees to 270 degrees: [demo](https://codesandbox.io/s/anim-3d-obj-fwdy1827-osskgx)
|
|
65
45
|
- `fwdy2736`: spin object on y-axis from 270 degrees to 360 degrees: [demo](https://codesandbox.io/s/anim-3d-obj-fwdy2736-rnbs2q)
|
|
66
|
-
-
|
|
67
46
|
|
|
68
47
|
|
|
69
|
-
|
|
48
|
+
## Config
|
|
49
|
+
### Animations:
|
|
70
50
|
|
|
71
|
-
|
|
51
|
+
Animations are optional. Either or both of `anim1` or `anim2` can be applied to the component. Animations are applied to 2 wrapping divs respectively.
|
|
72
52
|
|
|
73
53
|
```typescript
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
backface-visibility: visible;
|
|
86
|
-
font-family: Arial, Helvetica, sans-serif;
|
|
87
|
-
border-radius:5px;
|
|
88
|
-
`,
|
|
89
|
-
body: " ",
|
|
54
|
+
const anim1 = {
|
|
55
|
+
border: "", // while testing reveal the animation wrapper
|
|
56
|
+
degreesHi: -45, // degrees if spin
|
|
57
|
+
degreesLow: 45, // degrees if spin
|
|
58
|
+
delay: 0, // start delay in seconds
|
|
59
|
+
direction: "normal", //normal alternating reverse
|
|
60
|
+
duration: 8, // seconds
|
|
61
|
+
fillMode: "forwards", // none forwards backwards both
|
|
62
|
+
iterationCount: "infinite", // number or infinte
|
|
63
|
+
name: "Y360", // ** ANIMATIONS (above)
|
|
64
|
+
timing: "ease-in-out", // linear ease ease-in-out
|
|
90
65
|
};
|
|
91
66
|
```
|
|
92
67
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
background: rgb(2,0,36);
|
|
108
|
-
color:white;
|
|
109
|
-
text-align: center;
|
|
110
|
-
line-height:8;`
|
|
111
|
-
body: " ",
|
|
112
|
-
},
|
|
113
|
-
right: {
|
|
114
|
-
css: ``,
|
|
115
|
-
body: " ",
|
|
116
|
-
},
|
|
117
|
-
back: {
|
|
118
|
-
css: ``,
|
|
119
|
-
body: <Logout />,
|
|
68
|
+
### Faces:
|
|
69
|
+
This is an array of objects containing the face used for a given component
|
|
70
|
+
```javascript
|
|
71
|
+
export interface FaceType {
|
|
72
|
+
name?: string; // front,back,left,right,top,top_rear,top_front,bottom,bottom_rear,bottom_front
|
|
73
|
+
css?: string | undefined;
|
|
74
|
+
body?: any; // can be JSX Component | string | number
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const faces: FaceType[] = [
|
|
78
|
+
{
|
|
79
|
+
name: "back",
|
|
80
|
+
body: "BACK",
|
|
81
|
+
css: `background:rgba(22,22,22,.5)`,
|
|
120
82
|
},
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
`,
|
|
83
|
+
{
|
|
84
|
+
name: "right",
|
|
85
|
+
body: "RIGHT",
|
|
86
|
+
css: `background:rgba(220,220,220,.5);
|
|
87
|
+
border:1px solid #ddd`,
|
|
127
88
|
},
|
|
89
|
+
];
|
|
128
90
|
```
|
|
129
|
-
|
|
91
|
+
|
|
92
|
+
### Global (face):
|
|
93
|
+
If the name parameter in the faces array is indicated (ie: "front") but `css` and / or `body` are not. The `global default`(below) will satisfy those parameters.
|
|
94
|
+
```javascript
|
|
95
|
+
interface GlobalType {
|
|
96
|
+
css?: string;
|
|
97
|
+
body?: string;
|
|
98
|
+
}
|
|
99
|
+
const global: GlobalType = {
|
|
100
|
+
body: "BODY FOR FACE WHICH DOES NOT CONTAIN BODY",
|
|
101
|
+
css: 'color:red'
|
|
102
|
+
};
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+

|
|
106
|
+
|
|
130
107
|
- https://www.npmjs.com/package/anim-3d-obj
|
package/package.json
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
2
|
{
|
|
12
3
|
"name": "anim-3d-obj",
|
|
13
4
|
"repository": {
|
|
@@ -15,7 +6,7 @@
|
|
|
15
6
|
"url": "https://github.com/mdnelles/anim-3d-obj-npm-publisher.git"
|
|
16
7
|
},
|
|
17
8
|
"homepage": "https://github.com/mdnelles/anim-3d-obj-npm-publisher.git",
|
|
18
|
-
"version": "1.
|
|
9
|
+
"version": "1.2.2",
|
|
19
10
|
"description": "React library for creating 3D objects quickly. Also these objects can be animated",
|
|
20
11
|
"main": "dist/cjs/index.js",
|
|
21
12
|
"module": "dist/esm/index.js",
|