anim-3d-obj 1.1.15 → 1.1.19
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/LICENSE +21 -0
- package/README.md +154 -107
- package/dist/cjs/components/Card.d.ts +2 -0
- package/dist/cjs/components/Card.js +20 -0
- package/dist/cjs/components/Card.js.map +1 -0
- package/dist/cjs/components/Cuboid.d.ts +2 -0
- package/dist/cjs/components/Cuboid.js +21 -0
- package/dist/cjs/components/Cuboid.js.map +1 -0
- package/dist/cjs/components/Faces/Face.d.ts +3 -0
- package/dist/cjs/components/Faces/Face.js +86 -0
- package/dist/cjs/components/Faces/Face.js.map +1 -0
- package/dist/cjs/components/Ribbon.d.ts +2 -0
- package/dist/cjs/components/Ribbon.js +20 -0
- package/dist/cjs/components/Ribbon.js.map +1 -0
- package/dist/cjs/components/styles/AnimWrap.d.ts +2 -0
- package/dist/cjs/components/styles/AnimWrap.js +94 -0
- package/dist/cjs/components/styles/AnimWrap.js.map +1 -0
- package/dist/cjs/components/styles/Anims.d.ts +30 -0
- package/dist/cjs/components/styles/Anims.js +275 -0
- package/dist/cjs/components/styles/Anims.js.map +1 -0
- package/dist/cjs/components/styles/Global.d.ts +1 -0
- package/dist/cjs/components/styles/Global.js +14 -0
- package/dist/cjs/components/styles/Global.js.map +1 -0
- package/dist/cjs/components/styles/Scene.d.ts +10 -0
- package/dist/cjs/components/styles/Scene.js +22 -0
- package/dist/cjs/components/styles/Scene.js.map +1 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +17 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/components/Card.d.ts +2 -0
- package/dist/esm/components/Card.js +13 -0
- package/dist/esm/components/Card.js.map +1 -0
- package/dist/esm/components/Cuboid.d.ts +2 -0
- package/dist/esm/components/Cuboid.js +14 -0
- package/dist/esm/components/Cuboid.js.map +1 -0
- package/dist/esm/components/Faces/Face.d.ts +3 -0
- package/dist/esm/components/Faces/Face.js +81 -0
- package/dist/esm/components/Faces/Face.js.map +1 -0
- package/dist/esm/components/Ribbon.d.ts +2 -0
- package/dist/esm/components/Ribbon.js +13 -0
- package/dist/esm/components/Ribbon.js.map +1 -0
- package/dist/esm/components/styles/AnimWrap.d.ts +2 -0
- package/dist/esm/components/styles/AnimWrap.js +87 -0
- package/dist/esm/components/styles/AnimWrap.js.map +1 -0
- package/dist/esm/components/styles/Anims.d.ts +30 -0
- package/{src/components/styles/Anims.ts → dist/esm/components/styles/Anims.js} +81 -100
- package/dist/esm/components/styles/Anims.js.map +1 -0
- package/dist/esm/components/styles/Global.d.ts +1 -0
- package/dist/esm/components/styles/Global.js +8 -0
- package/dist/esm/components/styles/Global.js.map +1 -0
- package/dist/esm/components/styles/Scene.d.ts +10 -0
- package/dist/esm/components/styles/Scene.js +15 -0
- package/dist/esm/components/styles/Scene.js.map +1 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/package.json +32 -62
- package/.eslintignore +0 -2
- package/.eslintrc +0 -32
- package/.prettierrc.json +0 -10
- package/jestconfig.json +0 -8
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/src/components/Card.tsx +0 -55
- package/src/components/Cuboid.tsx +0 -61
- package/src/components/Faces/Face.tsx +0 -72
- package/src/components/Faces/FaceInter.d.ts +0 -39
- package/src/components/Ribbon.tsx +0 -57
- package/src/components/styles/Anim.d.ts +0 -16
- package/src/components/styles/AnimWrap.tsx +0 -92
- package/src/components/styles/Global.ts +0 -7
- package/src/components/styles/Scene.tsx +0 -30
- package/src/index.ts +0 -9
- package/tests/common.test.tsx +0 -29
- package/tsconfig.json +0 -29
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.allAnims = void 0;
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
const allAnims = (props) => {
|
|
6
|
+
const { degreesLow = 0, degreesHi = 0 } = props;
|
|
7
|
+
const X360 = (0, styled_components_1.keyframes) `
|
|
8
|
+
from {
|
|
9
|
+
-webkit-transform: rotateX(360deg);
|
|
10
|
+
transform: rotateX(360deg);
|
|
11
|
+
}
|
|
12
|
+
to {
|
|
13
|
+
-webkit-transform: rotateX(0deg);
|
|
14
|
+
transform: rotateX(0deg);
|
|
15
|
+
}
|
|
16
|
+
}`;
|
|
17
|
+
//////// Y360
|
|
18
|
+
const Y360 = (0, styled_components_1.keyframes) `
|
|
19
|
+
from {
|
|
20
|
+
-webkit-transform: rotateY(360deg);
|
|
21
|
+
transform: rotateY(360deg);
|
|
22
|
+
}
|
|
23
|
+
to {
|
|
24
|
+
-webkit-transform: rotateY(0deg);
|
|
25
|
+
transform: rotateY(0deg);
|
|
26
|
+
}`;
|
|
27
|
+
const fadeInkf = (0, styled_components_1.keyframes) `
|
|
28
|
+
from {
|
|
29
|
+
opacity: 0;
|
|
30
|
+
}
|
|
31
|
+
to {
|
|
32
|
+
opacity: 1;
|
|
33
|
+
}`;
|
|
34
|
+
const wobY = (0, styled_components_1.keyframes) `
|
|
35
|
+
0% {
|
|
36
|
+
-webkit-transform: rotateY(${degreesLow}deg);
|
|
37
|
+
transform: rotateY(${degreesLow}deg);
|
|
38
|
+
}
|
|
39
|
+
50% {
|
|
40
|
+
-webkit-transform: rotateY(${degreesHi}deg);
|
|
41
|
+
transform: rotateY(${degreesHi}deg);
|
|
42
|
+
}
|
|
43
|
+
100% {
|
|
44
|
+
-webkit-transform: rotateY(${degreesLow}deg);
|
|
45
|
+
transform: rotateY(${degreesLow}deg);
|
|
46
|
+
}`;
|
|
47
|
+
const wobX = (0, styled_components_1.keyframes) `
|
|
48
|
+
0% {
|
|
49
|
+
-webkit-transform: rotateX(${degreesLow}deg);
|
|
50
|
+
transform: rotateX(${degreesLow}deg);
|
|
51
|
+
}
|
|
52
|
+
50% {
|
|
53
|
+
-webkit-transform: rotateX(${degreesHi}deg);
|
|
54
|
+
transform: rotateX(${degreesHi}deg);
|
|
55
|
+
}
|
|
56
|
+
100% {
|
|
57
|
+
-webkit-transform: rotateX(${degreesLow}deg);
|
|
58
|
+
transform: rotateX(${degreesLow}deg);
|
|
59
|
+
}`;
|
|
60
|
+
/* ============================== x-axis 0-180 >180 - 360 */
|
|
61
|
+
const fwdx018 = (0, styled_components_1.keyframes) `
|
|
62
|
+
from {
|
|
63
|
+
-webkit-transform: rotateX(360deg);
|
|
64
|
+
transform: rotateX(360deg);
|
|
65
|
+
}
|
|
66
|
+
to {
|
|
67
|
+
-webkit-transform: rotateX(180deg);
|
|
68
|
+
transform: rotateX(180deg);
|
|
69
|
+
}`;
|
|
70
|
+
const fwdx1836 = (0, styled_components_1.keyframes) `
|
|
71
|
+
from {
|
|
72
|
+
-webkit-transform: rotateX(180deg);
|
|
73
|
+
transform: rotateX(180deg);
|
|
74
|
+
}
|
|
75
|
+
to {
|
|
76
|
+
-webkit-transform: rotateX(0deg);
|
|
77
|
+
transform: rotateX(0deg);
|
|
78
|
+
}`;
|
|
79
|
+
/* ============================= x-axis 0-90, 90-180, 180-270, 270-360 */
|
|
80
|
+
const fwdx09 = (0, styled_components_1.keyframes) `
|
|
81
|
+
from {
|
|
82
|
+
-webkit-transform: rotateX(360deg);
|
|
83
|
+
transform: rotateX(360deg);
|
|
84
|
+
}
|
|
85
|
+
to {
|
|
86
|
+
-webkit-transform: rotateX(90deg);
|
|
87
|
+
transform: rotateX(90deg);
|
|
88
|
+
}`;
|
|
89
|
+
const fwdx918 = (0, styled_components_1.keyframes) `
|
|
90
|
+
from {
|
|
91
|
+
-webkit-transform: rotateX(-90deg);
|
|
92
|
+
transform: rotateX(-90deg);
|
|
93
|
+
}
|
|
94
|
+
to {
|
|
95
|
+
-webkit-transform: rotateX(-180deg);
|
|
96
|
+
transform: rotateX(-180deg);
|
|
97
|
+
}`;
|
|
98
|
+
const fwdx1827 = (0, styled_components_1.keyframes) `
|
|
99
|
+
from {
|
|
100
|
+
-webkit-transform: rotateX(-180deg);
|
|
101
|
+
transform: rotateX(-180deg);
|
|
102
|
+
}
|
|
103
|
+
to {
|
|
104
|
+
-webkit-transform: rotateX(-270deg);
|
|
105
|
+
transform: rotateX(-270deg);
|
|
106
|
+
}`;
|
|
107
|
+
const fwdx2736 = (0, styled_components_1.keyframes) `
|
|
108
|
+
from {
|
|
109
|
+
-webkit-transform: rotateX(-270deg);
|
|
110
|
+
transform: rotateX(-270deg);
|
|
111
|
+
}
|
|
112
|
+
to {
|
|
113
|
+
-webkit-transform: rotateX(-360deg);
|
|
114
|
+
transform: rotateX(-360deg);
|
|
115
|
+
}`;
|
|
116
|
+
/* ============================== y-axis 0-180 >180 - 360 */
|
|
117
|
+
const fwdy018 = (0, styled_components_1.keyframes) `
|
|
118
|
+
from {
|
|
119
|
+
-webkit-transform: rotateY(360deg);
|
|
120
|
+
transform: rotateY(360deg);
|
|
121
|
+
}
|
|
122
|
+
to {
|
|
123
|
+
-webkit-transform: rotateY(180deg);
|
|
124
|
+
transform: rotateY(180deg);
|
|
125
|
+
}`;
|
|
126
|
+
const fwdy1836 = (0, styled_components_1.keyframes) `
|
|
127
|
+
from {
|
|
128
|
+
-webkit-transform: rotateY(180deg);
|
|
129
|
+
transform: rotateY(180deg);
|
|
130
|
+
}
|
|
131
|
+
to {
|
|
132
|
+
-webkit-transform: rotateY(0deg);
|
|
133
|
+
transform: rotateY(0deg);
|
|
134
|
+
}`;
|
|
135
|
+
/* ============================= y-axis 0-90, 90-180, 180-270, 270-360 */
|
|
136
|
+
const fwdy09 = (0, styled_components_1.keyframes) `
|
|
137
|
+
from {
|
|
138
|
+
-webkit-transform: rotateY(360deg);
|
|
139
|
+
transform: rotateY(360deg);
|
|
140
|
+
}
|
|
141
|
+
to {
|
|
142
|
+
-webkit-transform: rotateY(90deg);
|
|
143
|
+
transform: rotateY(90deg);
|
|
144
|
+
}`;
|
|
145
|
+
const fwdy918 = (0, styled_components_1.keyframes) `
|
|
146
|
+
from {
|
|
147
|
+
-webkit-transform: rotateY(-90deg);
|
|
148
|
+
transform: rotateY(-90deg);
|
|
149
|
+
}
|
|
150
|
+
to {
|
|
151
|
+
-webkit-transform: rotateY(-180deg);
|
|
152
|
+
transform: rotateY(-180deg);
|
|
153
|
+
}`;
|
|
154
|
+
const fwdy1827 = (0, styled_components_1.keyframes) `
|
|
155
|
+
from {
|
|
156
|
+
-webkit-transform: rotateY(-180deg);
|
|
157
|
+
transform: rotateY(-180deg);
|
|
158
|
+
}
|
|
159
|
+
to {
|
|
160
|
+
-webkit-transform: rotateY(-270deg);
|
|
161
|
+
transform: rotateY(-270deg);
|
|
162
|
+
}`;
|
|
163
|
+
const fwdy2736 = (0, styled_components_1.keyframes) `
|
|
164
|
+
from {
|
|
165
|
+
-webkit-transform: rotateY(-270deg);
|
|
166
|
+
transform: rotateY(-270deg);
|
|
167
|
+
}
|
|
168
|
+
to {
|
|
169
|
+
-webkit-transform: rotateY(-360deg);
|
|
170
|
+
transform: rotateY(-360deg);
|
|
171
|
+
}`;
|
|
172
|
+
/* ============================= floating */
|
|
173
|
+
const floatX = (0, styled_components_1.keyframes) `
|
|
174
|
+
0% { -webkit-transform: translate(0, 0px); -ms-transform: translate(0, 0px); transform: translate(0, 0px); }
|
|
175
|
+
50% { -webkit-transform: translate(0, 15px); -ms-transform: translate(0, 15px); transform: translate(0, 15px); }
|
|
176
|
+
100% { -webkit-transform: translate(0, -0px); -ms-transform: translate(0, -0px); transform: translate(0, -0px); }`;
|
|
177
|
+
const floatShadow = (0, styled_components_1.keyframes) `
|
|
178
|
+
0% {
|
|
179
|
+
-webkit-box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6);
|
|
180
|
+
box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6);
|
|
181
|
+
-webkit-transform: translateY(0px);
|
|
182
|
+
-ms-transform: translateY(0px);
|
|
183
|
+
transform: translateY(0px);
|
|
184
|
+
}
|
|
185
|
+
50% {
|
|
186
|
+
-webkit-box-shadow: 0 25px 15px 0px rgba(0,0,0,0.2);
|
|
187
|
+
box-shadow: 0 25px 15px 0px rgba(0,0,0,0.2);
|
|
188
|
+
-webkit-transform: translateY(-20px);
|
|
189
|
+
-ms-transform: translateY(-20px);
|
|
190
|
+
transform: translateY(-20px);
|
|
191
|
+
}
|
|
192
|
+
100% {
|
|
193
|
+
-webkit-box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6);
|
|
194
|
+
box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6);
|
|
195
|
+
-webkit-transform: translateY(0px);
|
|
196
|
+
-ms-transform: translateY(0px);
|
|
197
|
+
transform: translateY(0px);
|
|
198
|
+
}`;
|
|
199
|
+
const pulseSM = (0, styled_components_1.keyframes) `
|
|
200
|
+
0% {
|
|
201
|
+
-webkit-transform: scale(0.9);
|
|
202
|
+
-ms-transform: scale(0.9);
|
|
203
|
+
transform: scale(0.9);
|
|
204
|
+
}
|
|
205
|
+
70% {
|
|
206
|
+
-webkit-transform: scale(1);
|
|
207
|
+
-ms-transform: scale(1);
|
|
208
|
+
transform: scale(1);
|
|
209
|
+
}
|
|
210
|
+
100% {
|
|
211
|
+
-webkit-transform: scale(0.9);
|
|
212
|
+
-ms-transform: scale(0.9);
|
|
213
|
+
transform: scale(0.9);
|
|
214
|
+
}`;
|
|
215
|
+
const pulseMD = (0, styled_components_1.keyframes) `
|
|
216
|
+
0% {
|
|
217
|
+
-webkit-transform: scale(0.7);
|
|
218
|
+
-ms-transform: scale(0.7);
|
|
219
|
+
transform: scale(0.7);
|
|
220
|
+
}
|
|
221
|
+
70% {
|
|
222
|
+
-webkit-transform: scale(1);
|
|
223
|
+
-ms-transform: scale(1);
|
|
224
|
+
transform: scale(1);
|
|
225
|
+
}
|
|
226
|
+
100% {
|
|
227
|
+
-webkit-transform: scale(0.7);
|
|
228
|
+
-ms-transform: scale(0.7);
|
|
229
|
+
transform: scale(0.7);
|
|
230
|
+
}`;
|
|
231
|
+
const pulseLG = (0, styled_components_1.keyframes) `
|
|
232
|
+
0% {
|
|
233
|
+
-webkit-transform: scale(0.5);
|
|
234
|
+
-ms-transform: scale(0.5);
|
|
235
|
+
transform: scale(0.5);
|
|
236
|
+
}
|
|
237
|
+
70% {
|
|
238
|
+
-webkit-transform: scale(1);
|
|
239
|
+
-ms-transform: scale(1);
|
|
240
|
+
transform: scale(1);
|
|
241
|
+
}
|
|
242
|
+
100% {
|
|
243
|
+
-webkit-transform: scale(0.5);
|
|
244
|
+
-ms-transform: scale(0.5);
|
|
245
|
+
transform: scale(0.5);
|
|
246
|
+
}`;
|
|
247
|
+
const noAnim = (0, styled_components_1.keyframes) ``;
|
|
248
|
+
return {
|
|
249
|
+
X360,
|
|
250
|
+
Y360,
|
|
251
|
+
fadeInkf,
|
|
252
|
+
wobY,
|
|
253
|
+
wobX,
|
|
254
|
+
fwdx018,
|
|
255
|
+
fwdx1836,
|
|
256
|
+
fwdx09,
|
|
257
|
+
fwdx918,
|
|
258
|
+
fwdx1827,
|
|
259
|
+
fwdx2736,
|
|
260
|
+
fwdy018,
|
|
261
|
+
fwdy1836,
|
|
262
|
+
fwdy09,
|
|
263
|
+
fwdy918,
|
|
264
|
+
fwdy1827,
|
|
265
|
+
fwdy2736,
|
|
266
|
+
floatX,
|
|
267
|
+
floatShadow,
|
|
268
|
+
pulseSM,
|
|
269
|
+
pulseMD,
|
|
270
|
+
pulseLG,
|
|
271
|
+
noAnim
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
exports.allAnims = allAnims;
|
|
275
|
+
//# sourceMappingURL=Anims.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Anims.js","sourceRoot":"","sources":["../../../../src/components/styles/Anims.ts"],"names":[],"mappings":";;;AAAA,yDAA8C;AAOvC,MAAM,QAAQ,GAAG,CAAC,KAAoB,EAAE,EAAE;IAC7C,MAAM,EAA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,EAAA;;;;;;;;KAQxB,CAAC;IACF,MAAM,QAAQ,GAAG,IAAA,6BAAS,EAAA;;;;;;;;KAQzB,CAAC;IACF,MAAM,QAAQ,GAAG,IAAA,6BAAS,EAAA;;;;;;;;KAQzB,CAAC;IAEF,4CAA4C;IAC5C,MAAM,MAAM,GAAG,IAAA,6BAAS,EAAA;;;uHAG2F,CAAC;IAEpH,MAAM,WAAW,GAAG,IAAA,6BAAS,EAAA;;;;;;;;;;;;;;;;;;;;;UAqBvB,CAAC;IAEP,MAAM,OAAO,GAAG,IAAA,6BAAS,EAAA;;;;;;;;;;;;;;;MAevB,CAAC;IAEH,MAAM,OAAO,GAAG,IAAA,6BAAS,EAAA;;;;;;;;;;;;;;;OAetB,CAAC;IAEJ,MAAM,OAAO,GAAG,IAAA,6BAAS,EAAA;;;;;;;;;;;;;;;OAetB,CAAC;IAEJ,MAAM,MAAM,GAAG,IAAA,6BAAS,EAAA,EAAE,CAAC;IAE3B,OAAO;QACH,IAAI;QACJ,IAAI;QACJ,QAAQ;QACR,IAAI;QACJ,IAAI;QACJ,OAAO;QACP,QAAQ;QACR,MAAM;QACN,OAAO;QACP,QAAQ;QACR,QAAQ;QACR,OAAO;QACP,QAAQ;QACR,MAAM;QACN,OAAO;QACP,QAAQ;QACR,QAAQ;QACR,MAAM;QACN,WAAW;QACX,OAAO;QACP,OAAO;QACP,OAAO;QACP,MAAM;KACT,CAAC;AACN,CAAC,CAAC;AA1RW,QAAA,QAAQ,YA0RnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ObjWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ObjWrapper = void 0;
|
|
7
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
exports.ObjWrapper = styled_components_1.default.div `
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
position: relative;
|
|
12
|
+
transform-style: preserve-3d;
|
|
13
|
+
`;
|
|
14
|
+
//# sourceMappingURL=Global.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Global.js","sourceRoot":"","sources":["../../../../src/components/styles/Global.ts"],"names":[],"mappings":";;;;;;AAAA,0EAAuC;AAC1B,QAAA,UAAU,GAAG,2BAAM,CAAC,GAAG,CAAA;;;;;CAKnC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface SceneStyleProps {
|
|
2
|
+
width?: number | string;
|
|
3
|
+
height?: number | string;
|
|
4
|
+
perspective?: number | string | undefined;
|
|
5
|
+
perspectiveOrigin?: string | undefined;
|
|
6
|
+
zIndex?: number | undefined;
|
|
7
|
+
children: any;
|
|
8
|
+
}
|
|
9
|
+
export declare const SceneStyle: (props: SceneStyleProps) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SceneStyle = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
const SceneStyle = (props) => {
|
|
10
|
+
const { width = 0, height = 0, perspective = 600, perspectiveOrigin = '50% 50%', zIndex = 10, children = {} } = props;
|
|
11
|
+
const SceneStyleDiv = styled_components_1.default.div `
|
|
12
|
+
width: ${width}px;
|
|
13
|
+
height: ${height}px;
|
|
14
|
+
-webkit-perspective: ${perspective}px;
|
|
15
|
+
perspective: ${perspective}px;
|
|
16
|
+
-webkit-perspective-origin: ${perspectiveOrigin};
|
|
17
|
+
perspective-origin: ${perspectiveOrigin};
|
|
18
|
+
`;
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ style: { zIndex } }, { children: (0, jsx_runtime_1.jsx)(SceneStyleDiv, { children: children }) })));
|
|
20
|
+
};
|
|
21
|
+
exports.SceneStyle = SceneStyle;
|
|
22
|
+
//# sourceMappingURL=Scene.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Scene.js","sourceRoot":"","sources":["../../../../src/components/styles/Scene.tsx"],"names":[],"mappings":";;;;;;;AAAA,0EAAuC;AAYhC,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAE,EAAE;IACjD,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,WAAW,GAAG,GAAG,EAAE,iBAAiB,GAAG,SAAS,EAAE,MAAM,GAAG,EAAE,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,KAAK,CAAC;IAEtH,MAAM,aAAa,GAAQ,2BAAM,CAAC,GAAG,CAAA;iBACxB,KAAK;kBACJ,MAAM;+BACO,WAAW;uBACnB,WAAW;sCACI,iBAAiB;8BACzB,iBAAiB;KAC1C,CAAC;IAEF,OAAO,CACH,8CAAK,KAAK,EAAE,EAAE,MAAM,EAAE,gBAClB,uBAAC,aAAa,cAAE,QAAQ,GAAiB,IACvC,CACT,CAAC;AACN,CAAC,CAAC;AAjBW,QAAA,UAAU,cAiBrB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//import MyCounter from './components/App'
|
|
3
|
+
//export { MyCounter }
|
|
4
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
+
};
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.Card = exports.Ribbon = exports.Cuboid = exports.Face = void 0;
|
|
9
|
+
const Face_1 = __importDefault(require("./components/Faces/Face"));
|
|
10
|
+
exports.Face = Face_1.default;
|
|
11
|
+
const Cuboid_1 = require("./components/Cuboid");
|
|
12
|
+
Object.defineProperty(exports, "Cuboid", { enumerable: true, get: function () { return Cuboid_1.Cuboid; } });
|
|
13
|
+
const Ribbon_1 = require("./components/Ribbon");
|
|
14
|
+
Object.defineProperty(exports, "Ribbon", { enumerable: true, get: function () { return Ribbon_1.Ribbon; } });
|
|
15
|
+
const Card_1 = require("./components/Card");
|
|
16
|
+
Object.defineProperty(exports, "Card", { enumerable: true, get: function () { return Card_1.Card; } });
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C,sBAAsB;;;;;;AAEtB,mEAA2C;AAKlC,eALF,cAAI,CAKE;AAJb,gDAA6C;AAI9B,uFAJN,eAAM,OAIM;AAHrB,gDAA6C;AAGtB,uFAHd,eAAM,OAGc;AAF7B,4CAAyC;AAEV,qFAFtB,WAAI,OAEsB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AnimWrap } from './styles/AnimWrap';
|
|
3
|
+
import { SceneStyle } from './styles/Scene';
|
|
4
|
+
import Face from './Faces/Face';
|
|
5
|
+
import { ObjWrapper } from './styles/Global';
|
|
6
|
+
export const Card = (props) => {
|
|
7
|
+
const { anim1Specs, anim2Specs, width = 5, height = 5, faces, global = {}, custom = {}, tranz = (+height / 2) | 0, perspective, perspectiveOrigin, zIndex } = props;
|
|
8
|
+
const buildFace = (faceType) => {
|
|
9
|
+
return _jsx(Face, { width: width, height: height, depth: 0.1, faceType: faceType, id: faceType, tranz: tranz, global: global, custom: custom });
|
|
10
|
+
};
|
|
11
|
+
return (_jsx(SceneStyle, Object.assign({ width: width, height: height, perspective: perspective, perspectiveOrigin: perspectiveOrigin, zIndex: zIndex }, { children: _jsx(AnimWrap, Object.assign({ animSpecs: anim1Specs }, { children: _jsx(AnimWrap, Object.assign({ animSpecs: anim2Specs }, { children: _jsxs(ObjWrapper, { children: [faces && faces.front ? buildFace('front') : null, faces && faces.back ? buildFace('back') : null] }) })) })) })));
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=Card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Card.js","sourceRoot":"","sources":["../../../src/components/Card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,KAAe,EAAO,EAAE;IACzC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAEpK,MAAM,SAAS,GAAG,CAAC,QAAa,EAAO,EAAE;QACrC,OAAO,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI,CAAC;IAC9I,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,UAAU,kBAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,gBACpH,KAAC,QAAQ,kBAAC,SAAS,EAAE,UAAU,gBAC3B,KAAC,QAAQ,kBAAC,SAAS,EAAE,UAAU,gBAC3B,MAAC,UAAU,eACN,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAChD,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,IACtC,IACN,IACJ,IACF,CAChB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
//import React from 'react'
|
|
3
|
+
import { AnimWrap } from './styles/AnimWrap';
|
|
4
|
+
import { SceneStyle } from './styles/Scene';
|
|
5
|
+
import Face from './Faces/Face';
|
|
6
|
+
import { ObjWrapper } from './styles/Global';
|
|
7
|
+
export const Cuboid = (props) => {
|
|
8
|
+
const { anim1Specs, anim2Specs, width = 5, height = 5, depth = 5, faces, global = {}, custom = {}, tranz = (+height / 2) | 0, perspective, perspectiveOrigin, zIndex } = props;
|
|
9
|
+
const buildFace = (faceType) => {
|
|
10
|
+
return _jsx(Face, { width: width, height: height, depth: depth, faceType: faceType, id: faceType, tranz: tranz, global: global, custom: custom });
|
|
11
|
+
};
|
|
12
|
+
return (_jsx(SceneStyle, Object.assign({ width: width, height: height, perspective: perspective, perspectiveOrigin: perspectiveOrigin, zIndex: zIndex }, { children: _jsx(AnimWrap, Object.assign({ animSpecs: anim1Specs }, { children: _jsx(AnimWrap, Object.assign({ animSpecs: anim2Specs }, { children: _jsxs(ObjWrapper, { children: [faces && faces.front ? buildFace('front') : null, faces && faces.right ? buildFace('right') : null, faces && faces.back ? buildFace('back') : null, faces && faces.left ? buildFace('left') : null, faces && faces.top ? buildFace('top') : null, faces && faces.bottom ? buildFace('bottom') : null] }) })) })) })));
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=Cuboid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cuboid.js","sourceRoot":"","sources":["../../../src/components/Cuboid.tsx"],"names":[],"mappings":";AAAA,2BAA2B;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAe,EAAO,EAAE;IAC3C,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAE/K,MAAM,SAAS,GAAG,CAAC,QAAa,EAAO,EAAE;QACrC,OAAO,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI,CAAC;IAChJ,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,UAAU,kBAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,gBACpH,KAAC,QAAQ,kBAAC,SAAS,EAAE,UAAU,gBAC3B,KAAC,QAAQ,kBAAC,SAAS,EAAE,UAAU,gBAC3B,MAAC,UAAU,eACN,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAChD,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,EAChD,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAC9C,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAC9C,KAAK,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAC5C,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,IAC1C,IACN,IACJ,IACF,CAChB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
//import React from 'react'
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
const Face = (props) => {
|
|
5
|
+
let { height = 10, tranz = 80, width = 100 } = props;
|
|
6
|
+
const { depth = 10, faceType, global = {}, custom = false } = props;
|
|
7
|
+
let transform;
|
|
8
|
+
const styles = custom[faceType] && custom[faceType].css ? custom[faceType].css : global.css;
|
|
9
|
+
const body = custom[faceType] && custom[faceType].body ? custom[faceType].body : global.body;
|
|
10
|
+
if (faceType === 'bottom') {
|
|
11
|
+
tranz = +height - +depth / 2;
|
|
12
|
+
height = +depth;
|
|
13
|
+
transform = `transform: rotateX(-90deg) translateZ(${tranz}px);`;
|
|
14
|
+
//styles = custom["top"] ? custom : global;
|
|
15
|
+
}
|
|
16
|
+
else if (faceType === 'top') {
|
|
17
|
+
height = +depth;
|
|
18
|
+
if (depth)
|
|
19
|
+
tranz = +depth / 2;
|
|
20
|
+
transform = `transform: rotateX(90deg) translateZ(${tranz}px);`;
|
|
21
|
+
}
|
|
22
|
+
else if (faceType === 'front') {
|
|
23
|
+
if (depth)
|
|
24
|
+
tranz = +depth / 2;
|
|
25
|
+
transform = `transform: rotateY(0deg) translateZ(${tranz}px);`;
|
|
26
|
+
}
|
|
27
|
+
else if (faceType === 'back') {
|
|
28
|
+
if (depth)
|
|
29
|
+
tranz = +depth / 2;
|
|
30
|
+
transform = `transform: rotateY(180deg) translateZ(${tranz}px);`;
|
|
31
|
+
}
|
|
32
|
+
else if (faceType === 'right') {
|
|
33
|
+
if (height > width && !depth) {
|
|
34
|
+
tranz = -(+height / 2 - +width);
|
|
35
|
+
width = +height;
|
|
36
|
+
}
|
|
37
|
+
else if (width > height && !depth) {
|
|
38
|
+
tranz = +height / 2;
|
|
39
|
+
height = +width;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
tranz = +width - +depth / 2;
|
|
43
|
+
width = +depth;
|
|
44
|
+
}
|
|
45
|
+
transform = `transform: rotateY(90deg) translateZ(${tranz}px);`;
|
|
46
|
+
// topr is to of Ribbon which points back
|
|
47
|
+
}
|
|
48
|
+
else if (faceType === 'topr') {
|
|
49
|
+
height = +depth;
|
|
50
|
+
if (depth)
|
|
51
|
+
tranz = +depth / 2;
|
|
52
|
+
//let offset = depth / 2;
|
|
53
|
+
transform = `transform: rotateX(90deg) translateZ(${tranz}px ); `;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
if (height > width && !depth) {
|
|
57
|
+
tranz = -(+height / 2 - +width);
|
|
58
|
+
width = +height;
|
|
59
|
+
}
|
|
60
|
+
else if (width > height && !depth) {
|
|
61
|
+
tranz = +height / 2;
|
|
62
|
+
height = +width;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
tranz = +depth / 2;
|
|
66
|
+
width = +depth;
|
|
67
|
+
}
|
|
68
|
+
transform = `transform: rotateY(-90deg) translateZ(${tranz}px);`;
|
|
69
|
+
}
|
|
70
|
+
//const BackFlip: any = styled.section``;
|
|
71
|
+
const Specs = styled.section `
|
|
72
|
+
${styles}
|
|
73
|
+
width: ${width}px;
|
|
74
|
+
position: absolute;
|
|
75
|
+
height: ${height}px;
|
|
76
|
+
${transform};
|
|
77
|
+
`;
|
|
78
|
+
return _jsx(Specs, { children: body });
|
|
79
|
+
};
|
|
80
|
+
export default Face;
|
|
81
|
+
//# sourceMappingURL=Face.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Face.js","sourceRoot":"","sources":["../../../../src/components/Faces/Face.tsx"],"names":[],"mappings":";AAAA,2BAA2B;AAC3B,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,MAAM,IAAI,GAAG,CAAC,KAAgB,EAAe,EAAE;IAC3C,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE,EAAE,KAAK,GAAG,GAAG,EAAE,GAAG,KAAK,CAAC;IAErD,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IAEpE,IAAI,SAAS,CAAC;IACd,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IAC5F,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
|
3
|
+
import { SceneStyle } from './styles/Scene';
|
|
4
|
+
import Face from './Faces/Face';
|
|
5
|
+
import { ObjWrapper } from './styles/Global';
|
|
6
|
+
export const Ribbon = (props) => {
|
|
7
|
+
const { anim1Specs, anim2Specs, width = 5, height = 5, depth = 5, faces, global = {}, custom = {}, tranz = (+height / 2) | 0, perspective, perspectiveOrigin, zIndex } = props;
|
|
8
|
+
const buildFace = (faceType) => {
|
|
9
|
+
return _jsx(Face, { width: width, height: height, depth: depth, faceType: faceType, id: faceType, tranz: tranz, global: global, custom: custom });
|
|
10
|
+
};
|
|
11
|
+
return (_jsx(SceneStyle, Object.assign({ width: width, height: height, perspective: perspective, perspectiveOrigin: perspectiveOrigin, zIndex: zIndex }, { children: _jsx(AnimWrap, Object.assign({ animSpecs: anim1Specs }, { children: _jsx(AnimWrap, Object.assign({ animSpecs: anim2Specs }, { children: _jsxs(ObjWrapper, { children: [faces && faces.bottom ? buildFace('bottom') : null, faces && faces.back ? buildFace('back') : null, faces && faces.top ? buildFace('topr') : null] }) })) })) })));
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=Ribbon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ribbon.js","sourceRoot":"","sources":["../../../src/components/Ribbon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAe,EAAO,EAAE;IAC3C,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,KAAK,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAE/K,MAAM,SAAS,GAAG,CAAC,QAAa,EAAO,EAAE;QACrC,OAAO,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAI,CAAC;IAChJ,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,UAAU,kBAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,gBACpH,KAAC,QAAQ,kBAAC,SAAS,EAAE,UAAU,gBAC3B,KAAC,QAAQ,kBAAC,SAAS,EAAE,UAAU,gBAC3B,MAAC,UAAU,eACN,KAAK,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAClD,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAC9C,KAAK,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,IACrC,IACN,IACJ,IACF,CAChB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { allAnims } from './Anims';
|
|
4
|
+
export const AnimWrap = (props) => {
|
|
5
|
+
const { children, animSpecs } = props;
|
|
6
|
+
const AS = animSpecs;
|
|
7
|
+
const { X360, Y360, fadeInkf, wobY, wobX, fwdx018, fwdx1836, fwdx09, fwdx918, fwdx1827, fwdx2736, fwdy018, fwdy1836, fwdy09, fwdy918, fwdy1827, fwdy2736, floatX, floatShadow, pulseSM, pulseMD, pulseLG, noAnim } = allAnims({
|
|
8
|
+
degreesHi: AS && AS.degreesHi ? AS.degreesHi : 0,
|
|
9
|
+
degreesLow: AS && AS.degreesLow ? AS.degreesLow : 0
|
|
10
|
+
});
|
|
11
|
+
let theAnim = 'noAnim';
|
|
12
|
+
// need to iterate through all animation posibilities and not use eval() to satisfy TS
|
|
13
|
+
if (AS && AS.name) {
|
|
14
|
+
if (AS.name === 'X360')
|
|
15
|
+
theAnim = X360;
|
|
16
|
+
else if (AS.name === 'Y360')
|
|
17
|
+
theAnim = Y360;
|
|
18
|
+
else if (AS.name === 'fadeInkf')
|
|
19
|
+
theAnim = fadeInkf;
|
|
20
|
+
else if (AS.name === 'wobX')
|
|
21
|
+
theAnim = wobX;
|
|
22
|
+
else if (AS.name === 'wobY')
|
|
23
|
+
theAnim = wobY;
|
|
24
|
+
else if (AS.name === 'fwdx018')
|
|
25
|
+
theAnim = fwdx018;
|
|
26
|
+
else if (AS.name === 'fwdx1836')
|
|
27
|
+
theAnim = fwdx1836;
|
|
28
|
+
else if (AS.name === 'fwdx09')
|
|
29
|
+
theAnim = fwdx09;
|
|
30
|
+
else if (AS.name === 'fwdx918')
|
|
31
|
+
theAnim = fwdx918;
|
|
32
|
+
else if (AS.name === 'fwdx1827')
|
|
33
|
+
theAnim = fwdx1827;
|
|
34
|
+
else if (AS.name === 'fwdx2736')
|
|
35
|
+
theAnim = fwdx2736;
|
|
36
|
+
else if (AS.name === 'fwdy018')
|
|
37
|
+
theAnim = fwdy018;
|
|
38
|
+
else if (AS.name === 'fwdy1836')
|
|
39
|
+
theAnim = fwdy1836;
|
|
40
|
+
else if (AS.name === 'fwdy09')
|
|
41
|
+
theAnim = fwdy09;
|
|
42
|
+
else if (AS.name === 'fwdy918')
|
|
43
|
+
theAnim = fwdy918;
|
|
44
|
+
else if (AS.name === 'fwdy1827')
|
|
45
|
+
theAnim = fwdy1827;
|
|
46
|
+
else if (AS.name === 'fwdy2736')
|
|
47
|
+
theAnim = fwdy2736;
|
|
48
|
+
else if (AS.name === 'floatX')
|
|
49
|
+
theAnim = floatX;
|
|
50
|
+
else if (AS.name === 'floatShadow')
|
|
51
|
+
theAnim = floatShadow;
|
|
52
|
+
else if (AS.name === 'pulseSM')
|
|
53
|
+
theAnim = pulseSM;
|
|
54
|
+
else if (AS.name === 'pulseMD')
|
|
55
|
+
theAnim = pulseMD;
|
|
56
|
+
else if (AS.name === 'pulseLG')
|
|
57
|
+
theAnim = pulseLG;
|
|
58
|
+
}
|
|
59
|
+
else
|
|
60
|
+
theAnim = noAnim;
|
|
61
|
+
let AnimWrapDiv = styled.div ``;
|
|
62
|
+
if (AS) {
|
|
63
|
+
AnimWrapDiv = styled.div `
|
|
64
|
+
width: 100%;
|
|
65
|
+
height: 100%;
|
|
66
|
+
position: relative;
|
|
67
|
+
transform-style: preserve-3d;
|
|
68
|
+
border: ${AS.border || ''};
|
|
69
|
+
-webkit-animation-duration: ${AS.duration || 1}s;
|
|
70
|
+
animation-duration: ${AS.duration || 1}s;
|
|
71
|
+
-webkit-animation-iteration-count: ${AS.iterationCount || 1};
|
|
72
|
+
animation-iteration-count: ${AS.iterationCount || 1};
|
|
73
|
+
-webkit-animation-name: ${theAnim || 'noAnim'};
|
|
74
|
+
animation-name: ${theAnim || 'noAnim'};
|
|
75
|
+
-webkit-animation-fill-mode: ${AS.fillMode || 'forwards'};
|
|
76
|
+
animation-fill-mode: ${AS.fillMode || 'forwards'};
|
|
77
|
+
animation-direction: ${AS.direction || 'normal'};
|
|
78
|
+
-webkit-animation-direction: ${AS.direction || 'normal'};
|
|
79
|
+
-webkit-animation-timing-function: ${AS.timing || 'linear'};
|
|
80
|
+
animation-timing-function: ${AS.timing || 'linear'};
|
|
81
|
+
-webkit-animation-delay: ${AS.delay || 0}s;
|
|
82
|
+
animation-delay: ${AS.delay || 0}s;
|
|
83
|
+
`;
|
|
84
|
+
}
|
|
85
|
+
return _jsx(AnimWrapDiv, { children: children });
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=AnimWrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnimWrap.js","sourceRoot":"","sources":["../../../../src/components/styles/AnimWrap.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAsB,EAAE,EAAE;IAC/C,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IACtC,MAAM,EAAE,GAAQ,SAAS,CAAC;IAE1B,MAAM,EACF,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,WAAW,EACX,OAAO,EACP,OAAO,EACP,OAAO,EACP,MAAM,EACT,GAAG,QAAQ,CAAC;QACT,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAChD,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;KACtD,CAAC,CAAC;IAEH,IAAI,OAAO,GAAQ,QAAQ,CAAC;IAC5B,sFAAsF;IACtF,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE;QACf,IA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