anim-3d-obj 1.1.74 → 1.2.3

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
@@ -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
- GLOBAL CONFIG
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
- // EXAMPLE GLOBAL FACE CONFIG
75
- // This will be applied to all Faces that do not have their own custom config
76
- const global: object = {
77
- // // face individual styles (over rides global)
78
- css: `
79
- border: 1px solid #fff;
80
- background: rgb(2,0,36);
81
- background: linear-gradient(180deg, rgba(255,255,255,.1) 0%, rgba(141,191,249,.7) 100%);
82
- color:white;
83
- text-align:center;
84
- line-height:10;
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
- CUSTOM CONFIG FOR INDIVIDUAL FACES
96
-
97
- ```typescript
98
- const custom: object = {
99
- // // face individual styles (over rides global)
100
- front: {
101
- css: ``,
102
- body: <Login />,
103
- },
104
- left: {
105
- css: `
106
- border: 1px solid #fff;
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
- bottom: {
122
- css: `
123
- background-color:rgba(141,191,249,1);
124
- -webkit-box-shadow: 0px 0px 23px 18px #858585;
125
- box-shadow: 0px 0px 23px 18px #858585;
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
- ## NPM Location
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
+ ![all sides](https://github.com/mdnelles/anim-3d-obj-npm-publisher/blob/4a9769a6386a3b5425ede9a04b346d5461051ae0/ang1.png?raw=true)
106
+
130
107
  - https://www.npmjs.com/package/anim-3d-obj
@@ -7,7 +7,6 @@ const react_1 = __importDefault(require("react"));
7
7
  const styled_components_1 = __importDefault(require("styled-components"));
8
8
  function Face(props) {
9
9
  let { depth = 10, global = { css: "", body: "" }, height = 10, face, width = 100, } = props;
10
- console.log(face);
11
10
  let transform;
12
11
  let tranz = +height / 2;
13
12
  const body = face.body ? face.body : global.body;
@@ -2,7 +2,6 @@ import React from "react";
2
2
  import styled from "styled-components";
3
3
  export default function Face(props) {
4
4
  let { depth = 10, global = { css: "", body: "" }, height = 10, face, width = 100, } = props;
5
- console.log(face);
6
5
  let transform;
7
6
  let tranz = +height / 2;
8
7
  const body = face.body ? face.body : global.body;
package/package.json CHANGED
@@ -1,13 +1,5 @@
1
1
 
2
2
 
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
3
  {
12
4
  "name": "anim-3d-obj",
13
5
  "repository": {
@@ -15,7 +7,7 @@
15
7
  "url": "https://github.com/mdnelles/anim-3d-obj-npm-publisher.git"
16
8
  },
17
9
  "homepage": "https://github.com/mdnelles/anim-3d-obj-npm-publisher.git",
18
- "version": "1.1.74",
10
+ "version": "1.2.3",
19
11
  "description": "React library for creating 3D objects quickly. Also these objects can be animated",
20
12
  "main": "dist/cjs/index.js",
21
13
  "module": "dist/esm/index.js",