anim-3d-obj 1.1.22 → 1.1.23

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 (102) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -154
  3. package/dist/cjs/components/Button.d.ts +6 -0
  4. package/dist/cjs/components/Button.js +19 -0
  5. package/dist/cjs/components/Button.js.map +1 -0
  6. package/dist/cjs/components/Card.d.ts +2 -0
  7. package/dist/cjs/components/Card.js +25 -0
  8. package/dist/cjs/components/Card.js.map +1 -0
  9. package/dist/cjs/components/Cuboid.d.ts +2 -0
  10. package/dist/cjs/components/Cuboid.js +29 -0
  11. package/dist/cjs/components/Cuboid.js.map +1 -0
  12. package/dist/cjs/components/Faces/Face.d.ts +3 -0
  13. package/dist/cjs/components/Faces/Face.js +84 -0
  14. package/dist/cjs/components/Faces/Face.js.map +1 -0
  15. package/dist/cjs/components/Ribbon.d.ts +2 -0
  16. package/dist/cjs/components/Ribbon.js +26 -0
  17. package/dist/cjs/components/Ribbon.js.map +1 -0
  18. package/dist/cjs/components/index.d.ts +5 -0
  19. package/dist/cjs/components/index.js +22 -0
  20. package/dist/cjs/components/index.js.map +1 -0
  21. package/dist/cjs/components/styles/AnimWrap.d.ts +2 -0
  22. package/dist/cjs/components/styles/AnimWrap.js +86 -0
  23. package/dist/cjs/components/styles/AnimWrap.js.map +1 -0
  24. package/dist/cjs/components/styles/Anims.d.ts +30 -0
  25. package/{src/lib/components/styles/Anims.ts → dist/cjs/components/styles/Anims.js} +62 -77
  26. package/dist/cjs/components/styles/Anims.js.map +1 -0
  27. package/dist/cjs/components/styles/Global.d.ts +1 -0
  28. package/dist/cjs/components/styles/Global.js +14 -0
  29. package/dist/cjs/components/styles/Global.js.map +1 -0
  30. package/dist/cjs/components/styles/Scene.d.ts +10 -0
  31. package/dist/cjs/components/styles/Scene.js +23 -0
  32. package/dist/cjs/components/styles/Scene.js.map +1 -0
  33. package/dist/cjs/index.d.ts +1 -0
  34. package/dist/cjs/index.js +20 -0
  35. package/dist/cjs/index.js.map +1 -0
  36. package/dist/esm/components/Button.d.ts +6 -0
  37. package/dist/esm/components/Button.js +12 -0
  38. package/dist/esm/components/Button.js.map +1 -0
  39. package/dist/esm/components/Card.d.ts +2 -0
  40. package/dist/esm/components/Card.js +18 -0
  41. package/dist/esm/components/Card.js.map +1 -0
  42. package/dist/esm/components/Cuboid.d.ts +2 -0
  43. package/dist/esm/components/Cuboid.js +22 -0
  44. package/dist/esm/components/Cuboid.js.map +1 -0
  45. package/dist/esm/components/Faces/Face.d.ts +3 -0
  46. package/dist/esm/components/Faces/Face.js +79 -0
  47. package/dist/esm/components/Faces/Face.js.map +1 -0
  48. package/dist/esm/components/Ribbon.d.ts +2 -0
  49. package/dist/esm/components/Ribbon.js +19 -0
  50. package/dist/esm/components/Ribbon.js.map +1 -0
  51. package/dist/esm/components/index.d.ts +5 -0
  52. package/dist/esm/components/index.js +6 -0
  53. package/dist/esm/components/index.js.map +1 -0
  54. package/dist/esm/components/styles/AnimWrap.d.ts +2 -0
  55. package/dist/esm/components/styles/AnimWrap.js +79 -0
  56. package/dist/esm/components/styles/AnimWrap.js.map +1 -0
  57. package/dist/esm/components/styles/Anims.d.ts +30 -0
  58. package/dist/{components/styles/Anims.ts → esm/components/styles/Anims.js} +58 -77
  59. package/dist/esm/components/styles/Anims.js.map +1 -0
  60. package/dist/esm/components/styles/Global.d.ts +1 -0
  61. package/dist/esm/components/styles/Global.js +8 -0
  62. package/dist/esm/components/styles/Global.js.map +1 -0
  63. package/dist/esm/components/styles/Scene.d.ts +10 -0
  64. package/dist/esm/components/styles/Scene.js +16 -0
  65. package/dist/esm/components/styles/Scene.js.map +1 -0
  66. package/dist/esm/index.d.ts +1 -0
  67. package/dist/esm/index.js +4 -0
  68. package/dist/esm/index.js.map +1 -0
  69. package/package.json +38 -61
  70. package/babel.config.json +0 -18
  71. package/dist/components/Card.tsx +0 -56
  72. package/dist/components/Cuboid.tsx +0 -61
  73. package/dist/components/Face/face.d.ts +0 -39
  74. package/dist/components/Face/index.tsx +0 -85
  75. package/dist/components/Ribbon.tsx +0 -58
  76. package/dist/components/styles/Anim.d.ts +0 -16
  77. package/dist/components/styles/AnimWrap.tsx +0 -85
  78. package/dist/components/styles/Global.ts +0 -7
  79. package/dist/components/styles/Scene.tsx +0 -37
  80. package/dist/index.ts +0 -6
  81. package/img.png +0 -0
  82. package/public/favicon.ico +0 -0
  83. package/public/index.html +0 -43
  84. package/public/manifest.json +0 -15
  85. package/public/robots.txt +0 -3
  86. package/src/App.css +0 -11
  87. package/src/App.test.tsx +0 -10
  88. package/src/App.tsx +0 -115
  89. package/src/index.tsx +0 -19
  90. package/src/lib/components/Card.tsx +0 -56
  91. package/src/lib/components/Cuboid.tsx +0 -61
  92. package/src/lib/components/Face/face.d.ts +0 -39
  93. package/src/lib/components/Face/index.tsx +0 -85
  94. package/src/lib/components/Ribbon.tsx +0 -58
  95. package/src/lib/components/styles/Anim.d.ts +0 -16
  96. package/src/lib/components/styles/AnimWrap.tsx +0 -85
  97. package/src/lib/components/styles/Global.ts +0 -7
  98. package/src/lib/components/styles/Scene.tsx +0 -37
  99. package/src/lib/index.ts +0 -6
  100. package/src/reportWebVitals.ts +0 -15
  101. package/src/setupTests.ts +0 -5
  102. package/tsconfig.json +0 -26
@@ -1,61 +0,0 @@
1
- import React from "react";
2
- import { AnimWrap } from "./styles/AnimWrap";
3
- import { SceneStyle } from "./styles/Scene";
4
- import { ObjProps } from "./Face/face";
5
- import Face from "./Face";
6
- import { ObjWrapper } from "./styles/Global";
7
-
8
- export const Cuboid = (props: ObjProps): any => {
9
- let {
10
- anim1Specs,
11
- anim2Specs,
12
- width = 5,
13
- height = 5,
14
- depth = 5,
15
- faces,
16
- global = {},
17
- custom = {},
18
- tranz = (+height / 2) | 0,
19
- perspective,
20
- perspectiveOrigin,
21
- zIndex,
22
- } = props;
23
-
24
- const buildFace = (faceType: any): any => {
25
- return (
26
- <Face
27
- width={width}
28
- height={height}
29
- depth={depth}
30
- faceType={faceType}
31
- id={faceType}
32
- tranz={tranz}
33
- global={global}
34
- custom={custom}
35
- />
36
- );
37
- };
38
-
39
- return (
40
- <SceneStyle
41
- width={width}
42
- height={height}
43
- perspective={perspective}
44
- perspectiveOrigin={perspectiveOrigin}
45
- zIndex={zIndex}
46
- >
47
- <AnimWrap animSpecs={anim1Specs}>
48
- <AnimWrap animSpecs={anim2Specs}>
49
- <ObjWrapper>
50
- {!!faces && !!faces.front ? buildFace("front") : null}
51
- {!!faces && !!faces.right ? buildFace("right") : null}
52
- {!!faces && !!faces.back ? buildFace("back") : null}
53
- {!!faces && !!faces.left ? buildFace("left") : null}
54
- {!!faces && !!faces.top ? buildFace("top") : null}
55
- {!!faces && !!faces.bottom ? buildFace("bottom") : null}
56
- </ObjWrapper>
57
- </AnimWrap>
58
- </AnimWrap>
59
- </SceneStyle>
60
- );
61
- };
@@ -1,39 +0,0 @@
1
- export interface FaceProps {
2
- children?: any;
3
- depth?: number | any;
4
- faceType?: any;
5
- custom?: any;
6
- global?: any;
7
- height?: number | string;
8
- id?: string | number | boolean;
9
- styles?: object | any;
10
- tranz: any;
11
- width?: number | string;
12
- }
13
-
14
- export interface ObjProps {
15
- anim1Specs?: object | undefined;
16
- anim2Specs?: object | undefined;
17
- children: any;
18
- depth?: number;
19
- global?: { border?: string; bgc?: string; opac?: number | string } | any;
20
- faces?:
21
- | {
22
- front: boolean;
23
- back: boolean;
24
- left: boolean;
25
- right: boolean;
26
- top: boolean;
27
- bottom: boolean;
28
- }
29
- | undefined;
30
-
31
- height?: number | string;
32
- custom?: object | string | undefined;
33
- perspective?: string | number | undefined;
34
- perspectiveOrigin?: string | undefined;
35
- tranz?: number | undefined;
36
- txt?: string | any;
37
- width?: number;
38
- zIndex?: number | undefined;
39
- }
@@ -1,85 +0,0 @@
1
- import styled from "styled-components";
2
- import React from "react";
3
- import { FaceProps } from "./face";
4
-
5
- const Face = (props: FaceProps): JSX.Element => {
6
- let {
7
- depth = 10,
8
- faceType,
9
- global = {},
10
- height = 10,
11
- custom = false,
12
- tranz = 80,
13
- width = 100,
14
- } = props;
15
-
16
- let transform;
17
- let styles =
18
- !!custom[faceType] && !!custom[faceType].css
19
- ? custom[faceType].css
20
- : global.css;
21
- const body =
22
- !!custom[faceType] && !!custom[faceType].body
23
- ? custom[faceType].body
24
- : global.body;
25
- if (faceType === "bottom") {
26
- tranz = +height - +depth / 2;
27
- height = +depth;
28
- transform = `transform: rotateX(-90deg) translateZ(${tranz}px);`;
29
- //styles = !!custom["top"] ? custom : global;
30
- } else if (faceType === "top") {
31
- height = +depth;
32
- if (!!depth) tranz = +depth / 2;
33
- transform = `transform: rotateX(90deg) translateZ(${tranz}px);`;
34
- } else if (faceType === "front") {
35
- if (!!depth) tranz = +depth / 2;
36
- transform = `transform: rotateY(0deg) translateZ(${tranz}px);`;
37
- } else if (faceType === "back") {
38
- if (!!depth) tranz = +depth / 2;
39
- transform = `transform: rotateY(180deg) translateZ(${tranz}px);`;
40
- } else if (faceType === "right") {
41
- if (height > width && !depth) {
42
- tranz = -(+height / 2 - +width);
43
- width = +height;
44
- } else if (width > height && !depth) {
45
- tranz = +height / 2;
46
- height = +width;
47
- } else {
48
- tranz = +width - +depth / 2;
49
- width = +depth;
50
- }
51
- transform = `transform: rotateY(90deg) translateZ(${tranz}px);`;
52
- // topr is to of Ribbon which points back
53
- } else if (faceType === "topr") {
54
- height = +depth;
55
- if (!!depth) tranz = +depth / 2;
56
- let offset = depth / 2;
57
- transform = `transform: rotateX(90deg) translateZ(${tranz}px ); `;
58
- } else {
59
- if (height > width && !depth) {
60
- tranz = -(+height / 2 - +width);
61
- width = +height;
62
- } else if (width > height && !depth) {
63
- tranz = +height / 2;
64
- height = +width;
65
- } else {
66
- tranz = +depth / 2;
67
- width = +depth;
68
- }
69
- transform = `transform: rotateY(-90deg) translateZ(${tranz}px);`;
70
- }
71
-
72
- const BackFlip: any = styled.section``;
73
-
74
- const Specs: any = styled.section`
75
- ${styles}
76
- width: ${width}px;
77
- position: absolute;
78
- height: ${height}px;
79
- ${transform};
80
- `;
81
-
82
- return <Specs>{body}</Specs>;
83
- };
84
-
85
- export default Face;
@@ -1,58 +0,0 @@
1
- import React from "react";
2
- import { AnimWrap } from "./styles/AnimWrap";
3
- import { SceneStyle } from "./styles/Scene";
4
- import { ObjProps } from "./Face/face";
5
- import Face from "./Face";
6
- import { ObjWrapper } from "./styles/Global";
7
-
8
- export const Ribbon = (props: ObjProps): any => {
9
- let {
10
- anim1Specs,
11
- anim2Specs,
12
- width = 5,
13
- height = 5,
14
- depth = 5,
15
- faces,
16
- global = {},
17
- custom = {},
18
- tranz = (+height / 2) | 0,
19
- perspective,
20
- perspectiveOrigin,
21
- zIndex,
22
- } = props;
23
-
24
- const buildFace = (faceType: any): any => {
25
- return (
26
- <Face
27
- width={width}
28
- height={height}
29
- depth={depth}
30
- faceType={faceType}
31
- id={faceType}
32
- tranz={tranz}
33
- global={global}
34
- custom={custom}
35
- />
36
- );
37
- };
38
-
39
- return (
40
- <SceneStyle
41
- width={width}
42
- height={height}
43
- perspective={perspective}
44
- perspectiveOrigin={perspectiveOrigin}
45
- zIndex={zIndex}
46
- >
47
- <AnimWrap animSpecs={anim1Specs}>
48
- <AnimWrap animSpecs={anim2Specs}>
49
- <ObjWrapper>
50
- {!!faces && !!faces.bottom ? buildFace("bottom") : null}
51
- {!!faces && !!faces.back ? buildFace("back") : null}
52
- {!!faces && !!faces.top ? buildFace("topr") : null}
53
- </ObjWrapper>
54
- </AnimWrap>
55
- </AnimWrap>
56
- </SceneStyle>
57
- );
58
- };
@@ -1,16 +0,0 @@
1
- export interface AnimStylesProps {
2
- children?: any;
3
- animSpecs?: any;
4
- }
5
- export interface AnimSpecsProps {
6
- border?: string | undefined;
7
- degreesHi?: number | undefined;
8
- degreesLow?: number | undefined;
9
- delay: any;
10
- direction?: string | undefined;
11
- duration?: number | string | undefined;
12
- fillMode?: string | undefined;
13
- iterationCount?: number | string | undefined;
14
- name?: string | undefined;
15
- timing?: string | undefined;
16
- }
@@ -1,85 +0,0 @@
1
- import styled from "styled-components";
2
- import React from "react";
3
- import { AnimStylesProps } from "./Anim";
4
- import { allAnims } from "./Anims";
5
-
6
- export const AnimWrap = (props: AnimStylesProps) => {
7
- const { children, animSpecs } = props;
8
- const AS: any = animSpecs;
9
-
10
- const {
11
- X360,
12
- Y360,
13
- fadeInkf,
14
- wobY,
15
- wobX,
16
- fwdx018,
17
- fwdx1836,
18
- fwdx09,
19
- fwdx918,
20
- fwdx1827,
21
- fwdx2736,
22
- fwdy018,
23
- fwdy1836,
24
- fwdy09,
25
- fwdy918,
26
- fwdy1827,
27
- fwdy2736,
28
- floatX,
29
- floatShadow,
30
- pulseSM,
31
- pulseMD,
32
- pulseLG,
33
- noAnim,
34
- } = allAnims({ degreesHi: AS.degreesHi, degreesLow: AS.degreesLow });
35
-
36
- let theAnim: any = "noAnim";
37
- // need to iterate through all animation posibilities and not use eval() to satisfy TS
38
- if (AS.name === "X360") theAnim = X360;
39
- else if (AS.name === "Y360") theAnim = Y360;
40
- else if (AS.name === "fadeInkf") theAnim = fadeInkf;
41
- else if (AS.name === "wobX") theAnim = wobX;
42
- else if (AS.name === "wobY") theAnim = wobY;
43
- else if (AS.name === "fwdx018") theAnim = fwdx018;
44
- else if (AS.name === "fwdx1836") theAnim = fwdx1836;
45
- else if (AS.name === "fwdx09") theAnim = fwdx09;
46
- else if (AS.name === "fwdx918") theAnim = fwdx918;
47
- else if (AS.name === "fwdx1827") theAnim = fwdx1827;
48
- else if (AS.name === "fwdx2736") theAnim = fwdx2736;
49
- else if (AS.name === "fwdy018") theAnim = fwdy018;
50
- else if (AS.name === "fwdy1836") theAnim = fwdy1836;
51
- else if (AS.name === "fwdy09") theAnim = fwdy09;
52
- else if (AS.name === "fwdy918") theAnim = fwdy918;
53
- else if (AS.name === "fwdy1827") theAnim = fwdy1827;
54
- else if (AS.name === "fwdy2736") theAnim = fwdy2736;
55
- else if (AS.name === "floatX") theAnim = floatX;
56
- else if (AS.name === "floatShadow") theAnim = floatShadow;
57
- else if (AS.name === "pulseSM") theAnim = pulseSM;
58
- else if (AS.name === "pulseMD") theAnim = pulseMD;
59
- else if (AS.name === "pulseLG") theAnim = pulseLG;
60
- else theAnim = noAnim;
61
-
62
- const AnimWrapDiv: any = styled.div`
63
- width: 100%;
64
- height: 100%;
65
- position: relative;
66
- transform-style: preserve-3d;
67
- border: ${AS.border};
68
- -webkit-animation-duration: ${AS.duration}s;
69
- animation-duration: ${AS.duration}s;
70
- -webkit-animation-iteration-count: ${AS.iterationCount};
71
- animation-iteration-count: ${AS.iterationCount};
72
- -webkit-animation-name: ${theAnim};
73
- animation-name: ${theAnim};
74
- -webkit-animation-fill-mode: ${AS.fillMode};
75
- animation-fill-mode: ${AS.fillMode};
76
- animation-direction: ${AS.direction};
77
- -webkit-animation-direction: ${AS.direction};
78
- -webkit-animation-timing-function: ${AS.timing};
79
- animation-timing-function: ${AS.timing};
80
- -webkit-animation-delay: ${AS.delay}s;
81
- animation-delay: ${AS.delay}s;
82
- `;
83
-
84
- return <AnimWrapDiv>{children}</AnimWrapDiv>;
85
- };
@@ -1,7 +0,0 @@
1
- import styled from "styled-components";
2
- export const ObjWrapper = styled.div`
3
- width: 100%;
4
- height: 100%;
5
- position: relative;
6
- transform-style: preserve-3d;
7
- `;
@@ -1,37 +0,0 @@
1
- import styled from "styled-components";
2
- import React from "react";
3
-
4
- interface SceneStyleProps {
5
- width?: number | string;
6
- height?: number | string;
7
- perspective?: number | string | undefined;
8
- perspectiveOrigin?: string | undefined;
9
- zIndex?: number | undefined;
10
- children: any;
11
- }
12
-
13
- export const SceneStyle = (props: SceneStyleProps) => {
14
- const {
15
- width = 0,
16
- height = 0,
17
- perspective = 600,
18
- perspectiveOrigin = "50% 50%",
19
- zIndex = 10,
20
- children = {},
21
- } = props;
22
-
23
- const SceneStyleDiv: any = styled.div`
24
- width: ${width}px;
25
- height: ${height}px;
26
- -webkit-perspective: ${perspective}px;
27
- perspective: ${perspective}px;
28
- -webkit-perspective-origin: ${perspectiveOrigin};
29
- perspective-origin: ${perspectiveOrigin};
30
- `;
31
-
32
- return (
33
- <div style={{ zIndex }}>
34
- <SceneStyleDiv>{children}</SceneStyleDiv>
35
- </div>
36
- );
37
- };
package/dist/index.ts DELETED
@@ -1,6 +0,0 @@
1
- import Face from "./components/Face";
2
- import { Cuboid } from "./components/Cuboid";
3
- import { Card } from "./components/Card";
4
- import { Ribbon } from "./components/Ribbon";
5
-
6
- export { Face, Cuboid, Card, Ribbon };
package/img.png DELETED
Binary file
Binary file
package/public/index.html DELETED
@@ -1,43 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1" />
7
- <meta name="theme-color" content="#000000" />
8
- <meta
9
- name="description"
10
- content="Web site created using create-react-app"
11
- />
12
- <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13
- <!--
14
- manifest.json provides metadata used when your web app is installed on a
15
- user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16
- -->
17
- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18
- <!--
19
- Notice the use of %PUBLIC_URL% in the tags above.
20
- It will be replaced with the URL of the `public` folder during the build.
21
- Only files inside the `public` folder can be referenced from the HTML.
22
-
23
- Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24
- work correctly both with client-side routing and a non-root public URL.
25
- Learn how to configure a non-root public URL by running `npm run build`.
26
- -->
27
- <title>React Redux App</title>
28
- </head>
29
- <body>
30
- <noscript>You need to enable JavaScript to run this app.</noscript>
31
- <div id="root"></div>
32
- <!--
33
- This HTML file is a template.
34
- If you open it directly in the browser, you will see an empty page.
35
-
36
- You can add webfonts, meta tags, or analytics to this file.
37
- The build step will place the bundled scripts into the <body> tag.
38
-
39
- To begin the development, run `npm start` or `yarn start`.
40
- To create a production bundle, use `npm run build` or `yarn build`.
41
- -->
42
- </body>
43
- </html>
@@ -1,15 +0,0 @@
1
- {
2
- "short_name": "React App",
3
- "name": "Create React App Sample",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- }
10
- ],
11
- "start_url": ".",
12
- "display": "standalone",
13
- "theme_color": "#000000",
14
- "background_color": "#ffffff"
15
- }
package/public/robots.txt DELETED
@@ -1,3 +0,0 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
3
- Disallow:
package/src/App.css DELETED
@@ -1,11 +0,0 @@
1
- /*
2
- * Prefixed by https://autoprefixer.github.io
3
- * PostCSS: v8.4.12,
4
- * Autoprefixer: v10.4.4
5
- * Browsers: last 4 version
6
- */
7
-
8
- body {
9
- height: 100%;
10
- background-color: "#999";
11
- }
package/src/App.test.tsx DELETED
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import { render } from "@testing-library/react";
3
- import { Provider } from "react-redux";
4
- import App from "./App";
5
-
6
- test("renders learn react link", () => {
7
- const { getByText } = render(<App />);
8
-
9
- expect(getByText(/learn/i)).toBeInTheDocument();
10
- });
package/src/App.tsx DELETED
@@ -1,115 +0,0 @@
1
- import { Cuboid } from "./lib/components/Cuboid";
2
- import { Ribbon } from "./lib/components/Ribbon";
3
- import { AnimSpecsProps } from "./lib/components/styles/Anim";
4
- //import { Cuboid,Card } from "anim-3d-objs";
5
-
6
- function App() {
7
- const faceprops = {
8
- front: true,
9
- back: true,
10
- left: true,
11
- right: true,
12
- top: true,
13
- bottom: true,
14
- };
15
-
16
- const global: object = {
17
- // // face individual styles (over rides global)
18
- css: `
19
- border: 1px solid #900;
20
- background-color: red;
21
- color:white;
22
- opacity: 0.7;
23
- backface-visibility: visible;
24
- font-family: Arial, Helvetica, sans-serif;
25
- `,
26
- body: " ",
27
- };
28
- const anim1Specs: object = {
29
- border: "wobX",
30
- degreesHi: -45, // degrees if spin
31
- degreesLow: 45, // degrees if spin
32
- delay: 0,
33
- direction: "normal", //normal altenating reverse
34
- duration: 8,
35
- fillMode: "forward", // node forward backward both
36
- iterationCount: "infinite",
37
- name: "Y360",
38
- timing: "ease-in-out", // linear ease ease-in-out
39
- };
40
- const anim2Specs: object = {
41
- border: "",
42
- degreesHi: 0, // degrees if spin
43
- degreesLow: 180, // degrees if spin
44
- delay: 2,
45
- direction: "normal", //normal altenating reverse
46
- duration: 8,
47
- fillMode: "forward", // node forward backward both
48
- iterationCount: "infinite",
49
- name: "Y360",
50
- timing: "ease-in-out", // linear ease ease-in-out
51
- };
52
-
53
- const custom: object = {
54
- // face individual styles (over rides global)
55
- bottom: {
56
- css: `
57
- background-color: #F00;
58
- opacity: 0.7;
59
- backface-visibility: visible;
60
- font-size:30px;
61
- text-align:center;
62
- line-height:8;
63
- color:white;
64
- `,
65
- body: " ",
66
- },
67
- back: {
68
- css: `
69
- background-color: #900;
70
- opacity: 0.7;
71
- backface-visibility: visible;
72
- color:white;
73
- font-size:30px;
74
- text-align:center;
75
- line-height:8;
76
- `,
77
- body: "BACK",
78
- },
79
- topr: {
80
- css: `
81
- background-color: #500;
82
- opacity: 0.7;
83
- backface-visibility: visible;
84
- font-size:30px;
85
- text-align:center;
86
- line-height:8;
87
- color:white;
88
- `,
89
- body: "TOPR",
90
- },
91
- };
92
-
93
- return (
94
- <div style={{ padding: 150 }}>
95
- <Cuboid
96
- width={300}
97
- height={400}
98
- depth={600}
99
- perspectiveOrigin='50% 50%'
100
- perspective={900}
101
- zIndex={10}
102
- custom={custom}
103
- anim1Specs={anim1Specs}
104
- anim2Specs={anim2Specs}
105
- faces={faceprops}
106
- global={global}
107
- >
108
- {}
109
- </Cuboid>
110
- <div style={{ padding: 5 }} />
111
- </div>
112
- );
113
- }
114
-
115
- export default App;
package/src/index.tsx DELETED
@@ -1,19 +0,0 @@
1
- import React from "react";
2
- import { createRoot } from "react-dom/client";
3
- import { Provider } from "react-redux";
4
- import App from "./App";
5
- import reportWebVitals from "./reportWebVitals";
6
-
7
- const container = document.getElementById("root")!;
8
- const root = createRoot(container);
9
-
10
- root.render(
11
- <React.StrictMode>
12
- <App />
13
- </React.StrictMode>
14
- );
15
-
16
- // If you want to start measuring performance in your app, pass a function
17
- // to log results (for example: reportWebVitals(console.log))
18
- // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
19
- reportWebVitals();
@@ -1,56 +0,0 @@
1
- import React from "react";
2
- import { AnimWrap } from "./styles/AnimWrap";
3
- import { SceneStyle } from "./styles/Scene";
4
- import { ObjProps } from "./Face/face";
5
- import Face from "./Face";
6
- import { ObjWrapper } from "./styles/Global";
7
-
8
- export const Card = (props: ObjProps): any => {
9
- let {
10
- anim1Specs,
11
- anim2Specs,
12
- width = 5,
13
- height = 5,
14
- faces,
15
- global = {},
16
- custom = {},
17
- tranz = (+height / 2) | 0,
18
- perspective,
19
- perspectiveOrigin,
20
- zIndex,
21
- } = props;
22
-
23
- const buildFace = (faceType: any): any => {
24
- return (
25
- <Face
26
- width={width}
27
- height={height}
28
- depth={0.1}
29
- faceType={faceType}
30
- id={faceType}
31
- tranz={tranz}
32
- global={global}
33
- custom={custom}
34
- />
35
- );
36
- };
37
-
38
- return (
39
- <SceneStyle
40
- width={width}
41
- height={height}
42
- perspective={perspective}
43
- perspectiveOrigin={perspectiveOrigin}
44
- zIndex={zIndex}
45
- >
46
- <AnimWrap animSpecs={anim1Specs}>
47
- <AnimWrap animSpecs={anim2Specs}>
48
- <ObjWrapper>
49
- {!!faces && !!faces.front ? buildFace("front") : null}
50
- {!!faces && !!faces.back ? buildFace("back") : null}
51
- </ObjWrapper>
52
- </AnimWrap>
53
- </AnimWrap>
54
- </SceneStyle>
55
- );
56
- };