anim-3d-obj 1.1.16 → 1.1.18

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.
Files changed (59) hide show
  1. package/README.md +122 -75
  2. package/dist/cjs/components/Card.d.ts +2 -0
  3. package/dist/cjs/components/Cuboid.d.ts +2 -0
  4. package/dist/cjs/components/Faces/Face.d.ts +4 -0
  5. package/dist/cjs/components/Ribbon.d.ts +2 -0
  6. package/dist/cjs/components/styles/AnimWrap.d.ts +3 -0
  7. package/dist/cjs/components/styles/Anims.d.ts +30 -0
  8. package/dist/cjs/components/styles/Global.d.ts +1 -0
  9. package/dist/cjs/components/styles/Scene.d.ts +11 -0
  10. package/dist/cjs/index.d.ts +5 -0
  11. package/dist/cjs/index.js +4374 -0
  12. package/dist/cjs/index.js.map +1 -0
  13. package/dist/esm/components/Card.d.ts +2 -0
  14. package/dist/esm/components/Cuboid.d.ts +2 -0
  15. package/dist/esm/components/Faces/Face.d.ts +4 -0
  16. package/dist/esm/components/Ribbon.d.ts +2 -0
  17. package/dist/esm/components/styles/AnimWrap.d.ts +3 -0
  18. package/dist/esm/components/styles/Anims.d.ts +30 -0
  19. package/dist/esm/components/styles/Global.d.ts +1 -0
  20. package/dist/esm/components/styles/Scene.d.ts +11 -0
  21. package/dist/esm/index.d.ts +5 -0
  22. package/dist/esm/index.js +4367 -0
  23. package/dist/esm/index.js.map +1 -0
  24. package/package.json +54 -32
  25. package/.eslintignore +0 -2
  26. package/.eslintrc +0 -32
  27. package/.prettierrc.json +0 -10
  28. package/babel.config.json +0 -18
  29. package/dist/components/Card.tsx +0 -55
  30. package/dist/components/Cuboid.tsx +0 -61
  31. package/dist/components/Faces/Face.tsx +0 -72
  32. package/dist/components/Faces/FaceInter.d.ts +0 -39
  33. package/dist/components/Ribbon.tsx +0 -57
  34. package/dist/components/styles/Anim.d.ts +0 -16
  35. package/dist/components/styles/AnimWrap.tsx +0 -92
  36. package/dist/components/styles/Anims.ts +0 -290
  37. package/dist/components/styles/Global.ts +0 -7
  38. package/dist/components/styles/Scene.tsx +0 -30
  39. package/dist/index.ts +0 -9
  40. package/jestconfig.json +0 -8
  41. package/public/favicon.ico +0 -0
  42. package/public/index.html +0 -43
  43. package/public/logo192.png +0 -0
  44. package/public/logo512.png +0 -0
  45. package/public/manifest.json +0 -25
  46. package/public/robots.txt +0 -3
  47. package/src/components/Card.tsx +0 -55
  48. package/src/components/Cuboid.tsx +0 -61
  49. package/src/components/Faces/Face.tsx +0 -72
  50. package/src/components/Faces/FaceInter.d.ts +0 -39
  51. package/src/components/Ribbon.tsx +0 -57
  52. package/src/components/styles/Anim.d.ts +0 -16
  53. package/src/components/styles/AnimWrap.tsx +0 -92
  54. package/src/components/styles/Anims.ts +0 -290
  55. package/src/components/styles/Global.ts +0 -7
  56. package/src/components/styles/Scene.tsx +0 -30
  57. package/src/index.ts +0 -9
  58. package/tests/common.test.tsx +0 -29
  59. package/tsconfig.json +0 -29
package/README.md CHANGED
@@ -3,105 +3,152 @@
3
3
  This project allows a user to create Cuboids of any size simply by entering a set of parameters.
4
4
  The program does the leg work with regard to calculating translationZ depth and config on the fly.
5
5
 
6
- ## Deployment
7
-
8
- Install sequence
9
-
10
- ```
11
- git clone https://github.com/mdnelles/anim-3d-objs.git
12
- npm i
13
- npm run start
14
- ```
6
+ - [GIT HOME](https://github.com/mdnelles/anim-3d-objs-launcher)
7
+ - [NPM HOME](https://www.npmjs.com/package/anim-3d-obj) npm i anim-3d-obj
15
8
 
16
9
  ## Examples
17
10
 
18
- All sided simple https://codesandbox.io/s/anim-3d-obj-all-sides-simple-sdy1q0
19
-
20
- Two sided simple https://codesandbox.io/s/anim-3d-obj-2-sides-simple-9wognm
21
-
22
- 90 degree wobble on X axis https://codesandbox.io/s/anim-3d-obj-wobblex-08mxqe
23
-
24
- speed wobble(y) 3 sides https://codesandbox.io/s/anim-3d-obj-3-sides-wobble-y-axis-dceqdp
25
-
26
- ## Authors
11
+ - [6 sided Cuboid - animate X360 Y360](https://codesandbox.io/s/anim-3d-obj-all-sides-simple-bf67yg)
12
+ - [3 sided Object - animate y-axis](https://codesandbox.io/s/anim-3d-obj-3-sides-wobble-y-axis-wglkms)
13
+ - [Double box spin](https://codesandbox.io/s/react-anim-3d-double-box-spin-vbdhg2)
14
+ - [2 sided object with animation wobble](https://codesandbox.io/s/anim-3d-obj-wobblex-mmidkg)
15
+ - [Parallel divs animated x and y axis in tandem](https://codesandbox.io/s/anim-3d-obj-2-sides-simple-4057y7)
16
+ - [Spinning Slab](https://codesandbox.io/s/react-anim-3d-pulse-kc8g0f)
17
+
18
+ ## Config
19
+
20
+ Animations are optional. Either or both of `anim1Specs` or `anim2Specs` can be applied to the object.
21
+
22
+ ```typescript
23
+ const anim1Specs: object = {
24
+ border: '', // while testing reveal the animation wrapper
25
+ degreesHi: -45, // degrees if spin
26
+ degreesLow: 45, // degrees if spin
27
+ delay: 0, // start delay in seconds
28
+ direction: 'normal', //normal alternating reverse
29
+ duration: 8, // seconds
30
+ fillMode: 'forward', // node forward backward both
31
+ iterationCount: 'infinite', // number or infinte
32
+ name: 'Y360', // ** ANIMATIONS
33
+ timing: 'ease-in-out', // linear ease ease-in-out
34
+ }
35
+ ```
27
36
 
28
- - [@mdnelles](https://github.com/mdnelles)
37
+ `** ANIMATIONS`
38
+
39
+ - X360: rotate 360 degrees on the x-axis
40
+ - Y360: rotate 360 degrees on the y-axis
41
+ - fadeInkf: fade object in from 0 to 1 Opacity
42
+ - wobY: wobble on y-axis (degreesHi <-> degreesLow)
43
+ - wobX: wobble on x-axis (degreesHi <-> degreesLow)
44
+ - fwdx018: spin object on x-axis from 0 degrees to 180 degrees
45
+ - fwdx1836: spin object on x-axis from 180 degrees to 360 degrees
46
+ - fwdx09: spin object on x-axis from 0 degrees to 90 degrees
47
+ - fwdx918: spin object on x-axis from 90 degrees to 180 degrees
48
+ - fwdx1827: spin object on x-axis from 180 degrees to 270 degrees
49
+ - fwdx2736: spin object on x-axis from 270 degrees to 360 degrees
50
+ - fwdy018: spin object on y-axis from 0 degrees to 180 degrees
51
+ - fwdy1836: spin object on y-axis from 180 degrees to 360 degrees
52
+ - fwdy09: spin object on y-axis from 0 degrees to 90 degrees
53
+ - fwdy918: spin object on y-axis from 90 degrees to 180 degrees
54
+ - fwdy1827: spin object on y-axis from 180 degrees to 270 degrees
55
+ - fwdy2736: spin object on y-axis from 270 degrees to 360 degrees
56
+ - floatX: float object so is not stationary
57
+ - floatShadow: float object + add shadow
58
+ - pulseSM: pulse object Small
59
+ - pulseMD: pulse object Medium
60
+ - pulseLG: pulse object Large
61
+ - noAnim: no animation place holder
62
+
63
+ <>
64
+
65
+ GLOBAL CONFIG
66
+
67
+ ```typescript
68
+ // EXAMPLE GLOBAL FACE CONFIG
69
+ // This will be applied to all Faces that do not have their own custom config
70
+ const global: object = {
71
+ // // face individual styles (over rides global)
72
+ css: `
73
+ border: 1px solid #fff;
74
+ background: rgb(2,0,36);
75
+ background: linear-gradient(180deg, rgba(255,255,255,.1) 0%, rgba(141,191,249,.7) 100%);
76
+ color:white;
77
+ text-align:center;
78
+ line-height:10;
79
+ backface-visibility: visible;
80
+ font-family: Arial, Helvetica, sans-serif;
81
+ border-radius:5px;
82
+ `,
83
+ body: ' ',
84
+ }
85
+ ```
29
86
 
30
- ## Demo
87
+ <>
31
88
 
32
- The following code
89
+ CUSTOM CONFIG FOR INDIVIDUAL FACES
33
90
 
34
- ```
35
- const indivStyles: object = {
91
+ ```typescript
92
+ const custom: object = {
36
93
  // // face individual styles (over rides global)
37
- bottom: {
38
- bfv: "visible",
39
- fontFamily: "Helvetica",
40
- },
41
94
  front: {
42
- border: "1px solid #f00",
43
- bgc: "#f00",
44
- bfv: "visible",
45
- fontFamily: "Arial, Sans",
95
+ css: ``,
96
+ body: <Login />,
46
97
  },
47
98
  left: {
48
- bgc: "yellow",
49
- },
50
- top: {
51
- bgc: "pink",
99
+ css: `
100
+ border: 1px solid #fff;
101
+ background: rgb(2,0,36);
102
+ color:white;
103
+ text-align: center;
104
+ line-height:8;`
105
+ body: " ",
52
106
  },
53
107
  right: {
54
- bgc: "purple",
108
+ css: ``,
109
+ body: " ",
55
110
  },
56
111
  back: {
57
- border: "1px solid #f00",
58
- bgc: "#0f0",
59
- bfv: "visible",
60
- fontFamily: "Arial, Sans",
112
+ css: ``,
113
+ body: <Logout />,
114
+ },
115
+ bottom: {
116
+ css: `
117
+ background-color:rgba(141,191,249,1);
118
+ -webkit-box-shadow: 0px 0px 23px 18px #858585;
119
+ box-shadow: 0px 0px 23px 18px #858585;
120
+ `,
61
121
  },
62
- };
63
122
  ```
64
123
 
124
+ ## Render
125
+
65
126
  and
66
127
 
67
- ```
68
- <Cuboid
69
- width={260}
70
- depth={260}
71
- height={92}
72
- perspectiveOrigin='50% 50%'
73
- zIndex={10}
74
- animSpecs={animSpecs}
75
- indivStyles={indivStyles}
76
- faces={faceprops}
77
- globalStyles={globalStyles}
78
- >
79
- {}
80
- </Cuboid>
128
+ ```typescript
129
+ <Cuboid
130
+ width={250}
131
+ height={300}
132
+ depth={250}
133
+ perspective={800}
134
+ perspectiveOrigin='50% 50%'
135
+ zIndex={10}
136
+ anim1Specs={anim1Specs}
137
+ anim2Specs={anim2Specs}
138
+ custom={custom}
139
+ faces={faceprops}
140
+ global={global}
141
+ />
81
142
  ```
82
143
 
83
144
  will produce the following
84
145
 
85
146
  ![Logo](https://raw.githubusercontent.com/mdnelles/objs-local/main/img.png?token=GHSAT0AAAAAABQVNJ4VATWQM4SI3LXSTDZWYVDOL7Q)
86
147
 
87
- ##Face Format
88
- for things like `background-image: url("myImg.png");` they can be done in `moreStyles` argument.
148
+ ## Authors
89
149
 
90
- ```
91
- const Specs: any = styled.div`
92
- opacity: ${opac ? opac : globalStyles.opac};
93
- position: ${position};
94
- left: ${left};
95
- margin: ${margin};
96
- padding: ${padding};
97
- width: ${width}px;
98
- font-family: ${fontFamily};
99
- height: ${height}px;
100
- background-color: ${bgc ? bgc : globalStyles.bgc};
101
- border: ${border ? border : globalStyles.border};
102
- backface-visibility: ${bfv ? bfv : globalStyles.bfv};
103
- ${transform}
104
- top: ${top};
105
- ${moreStyles}
106
- `;
107
- ```
150
+ - [@mdnelles](https://github.com/mdnelles)
151
+
152
+ ## License
153
+
154
+ [MIT](https://choosealicense.com/licenses/mit/)
@@ -0,0 +1,2 @@
1
+ import { ObjProps } from './Faces/FaceInter';
2
+ export declare const Card: (props: ObjProps) => any;
@@ -0,0 +1,2 @@
1
+ import { ObjProps } from './Faces/FaceInter';
2
+ export declare const Cuboid: (props: ObjProps) => any;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { FaceProps } from './FaceInter';
3
+ declare const Face: (props: FaceProps) => JSX.Element;
4
+ export default Face;
@@ -0,0 +1,2 @@
1
+ import { ObjProps } from './Faces/FaceInter';
2
+ export declare const Ribbon: (props: ObjProps) => any;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { AnimStylesProps } from './Anim';
3
+ export declare const AnimWrap: (props: AnimStylesProps) => JSX.Element;
@@ -0,0 +1,30 @@
1
+ interface AllAnimsProps {
2
+ degreesLow?: number;
3
+ degreesHi?: number;
4
+ }
5
+ export declare const allAnims: (props: AllAnimsProps) => {
6
+ X360: any;
7
+ Y360: any;
8
+ fadeInkf: any;
9
+ wobY: any;
10
+ wobX: any;
11
+ fwdx018: any;
12
+ fwdx1836: any;
13
+ fwdx09: any;
14
+ fwdx918: any;
15
+ fwdx1827: any;
16
+ fwdx2736: any;
17
+ fwdy018: any;
18
+ fwdy1836: any;
19
+ fwdy09: any;
20
+ fwdy918: any;
21
+ fwdy1827: any;
22
+ fwdy2736: any;
23
+ floatX: any;
24
+ floatShadow: any;
25
+ pulseSM: any;
26
+ pulseMD: any;
27
+ pulseLG: any;
28
+ noAnim: any;
29
+ };
30
+ export {};
@@ -0,0 +1 @@
1
+ export declare const ObjWrapper: any;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ interface SceneStyleProps {
3
+ width?: number | string;
4
+ height?: number | string;
5
+ perspective?: number | string | undefined;
6
+ perspectiveOrigin?: string | undefined;
7
+ zIndex?: number | undefined;
8
+ children: any;
9
+ }
10
+ export declare const SceneStyle: (props: SceneStyleProps) => JSX.Element;
11
+ export {};
@@ -0,0 +1,5 @@
1
+ import Face from './components/Faces/Face';
2
+ import { Cuboid } from './components/Cuboid';
3
+ import { Ribbon } from './components/Ribbon';
4
+ import { Card } from './components/Card';
5
+ export { Face, Cuboid, Ribbon, Card };