anim-3d-obj 1.1.12 → 1.1.13
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 +108 -154
- package/img.png +0 -0
- package/package.json +47 -46
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/robots.txt +3 -0
- package/src/App.css +810 -0
- package/src/App.test.tsx +10 -0
- package/src/App.tsx +83 -0
- package/src/components/Cuboid.tsx +112 -0
- package/src/components/Faces/Face.tsx +105 -0
- package/src/components/Faces/FaceInter.d.ts +70 -0
- package/src/components/index.ts +2 -0
- package/src/components/styles/Anim.d.ts +11 -0
- package/src/components/styles/AnimWrap.tsx +79 -0
- package/src/components/styles/Anims.ts +205 -0
- package/src/components/styles/Scene.tsx +33 -0
- package/src/index.tsx +19 -0
- package/src/reportWebVitals.ts +15 -0
- package/src/setupTests.ts +5 -0
- package/tsconfig.json +26 -0
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -1,154 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
body: " ",
|
|
110
|
-
},
|
|
111
|
-
back: {
|
|
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
|
-
`,
|
|
121
|
-
},
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
## Render
|
|
125
|
-
|
|
126
|
-
and
|
|
127
|
-
|
|
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
|
-
/>
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
will produce the following
|
|
145
|
-
|
|
146
|
-

|
|
147
|
-
|
|
148
|
-
## Authors
|
|
149
|
-
|
|
150
|
-
- [@mdnelles](https://github.com/mdnelles)
|
|
151
|
-
|
|
152
|
-
## License
|
|
153
|
-
|
|
154
|
-
[MIT](https://choosealicense.com/licenses/mit/)
|
|
1
|
+
|
|
2
|
+
# React Typescript Cuboid Builder
|
|
3
|
+
|
|
4
|
+
This project allows a user to create Cuboids of any size simply by entering a set of parameters.
|
|
5
|
+
The program does the leg work with regard to calculating translationZ depth and config on the fly.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Deployment
|
|
10
|
+
|
|
11
|
+
Install sequence
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
git clone https://github.com/mdnelles/anim-3d-objs.git
|
|
15
|
+
npm i
|
|
16
|
+
npm run start
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Examples
|
|
20
|
+
All sided simple https://codesandbox.io/s/anim-3d-obj-all-sides-simple-sdy1q0
|
|
21
|
+
|
|
22
|
+
Two sided simple https://codesandbox.io/s/anim-3d-obj-2-sides-simple-9wognm
|
|
23
|
+
|
|
24
|
+
90 degree wobble on X axis https://codesandbox.io/s/anim-3d-obj-wobblex-08mxqe
|
|
25
|
+
|
|
26
|
+
speed wobble(y) 3 sides https://codesandbox.io/s/anim-3d-obj-3-sides-wobble-y-axis-dceqdp
|
|
27
|
+
|
|
28
|
+
## Authors
|
|
29
|
+
|
|
30
|
+
- [@mdnelles](https://github.com/mdnelles)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## Demo
|
|
34
|
+
|
|
35
|
+
The following code
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
const indivStyles: object = {
|
|
39
|
+
// // face individual styles (over rides global)
|
|
40
|
+
bottom: {
|
|
41
|
+
bfv: "visible",
|
|
42
|
+
fontFamily: "Helvetica",
|
|
43
|
+
},
|
|
44
|
+
front: {
|
|
45
|
+
border: "1px solid #f00",
|
|
46
|
+
bgc: "#f00",
|
|
47
|
+
bfv: "visible",
|
|
48
|
+
fontFamily: "Arial, Sans",
|
|
49
|
+
},
|
|
50
|
+
left: {
|
|
51
|
+
bgc: "yellow",
|
|
52
|
+
},
|
|
53
|
+
top: {
|
|
54
|
+
bgc: "pink",
|
|
55
|
+
},
|
|
56
|
+
right: {
|
|
57
|
+
bgc: "purple",
|
|
58
|
+
},
|
|
59
|
+
back: {
|
|
60
|
+
border: "1px solid #f00",
|
|
61
|
+
bgc: "#0f0",
|
|
62
|
+
bfv: "visible",
|
|
63
|
+
fontFamily: "Arial, Sans",
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
and
|
|
69
|
+
```
|
|
70
|
+
<Cuboid
|
|
71
|
+
width={260}
|
|
72
|
+
depth={260}
|
|
73
|
+
height={92}
|
|
74
|
+
perspectiveOrigin='50% 50%'
|
|
75
|
+
zIndex={10}
|
|
76
|
+
animSpecs={animSpecs}
|
|
77
|
+
indivStyles={indivStyles}
|
|
78
|
+
faces={faceprops}
|
|
79
|
+
globalStyles={globalStyles}
|
|
80
|
+
>
|
|
81
|
+
{}
|
|
82
|
+
</Cuboid>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
will produce the following
|
|
86
|
+
|
|
87
|
+

|
|
88
|
+
|
|
89
|
+
##Face Format
|
|
90
|
+
for things like `background-image: url("myImg.png");` they can be done in `moreStyles` argument.
|
|
91
|
+
```
|
|
92
|
+
const Specs: any = styled.div`
|
|
93
|
+
opacity: ${!!opac ? opac : globalStyles.opac};
|
|
94
|
+
position: ${position};
|
|
95
|
+
left: ${left};
|
|
96
|
+
margin: ${margin};
|
|
97
|
+
padding: ${padding};
|
|
98
|
+
width: ${width}px;
|
|
99
|
+
font-family: ${fontFamily};
|
|
100
|
+
height: ${height}px;
|
|
101
|
+
background-color: ${!!bgc ? bgc : globalStyles.bgc};
|
|
102
|
+
border: ${!!border ? border : globalStyles.border};
|
|
103
|
+
backface-visibility: ${!!bfv ? bfv : globalStyles.bfv};
|
|
104
|
+
${transform}
|
|
105
|
+
top: ${top};
|
|
106
|
+
${moreStyles}
|
|
107
|
+
`;
|
|
108
|
+
```
|
package/img.png
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
2
|
+
"name": "anim-3d-obj",
|
|
3
|
+
"version": "1.1.13",
|
|
4
|
+
"private": false,
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"@reduxjs/toolkit": "^1.8.2",
|
|
7
|
+
"@testing-library/jest-dom": "^5.16.4",
|
|
8
|
+
"@testing-library/react": "^13.3.0",
|
|
9
|
+
"@testing-library/user-event": "^14.2.0",
|
|
10
|
+
"@types/jest": "^28.1.1",
|
|
11
|
+
"@types/node": "^17.0.42",
|
|
12
|
+
"@types/react": "^18.0.12",
|
|
13
|
+
"@types/react-dom": "^18.0.5",
|
|
14
|
+
"react": "^18.1.0",
|
|
15
|
+
"react-dom": "^18.1.0",
|
|
16
|
+
"react-redux": "^8.0.2",
|
|
17
|
+
"react-scripts": "5.0.1",
|
|
18
|
+
"styled-components": "^5.3.5",
|
|
19
|
+
"typescript": "^4.7.3",
|
|
20
|
+
"web-vitals": "^2.1.4"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"start": "react-scripts start",
|
|
24
|
+
"build": "react-scripts build",
|
|
25
|
+
"test": "react-scripts test",
|
|
26
|
+
"eject": "react-scripts eject"
|
|
27
|
+
},
|
|
28
|
+
"eslintConfig": {
|
|
29
|
+
"extends": [
|
|
30
|
+
"react-app",
|
|
31
|
+
"react-app/jest"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"browserslist": {
|
|
35
|
+
"production": [
|
|
36
|
+
">0.2%",
|
|
37
|
+
"not dead",
|
|
38
|
+
"not op_mini all"
|
|
39
|
+
],
|
|
40
|
+
"development": [
|
|
41
|
+
"last 1 chrome version",
|
|
42
|
+
"last 1 firefox version",
|
|
43
|
+
"last 1 safari version"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/styled-components": "^5.1.25"
|
|
48
|
+
}
|
|
48
49
|
}
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
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>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
"src": "logo192.png",
|
|
12
|
+
"type": "image/png",
|
|
13
|
+
"sizes": "192x192"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"src": "logo512.png",
|
|
17
|
+
"type": "image/png",
|
|
18
|
+
"sizes": "512x512"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"start_url": ".",
|
|
22
|
+
"display": "standalone",
|
|
23
|
+
"theme_color": "#000000",
|
|
24
|
+
"background_color": "#ffffff"
|
|
25
|
+
}
|