anim-3d-obj 1.1.21 → 1.1.22
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 +58 -58
- package/babel.config.json +18 -0
- package/dist/components/Card.tsx +56 -0
- package/dist/components/Cuboid.tsx +61 -0
- package/dist/components/Face/face.d.ts +39 -0
- package/dist/components/Face/index.tsx +85 -0
- package/dist/components/Ribbon.tsx +58 -0
- package/dist/components/styles/Anim.d.ts +16 -0
- package/dist/components/styles/AnimWrap.tsx +85 -0
- package/dist/{esm/components/styles/Anims.js → components/styles/Anims.ts} +77 -58
- package/dist/components/styles/Global.ts +7 -0
- package/dist/components/styles/Scene.tsx +37 -0
- package/dist/index.ts +6 -0
- package/img.png +0 -0
- package/package.json +44 -29
- package/public/favicon.ico +0 -0
- package/public/index.html +43 -0
- package/public/manifest.json +15 -0
- package/public/robots.txt +3 -0
- package/src/App.css +11 -0
- package/src/App.test.tsx +10 -0
- package/src/App.tsx +115 -0
- package/src/index.tsx +19 -0
- package/src/lib/components/Card.tsx +56 -0
- package/src/lib/components/Cuboid.tsx +61 -0
- package/src/lib/components/Face/face.d.ts +39 -0
- package/src/lib/components/Face/index.tsx +85 -0
- package/src/lib/components/Ribbon.tsx +58 -0
- package/src/lib/components/styles/Anim.d.ts +16 -0
- package/src/lib/components/styles/AnimWrap.tsx +85 -0
- package/{dist/cjs/components/styles/Anims.js → src/lib/components/styles/Anims.ts} +77 -62
- package/src/lib/components/styles/Global.ts +7 -0
- package/src/lib/components/styles/Scene.tsx +37 -0
- package/src/lib/index.ts +6 -0
- package/src/reportWebVitals.ts +15 -0
- package/src/setupTests.ts +5 -0
- package/tsconfig.json +26 -0
- package/dist/cjs/components/Card.d.ts +0 -2
- package/dist/cjs/components/Card.js +0 -25
- package/dist/cjs/components/Card.js.map +0 -1
- package/dist/cjs/components/Cuboid.d.ts +0 -2
- package/dist/cjs/components/Cuboid.js +0 -29
- package/dist/cjs/components/Cuboid.js.map +0 -1
- package/dist/cjs/components/Faces/Face.d.ts +0 -3
- package/dist/cjs/components/Faces/Face.js +0 -75
- package/dist/cjs/components/Faces/Face.js.map +0 -1
- package/dist/cjs/components/Ribbon.d.ts +0 -2
- package/dist/cjs/components/Ribbon.js +0 -26
- package/dist/cjs/components/Ribbon.js.map +0 -1
- package/dist/cjs/components/index.d.ts +0 -2
- package/dist/cjs/components/index.js +0 -19
- package/dist/cjs/components/index.js.map +0 -1
- package/dist/cjs/components/styles/AnimWrap.d.ts +0 -2
- package/dist/cjs/components/styles/AnimWrap.js +0 -86
- package/dist/cjs/components/styles/AnimWrap.js.map +0 -1
- package/dist/cjs/components/styles/Anims.d.ts +0 -30
- package/dist/cjs/components/styles/Anims.js.map +0 -1
- package/dist/cjs/components/styles/Global.d.ts +0 -1
- package/dist/cjs/components/styles/Global.js +0 -14
- package/dist/cjs/components/styles/Global.js.map +0 -1
- package/dist/cjs/components/styles/Scene.d.ts +0 -10
- package/dist/cjs/components/styles/Scene.js +0 -24
- package/dist/cjs/components/styles/Scene.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -1
- package/dist/cjs/index.js +0 -18
- package/dist/cjs/index.js.map +0 -1
- package/dist/esm/components/Card.d.ts +0 -2
- package/dist/esm/components/Card.js +0 -18
- package/dist/esm/components/Card.js.map +0 -1
- package/dist/esm/components/Cuboid.d.ts +0 -2
- package/dist/esm/components/Cuboid.js +0 -22
- package/dist/esm/components/Cuboid.js.map +0 -1
- package/dist/esm/components/Faces/Face.d.ts +0 -3
- package/dist/esm/components/Faces/Face.js +0 -70
- package/dist/esm/components/Faces/Face.js.map +0 -1
- package/dist/esm/components/Ribbon.d.ts +0 -2
- package/dist/esm/components/Ribbon.js +0 -19
- package/dist/esm/components/Ribbon.js.map +0 -1
- package/dist/esm/components/index.d.ts +0 -2
- package/dist/esm/components/index.js +0 -3
- package/dist/esm/components/index.js.map +0 -1
- package/dist/esm/components/styles/AnimWrap.d.ts +0 -2
- package/dist/esm/components/styles/AnimWrap.js +0 -79
- package/dist/esm/components/styles/AnimWrap.js.map +0 -1
- package/dist/esm/components/styles/Anims.d.ts +0 -30
- package/dist/esm/components/styles/Anims.js.map +0 -1
- package/dist/esm/components/styles/Global.d.ts +0 -1
- package/dist/esm/components/styles/Global.js +0 -8
- package/dist/esm/components/styles/Global.js.map +0 -1
- package/dist/esm/components/styles/Scene.d.ts +0 -10
- package/dist/esm/components/styles/Scene.js +0 -17
- package/dist/esm/components/styles/Scene.js.map +0 -1
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -1
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import { keyframes } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { keyframes } from "styled-components";
|
|
2
|
+
|
|
3
|
+
interface AllAnimsProps {
|
|
4
|
+
degreesLow?: number;
|
|
5
|
+
degreesHi?: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const allAnims = (props: AllAnimsProps) => {
|
|
9
|
+
const { degreesLow = 0, degreesHi = 0 } = props;
|
|
10
|
+
|
|
11
|
+
const X360 = keyframes`
|
|
5
12
|
from {
|
|
6
13
|
-webkit-transform: rotateX(360deg);
|
|
7
14
|
transform: rotateX(360deg);
|
|
@@ -11,8 +18,9 @@ export const allAnims = (props) => {
|
|
|
11
18
|
transform: rotateX(0deg);
|
|
12
19
|
}
|
|
13
20
|
}`;
|
|
14
|
-
|
|
15
|
-
|
|
21
|
+
|
|
22
|
+
//////// Y360
|
|
23
|
+
const Y360 = keyframes`
|
|
16
24
|
from {
|
|
17
25
|
-webkit-transform: rotateY(360deg);
|
|
18
26
|
transform: rotateY(360deg);
|
|
@@ -21,14 +29,16 @@ export const allAnims = (props) => {
|
|
|
21
29
|
-webkit-transform: rotateY(0deg);
|
|
22
30
|
transform: rotateY(0deg);
|
|
23
31
|
}`;
|
|
24
|
-
|
|
32
|
+
|
|
33
|
+
const fadeInkf = keyframes`
|
|
25
34
|
from {
|
|
26
35
|
opacity: 0;
|
|
27
36
|
}
|
|
28
37
|
to {
|
|
29
38
|
opacity: 1;
|
|
30
39
|
}`;
|
|
31
|
-
|
|
40
|
+
|
|
41
|
+
const wobY = keyframes`
|
|
32
42
|
0% {
|
|
33
43
|
-webkit-transform: rotateY(${degreesLow}deg);
|
|
34
44
|
transform: rotateY(${degreesLow}deg);
|
|
@@ -41,7 +51,8 @@ export const allAnims = (props) => {
|
|
|
41
51
|
-webkit-transform: rotateY(${degreesLow}deg);
|
|
42
52
|
transform: rotateY(${degreesLow}deg);
|
|
43
53
|
}`;
|
|
44
|
-
|
|
54
|
+
|
|
55
|
+
const wobX = keyframes`
|
|
45
56
|
0% {
|
|
46
57
|
-webkit-transform: rotateX(${degreesLow}deg);
|
|
47
58
|
transform: rotateX(${degreesLow}deg);
|
|
@@ -54,8 +65,8 @@ export const allAnims = (props) => {
|
|
|
54
65
|
-webkit-transform: rotateX(${degreesLow}deg);
|
|
55
66
|
transform: rotateX(${degreesLow}deg);
|
|
56
67
|
}`;
|
|
57
|
-
|
|
58
|
-
|
|
68
|
+
/* ============================== x-axis 0-180 >180 - 360 */
|
|
69
|
+
const fwdx018 = keyframes`
|
|
59
70
|
from {
|
|
60
71
|
-webkit-transform: rotateX(360deg);
|
|
61
72
|
transform: rotateX(360deg);
|
|
@@ -64,7 +75,7 @@ export const allAnims = (props) => {
|
|
|
64
75
|
-webkit-transform: rotateX(180deg);
|
|
65
76
|
transform: rotateX(180deg);
|
|
66
77
|
}`;
|
|
67
|
-
|
|
78
|
+
const fwdx1836 = keyframes`
|
|
68
79
|
from {
|
|
69
80
|
-webkit-transform: rotateX(180deg);
|
|
70
81
|
transform: rotateX(180deg);
|
|
@@ -73,8 +84,8 @@ export const allAnims = (props) => {
|
|
|
73
84
|
-webkit-transform: rotateX(0deg);
|
|
74
85
|
transform: rotateX(0deg);
|
|
75
86
|
}`;
|
|
76
|
-
|
|
77
|
-
|
|
87
|
+
/* ============================= x-axis 0-90, 90-180, 180-270, 270-360 */
|
|
88
|
+
const fwdx09 = keyframes`
|
|
78
89
|
from {
|
|
79
90
|
-webkit-transform: rotateX(360deg);
|
|
80
91
|
transform: rotateX(360deg);
|
|
@@ -83,7 +94,7 @@ export const allAnims = (props) => {
|
|
|
83
94
|
-webkit-transform: rotateX(90deg);
|
|
84
95
|
transform: rotateX(90deg);
|
|
85
96
|
}`;
|
|
86
|
-
|
|
97
|
+
const fwdx918 = keyframes`
|
|
87
98
|
from {
|
|
88
99
|
-webkit-transform: rotateX(-90deg);
|
|
89
100
|
transform: rotateX(-90deg);
|
|
@@ -92,7 +103,7 @@ export const allAnims = (props) => {
|
|
|
92
103
|
-webkit-transform: rotateX(-180deg);
|
|
93
104
|
transform: rotateX(-180deg);
|
|
94
105
|
}`;
|
|
95
|
-
|
|
106
|
+
const fwdx1827 = keyframes`
|
|
96
107
|
from {
|
|
97
108
|
-webkit-transform: rotateX(-180deg);
|
|
98
109
|
transform: rotateX(-180deg);
|
|
@@ -101,7 +112,7 @@ export const allAnims = (props) => {
|
|
|
101
112
|
-webkit-transform: rotateX(-270deg);
|
|
102
113
|
transform: rotateX(-270deg);
|
|
103
114
|
}`;
|
|
104
|
-
|
|
115
|
+
const fwdx2736 = keyframes`
|
|
105
116
|
from {
|
|
106
117
|
-webkit-transform: rotateX(-270deg);
|
|
107
118
|
transform: rotateX(-270deg);
|
|
@@ -110,8 +121,9 @@ export const allAnims = (props) => {
|
|
|
110
121
|
-webkit-transform: rotateX(-360deg);
|
|
111
122
|
transform: rotateX(-360deg);
|
|
112
123
|
}`;
|
|
113
|
-
|
|
114
|
-
|
|
124
|
+
|
|
125
|
+
/* ============================== y-axis 0-180 >180 - 360 */
|
|
126
|
+
const fwdy018 = keyframes`
|
|
115
127
|
from {
|
|
116
128
|
-webkit-transform: rotateY(360deg);
|
|
117
129
|
transform: rotateY(360deg);
|
|
@@ -120,7 +132,7 @@ export const allAnims = (props) => {
|
|
|
120
132
|
-webkit-transform: rotateY(180deg);
|
|
121
133
|
transform: rotateY(180deg);
|
|
122
134
|
}`;
|
|
123
|
-
|
|
135
|
+
const fwdy1836 = keyframes`
|
|
124
136
|
from {
|
|
125
137
|
-webkit-transform: rotateY(180deg);
|
|
126
138
|
transform: rotateY(180deg);
|
|
@@ -129,8 +141,9 @@ export const allAnims = (props) => {
|
|
|
129
141
|
-webkit-transform: rotateY(0deg);
|
|
130
142
|
transform: rotateY(0deg);
|
|
131
143
|
}`;
|
|
132
|
-
|
|
133
|
-
|
|
144
|
+
|
|
145
|
+
/* ============================= y-axis 0-90, 90-180, 180-270, 270-360 */
|
|
146
|
+
const fwdy09 = keyframes`
|
|
134
147
|
from {
|
|
135
148
|
-webkit-transform: rotateY(360deg);
|
|
136
149
|
transform: rotateY(360deg);
|
|
@@ -139,7 +152,7 @@ export const allAnims = (props) => {
|
|
|
139
152
|
-webkit-transform: rotateY(90deg);
|
|
140
153
|
transform: rotateY(90deg);
|
|
141
154
|
}`;
|
|
142
|
-
|
|
155
|
+
const fwdy918 = keyframes`
|
|
143
156
|
from {
|
|
144
157
|
-webkit-transform: rotateY(-90deg);
|
|
145
158
|
transform: rotateY(-90deg);
|
|
@@ -148,7 +161,7 @@ export const allAnims = (props) => {
|
|
|
148
161
|
-webkit-transform: rotateY(-180deg);
|
|
149
162
|
transform: rotateY(-180deg);
|
|
150
163
|
}`;
|
|
151
|
-
|
|
164
|
+
const fwdy1827 = keyframes`
|
|
152
165
|
from {
|
|
153
166
|
-webkit-transform: rotateY(-180deg);
|
|
154
167
|
transform: rotateY(-180deg);
|
|
@@ -157,7 +170,7 @@ export const allAnims = (props) => {
|
|
|
157
170
|
-webkit-transform: rotateY(-270deg);
|
|
158
171
|
transform: rotateY(-270deg);
|
|
159
172
|
}`;
|
|
160
|
-
|
|
173
|
+
const fwdy2736 = keyframes`
|
|
161
174
|
from {
|
|
162
175
|
-webkit-transform: rotateY(-270deg);
|
|
163
176
|
transform: rotateY(-270deg);
|
|
@@ -166,12 +179,14 @@ export const allAnims = (props) => {
|
|
|
166
179
|
-webkit-transform: rotateY(-360deg);
|
|
167
180
|
transform: rotateY(-360deg);
|
|
168
181
|
}`;
|
|
169
|
-
|
|
170
|
-
|
|
182
|
+
|
|
183
|
+
/* ============================= floating */
|
|
184
|
+
const floatX = keyframes`
|
|
171
185
|
0% { -webkit-transform: translate(0, 0px); -ms-transform: translate(0, 0px); transform: translate(0, 0px); }
|
|
172
186
|
50% { -webkit-transform: translate(0, 15px); -ms-transform: translate(0, 15px); transform: translate(0, 15px); }
|
|
173
187
|
100% { -webkit-transform: translate(0, -0px); -ms-transform: translate(0, -0px); transform: translate(0, -0px); }`;
|
|
174
|
-
|
|
188
|
+
|
|
189
|
+
const floatShadow = keyframes`
|
|
175
190
|
0% {
|
|
176
191
|
-webkit-box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6);
|
|
177
192
|
box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6);
|
|
@@ -193,7 +208,8 @@ export const allAnims = (props) => {
|
|
|
193
208
|
-ms-transform: translateY(0px);
|
|
194
209
|
transform: translateY(0px);
|
|
195
210
|
}`;
|
|
196
|
-
|
|
211
|
+
|
|
212
|
+
const pulseSM = keyframes`
|
|
197
213
|
0% {
|
|
198
214
|
-webkit-transform: scale(0.9);
|
|
199
215
|
-ms-transform: scale(0.9);
|
|
@@ -209,7 +225,8 @@ export const allAnims = (props) => {
|
|
|
209
225
|
-ms-transform: scale(0.9);
|
|
210
226
|
transform: scale(0.9);
|
|
211
227
|
}`;
|
|
212
|
-
|
|
228
|
+
|
|
229
|
+
const pulseMD = keyframes`
|
|
213
230
|
0% {
|
|
214
231
|
-webkit-transform: scale(0.7);
|
|
215
232
|
-ms-transform: scale(0.7);
|
|
@@ -225,7 +242,8 @@ export const allAnims = (props) => {
|
|
|
225
242
|
-ms-transform: scale(0.7);
|
|
226
243
|
transform: scale(0.7);
|
|
227
244
|
}`;
|
|
228
|
-
|
|
245
|
+
|
|
246
|
+
const pulseLG = keyframes`
|
|
229
247
|
0% {
|
|
230
248
|
-webkit-transform: scale(0.5);
|
|
231
249
|
-ms-transform: scale(0.5);
|
|
@@ -241,31 +259,32 @@ export const allAnims = (props) => {
|
|
|
241
259
|
-ms-transform: scale(0.5);
|
|
242
260
|
transform: scale(0.5);
|
|
243
261
|
}`;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
262
|
+
|
|
263
|
+
const noAnim = keyframes``;
|
|
264
|
+
|
|
265
|
+
return {
|
|
266
|
+
X360,
|
|
267
|
+
Y360,
|
|
268
|
+
fadeInkf,
|
|
269
|
+
wobY,
|
|
270
|
+
wobX,
|
|
271
|
+
fwdx018,
|
|
272
|
+
fwdx1836,
|
|
273
|
+
fwdx09,
|
|
274
|
+
fwdx918,
|
|
275
|
+
fwdx1827,
|
|
276
|
+
fwdx2736,
|
|
277
|
+
fwdy018,
|
|
278
|
+
fwdy1836,
|
|
279
|
+
fwdy09,
|
|
280
|
+
fwdy918,
|
|
281
|
+
fwdy1827,
|
|
282
|
+
fwdy2736,
|
|
283
|
+
floatX,
|
|
284
|
+
floatShadow,
|
|
285
|
+
pulseSM,
|
|
286
|
+
pulseMD,
|
|
287
|
+
pulseLG,
|
|
288
|
+
noAnim,
|
|
289
|
+
};
|
|
270
290
|
};
|
|
271
|
-
//# sourceMappingURL=Anims.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
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
ADDED
package/img.png
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,39 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anim-3d-obj",
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
"version": "1.1.22",
|
|
4
|
+
"private": false,
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"@reduxjs/toolkit": "^1.8.5",
|
|
7
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
8
|
+
"@testing-library/react": "^13.3.0",
|
|
9
|
+
"@testing-library/user-event": "^14.4.3",
|
|
10
|
+
"@types/jest": "^28.1.7",
|
|
11
|
+
"@types/node": "^18.7.9",
|
|
12
|
+
"@types/react": "^18.0.17",
|
|
13
|
+
"@types/react-dom": "^18.0.6",
|
|
14
|
+
"react": "^18.2.0",
|
|
15
|
+
"react-dom": "^18.2.0",
|
|
16
|
+
"react-redux": "^8.0.2",
|
|
17
|
+
"react-scripts": "5.0.1",
|
|
18
|
+
"styled-components": "^5.3.5",
|
|
19
|
+
"typescript": "^4.7.4",
|
|
20
|
+
"web-vitals": "^2.1.4"
|
|
6
21
|
},
|
|
7
|
-
"homepage": "https://github.com/mdnelles/anim-3d-objs-launchers",
|
|
8
|
-
"version": "1.1.21",
|
|
9
|
-
"description": "React library for creating 3D objects quickly. Also these objects can be animated",
|
|
10
|
-
"main": "dist/cjs/index.js",
|
|
11
|
-
"module": "dist/esm/index.js",
|
|
12
|
-
"files": [
|
|
13
|
-
"dist"
|
|
14
|
-
],
|
|
15
22
|
"scripts": {
|
|
16
|
-
"
|
|
17
|
-
"build
|
|
18
|
-
"build:
|
|
23
|
+
"start": "react-scripts start",
|
|
24
|
+
"build": "rm -rf dist && NODE_ENV=production babel src/lib --out-dir dist --copy-files",
|
|
25
|
+
"build:ra": "react-scripts build",
|
|
26
|
+
"test": "react-scripts test",
|
|
27
|
+
"eject": "react-scripts eject"
|
|
19
28
|
},
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"@types/react-dom": "^17.0.11",
|
|
26
|
-
"@types/styled-components": "^5.1.25",
|
|
27
|
-
"react": "^18.2.0",
|
|
28
|
-
"react-dom": "^18.2.0",
|
|
29
|
-
"typescript": "^4.5.2"
|
|
29
|
+
"eslintConfig": {
|
|
30
|
+
"extends": [
|
|
31
|
+
"react-app",
|
|
32
|
+
"react-app/jest"
|
|
33
|
+
]
|
|
30
34
|
},
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
35
|
+
"browserslist": {
|
|
36
|
+
"production": [
|
|
37
|
+
">0.2%",
|
|
38
|
+
"not dead",
|
|
39
|
+
"not op_mini all"
|
|
40
|
+
],
|
|
41
|
+
"development": [
|
|
42
|
+
"last 1 chrome version",
|
|
43
|
+
"last 1 firefox version",
|
|
44
|
+
"last 1 safari version"
|
|
45
|
+
]
|
|
34
46
|
},
|
|
35
|
-
"
|
|
36
|
-
"styled-components": "^5.
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/styled-components": "^5.1.26",
|
|
49
|
+
"@babel/cli": "^7.18.10",
|
|
50
|
+
"@babel/core": "^7.18.10",
|
|
51
|
+
"@babel/preset-env": "^7.18.10"
|
|
37
52
|
},
|
|
38
53
|
"keywords": [
|
|
39
54
|
"React",
|
|
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>
|
|
@@ -0,0 +1,15 @@
|
|
|
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/src/App.css
ADDED
package/src/App.test.tsx
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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();
|