anim-3d-obj 1.1.16 → 1.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -75
- package/dist/cjs/components/Card.d.ts +2 -0
- package/dist/cjs/components/Cuboid.d.ts +2 -0
- package/dist/cjs/components/Faces/Face.d.ts +4 -0
- package/dist/cjs/components/Ribbon.d.ts +2 -0
- package/dist/cjs/components/styles/AnimWrap.d.ts +3 -0
- package/dist/cjs/components/styles/Anims.d.ts +30 -0
- package/dist/cjs/components/styles/Global.d.ts +1 -0
- package/dist/cjs/components/styles/Scene.d.ts +11 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/cjs/index.js +4374 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/esm/components/Card.d.ts +2 -0
- package/dist/esm/components/Cuboid.d.ts +2 -0
- package/dist/esm/components/Faces/Face.d.ts +4 -0
- package/dist/esm/components/Ribbon.d.ts +2 -0
- package/dist/esm/components/styles/AnimWrap.d.ts +3 -0
- package/dist/esm/components/styles/Anims.d.ts +30 -0
- package/dist/esm/components/styles/Global.d.ts +1 -0
- package/dist/esm/components/styles/Scene.d.ts +11 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +4367 -0
- package/dist/esm/index.js.map +1 -0
- package/package.json +54 -32
- package/.eslintignore +0 -2
- package/.eslintrc +0 -32
- package/.prettierrc.json +0 -10
- package/babel.config.json +0 -18
- package/dist/components/Card.tsx +0 -55
- package/dist/components/Cuboid.tsx +0 -61
- package/dist/components/Faces/Face.tsx +0 -72
- package/dist/components/Faces/FaceInter.d.ts +0 -39
- package/dist/components/Ribbon.tsx +0 -57
- package/dist/components/styles/Anim.d.ts +0 -16
- package/dist/components/styles/AnimWrap.tsx +0 -92
- package/dist/components/styles/Anims.ts +0 -290
- package/dist/components/styles/Global.ts +0 -7
- package/dist/components/styles/Scene.tsx +0 -30
- package/dist/index.ts +0 -9
- 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/Anims.ts +0 -290
- 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
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { AnimWrap } from './styles/AnimWrap'
|
|
2
|
-
import { SceneStyle } from './styles/Scene'
|
|
3
|
-
import { ObjProps } from './Faces/FaceInter'
|
|
4
|
-
import Face from './Faces/Face'
|
|
5
|
-
import { ObjWrapper } from './styles/Global'
|
|
6
|
-
|
|
7
|
-
export const Ribbon = (props: ObjProps): any => {
|
|
8
|
-
const {
|
|
9
|
-
anim1Specs,
|
|
10
|
-
anim2Specs,
|
|
11
|
-
width = 5,
|
|
12
|
-
height = 5,
|
|
13
|
-
depth = 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={depth}
|
|
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.bottom ? buildFace('bottom') : null}
|
|
50
|
-
{faces && faces.back ? buildFace('back') : null}
|
|
51
|
-
{faces && faces.top ? buildFace('topr') : null}
|
|
52
|
-
</ObjWrapper>
|
|
53
|
-
</AnimWrap>
|
|
54
|
-
</AnimWrap>
|
|
55
|
-
</SceneStyle>
|
|
56
|
-
)
|
|
57
|
-
}
|
|
@@ -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,92 +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({
|
|
35
|
-
degreesHi: AS && AS.degreesHi ? AS.degreesHi : 0,
|
|
36
|
-
degreesLow: AS && AS.degreesLow ? AS.degreesLow : 0,
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
let theAnim: any = 'noAnim'
|
|
40
|
-
// need to iterate through all animation posibilities and not use eval() to satisfy TS
|
|
41
|
-
if (AS && AS.name) {
|
|
42
|
-
if (AS.name === 'X360') theAnim = X360
|
|
43
|
-
else if (AS.name === 'Y360') theAnim = Y360
|
|
44
|
-
else if (AS.name === 'fadeInkf') theAnim = fadeInkf
|
|
45
|
-
else if (AS.name === 'wobX') theAnim = wobX
|
|
46
|
-
else if (AS.name === 'wobY') theAnim = wobY
|
|
47
|
-
else if (AS.name === 'fwdx018') theAnim = fwdx018
|
|
48
|
-
else if (AS.name === 'fwdx1836') theAnim = fwdx1836
|
|
49
|
-
else if (AS.name === 'fwdx09') theAnim = fwdx09
|
|
50
|
-
else if (AS.name === 'fwdx918') theAnim = fwdx918
|
|
51
|
-
else if (AS.name === 'fwdx1827') theAnim = fwdx1827
|
|
52
|
-
else if (AS.name === 'fwdx2736') theAnim = fwdx2736
|
|
53
|
-
else if (AS.name === 'fwdy018') theAnim = fwdy018
|
|
54
|
-
else if (AS.name === 'fwdy1836') theAnim = fwdy1836
|
|
55
|
-
else if (AS.name === 'fwdy09') theAnim = fwdy09
|
|
56
|
-
else if (AS.name === 'fwdy918') theAnim = fwdy918
|
|
57
|
-
else if (AS.name === 'fwdy1827') theAnim = fwdy1827
|
|
58
|
-
else if (AS.name === 'fwdy2736') theAnim = fwdy2736
|
|
59
|
-
else if (AS.name === 'floatX') theAnim = floatX
|
|
60
|
-
else if (AS.name === 'floatShadow') theAnim = floatShadow
|
|
61
|
-
else if (AS.name === 'pulseSM') theAnim = pulseSM
|
|
62
|
-
else if (AS.name === 'pulseMD') theAnim = pulseMD
|
|
63
|
-
else if (AS.name === 'pulseLG') theAnim = pulseLG
|
|
64
|
-
} else theAnim = noAnim
|
|
65
|
-
|
|
66
|
-
let AnimWrapDiv: any = styled.div``
|
|
67
|
-
if (AS) {
|
|
68
|
-
AnimWrapDiv = styled.div`
|
|
69
|
-
width: 100%;
|
|
70
|
-
height: 100%;
|
|
71
|
-
position: relative;
|
|
72
|
-
transform-style: preserve-3d;
|
|
73
|
-
border: ${AS.border || ''};
|
|
74
|
-
-webkit-animation-duration: ${AS.duration || 1}s;
|
|
75
|
-
animation-duration: ${AS.duration || 1}s;
|
|
76
|
-
-webkit-animation-iteration-count: ${AS.iterationCount || 1};
|
|
77
|
-
animation-iteration-count: ${AS.iterationCount || 1};
|
|
78
|
-
-webkit-animation-name: ${theAnim || 'noAnim'};
|
|
79
|
-
animation-name: ${theAnim || 'noAnim'};
|
|
80
|
-
-webkit-animation-fill-mode: ${AS.fillMode || 'forwards'};
|
|
81
|
-
animation-fill-mode: ${AS.fillMode || 'forwards'};
|
|
82
|
-
animation-direction: ${AS.direction || 'normal'};
|
|
83
|
-
-webkit-animation-direction: ${AS.direction || 'normal'};
|
|
84
|
-
-webkit-animation-timing-function: ${AS.timing || 'linear'};
|
|
85
|
-
animation-timing-function: ${AS.timing || 'linear'};
|
|
86
|
-
-webkit-animation-delay: ${AS.delay || 0}s;
|
|
87
|
-
animation-delay: ${AS.delay || 0}s;
|
|
88
|
-
`
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return <AnimWrapDiv>{children}</AnimWrapDiv>
|
|
92
|
-
}
|
|
@@ -1,290 +0,0 @@
|
|
|
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`
|
|
12
|
-
from {
|
|
13
|
-
-webkit-transform: rotateX(360deg);
|
|
14
|
-
transform: rotateX(360deg);
|
|
15
|
-
}
|
|
16
|
-
to {
|
|
17
|
-
-webkit-transform: rotateX(0deg);
|
|
18
|
-
transform: rotateX(0deg);
|
|
19
|
-
}
|
|
20
|
-
}`
|
|
21
|
-
|
|
22
|
-
//////// Y360
|
|
23
|
-
const Y360 = keyframes`
|
|
24
|
-
from {
|
|
25
|
-
-webkit-transform: rotateY(360deg);
|
|
26
|
-
transform: rotateY(360deg);
|
|
27
|
-
}
|
|
28
|
-
to {
|
|
29
|
-
-webkit-transform: rotateY(0deg);
|
|
30
|
-
transform: rotateY(0deg);
|
|
31
|
-
}`
|
|
32
|
-
|
|
33
|
-
const fadeInkf = keyframes`
|
|
34
|
-
from {
|
|
35
|
-
opacity: 0;
|
|
36
|
-
}
|
|
37
|
-
to {
|
|
38
|
-
opacity: 1;
|
|
39
|
-
}`
|
|
40
|
-
|
|
41
|
-
const wobY = keyframes`
|
|
42
|
-
0% {
|
|
43
|
-
-webkit-transform: rotateY(${degreesLow}deg);
|
|
44
|
-
transform: rotateY(${degreesLow}deg);
|
|
45
|
-
}
|
|
46
|
-
50% {
|
|
47
|
-
-webkit-transform: rotateY(${degreesHi}deg);
|
|
48
|
-
transform: rotateY(${degreesHi}deg);
|
|
49
|
-
}
|
|
50
|
-
100% {
|
|
51
|
-
-webkit-transform: rotateY(${degreesLow}deg);
|
|
52
|
-
transform: rotateY(${degreesLow}deg);
|
|
53
|
-
}`
|
|
54
|
-
|
|
55
|
-
const wobX = keyframes`
|
|
56
|
-
0% {
|
|
57
|
-
-webkit-transform: rotateX(${degreesLow}deg);
|
|
58
|
-
transform: rotateX(${degreesLow}deg);
|
|
59
|
-
}
|
|
60
|
-
50% {
|
|
61
|
-
-webkit-transform: rotateX(${degreesHi}deg);
|
|
62
|
-
transform: rotateX(${degreesHi}deg);
|
|
63
|
-
}
|
|
64
|
-
100% {
|
|
65
|
-
-webkit-transform: rotateX(${degreesLow}deg);
|
|
66
|
-
transform: rotateX(${degreesLow}deg);
|
|
67
|
-
}`
|
|
68
|
-
/* ============================== x-axis 0-180 >180 - 360 */
|
|
69
|
-
const fwdx018 = keyframes`
|
|
70
|
-
from {
|
|
71
|
-
-webkit-transform: rotateX(360deg);
|
|
72
|
-
transform: rotateX(360deg);
|
|
73
|
-
}
|
|
74
|
-
to {
|
|
75
|
-
-webkit-transform: rotateX(180deg);
|
|
76
|
-
transform: rotateX(180deg);
|
|
77
|
-
}`
|
|
78
|
-
const fwdx1836 = keyframes`
|
|
79
|
-
from {
|
|
80
|
-
-webkit-transform: rotateX(180deg);
|
|
81
|
-
transform: rotateX(180deg);
|
|
82
|
-
}
|
|
83
|
-
to {
|
|
84
|
-
-webkit-transform: rotateX(0deg);
|
|
85
|
-
transform: rotateX(0deg);
|
|
86
|
-
}`
|
|
87
|
-
/* ============================= x-axis 0-90, 90-180, 180-270, 270-360 */
|
|
88
|
-
const fwdx09 = keyframes`
|
|
89
|
-
from {
|
|
90
|
-
-webkit-transform: rotateX(360deg);
|
|
91
|
-
transform: rotateX(360deg);
|
|
92
|
-
}
|
|
93
|
-
to {
|
|
94
|
-
-webkit-transform: rotateX(90deg);
|
|
95
|
-
transform: rotateX(90deg);
|
|
96
|
-
}`
|
|
97
|
-
const fwdx918 = keyframes`
|
|
98
|
-
from {
|
|
99
|
-
-webkit-transform: rotateX(-90deg);
|
|
100
|
-
transform: rotateX(-90deg);
|
|
101
|
-
}
|
|
102
|
-
to {
|
|
103
|
-
-webkit-transform: rotateX(-180deg);
|
|
104
|
-
transform: rotateX(-180deg);
|
|
105
|
-
}`
|
|
106
|
-
const fwdx1827 = keyframes`
|
|
107
|
-
from {
|
|
108
|
-
-webkit-transform: rotateX(-180deg);
|
|
109
|
-
transform: rotateX(-180deg);
|
|
110
|
-
}
|
|
111
|
-
to {
|
|
112
|
-
-webkit-transform: rotateX(-270deg);
|
|
113
|
-
transform: rotateX(-270deg);
|
|
114
|
-
}`
|
|
115
|
-
const fwdx2736 = keyframes`
|
|
116
|
-
from {
|
|
117
|
-
-webkit-transform: rotateX(-270deg);
|
|
118
|
-
transform: rotateX(-270deg);
|
|
119
|
-
}
|
|
120
|
-
to {
|
|
121
|
-
-webkit-transform: rotateX(-360deg);
|
|
122
|
-
transform: rotateX(-360deg);
|
|
123
|
-
}`
|
|
124
|
-
|
|
125
|
-
/* ============================== y-axis 0-180 >180 - 360 */
|
|
126
|
-
const fwdy018 = keyframes`
|
|
127
|
-
from {
|
|
128
|
-
-webkit-transform: rotateY(360deg);
|
|
129
|
-
transform: rotateY(360deg);
|
|
130
|
-
}
|
|
131
|
-
to {
|
|
132
|
-
-webkit-transform: rotateY(180deg);
|
|
133
|
-
transform: rotateY(180deg);
|
|
134
|
-
}`
|
|
135
|
-
const fwdy1836 = keyframes`
|
|
136
|
-
from {
|
|
137
|
-
-webkit-transform: rotateY(180deg);
|
|
138
|
-
transform: rotateY(180deg);
|
|
139
|
-
}
|
|
140
|
-
to {
|
|
141
|
-
-webkit-transform: rotateY(0deg);
|
|
142
|
-
transform: rotateY(0deg);
|
|
143
|
-
}`
|
|
144
|
-
|
|
145
|
-
/* ============================= y-axis 0-90, 90-180, 180-270, 270-360 */
|
|
146
|
-
const fwdy09 = keyframes`
|
|
147
|
-
from {
|
|
148
|
-
-webkit-transform: rotateY(360deg);
|
|
149
|
-
transform: rotateY(360deg);
|
|
150
|
-
}
|
|
151
|
-
to {
|
|
152
|
-
-webkit-transform: rotateY(90deg);
|
|
153
|
-
transform: rotateY(90deg);
|
|
154
|
-
}`
|
|
155
|
-
const fwdy918 = keyframes`
|
|
156
|
-
from {
|
|
157
|
-
-webkit-transform: rotateY(-90deg);
|
|
158
|
-
transform: rotateY(-90deg);
|
|
159
|
-
}
|
|
160
|
-
to {
|
|
161
|
-
-webkit-transform: rotateY(-180deg);
|
|
162
|
-
transform: rotateY(-180deg);
|
|
163
|
-
}`
|
|
164
|
-
const fwdy1827 = keyframes`
|
|
165
|
-
from {
|
|
166
|
-
-webkit-transform: rotateY(-180deg);
|
|
167
|
-
transform: rotateY(-180deg);
|
|
168
|
-
}
|
|
169
|
-
to {
|
|
170
|
-
-webkit-transform: rotateY(-270deg);
|
|
171
|
-
transform: rotateY(-270deg);
|
|
172
|
-
}`
|
|
173
|
-
const fwdy2736 = keyframes`
|
|
174
|
-
from {
|
|
175
|
-
-webkit-transform: rotateY(-270deg);
|
|
176
|
-
transform: rotateY(-270deg);
|
|
177
|
-
}
|
|
178
|
-
to {
|
|
179
|
-
-webkit-transform: rotateY(-360deg);
|
|
180
|
-
transform: rotateY(-360deg);
|
|
181
|
-
}`
|
|
182
|
-
|
|
183
|
-
/* ============================= floating */
|
|
184
|
-
const floatX = keyframes`
|
|
185
|
-
0% { -webkit-transform: translate(0, 0px); -ms-transform: translate(0, 0px); transform: translate(0, 0px); }
|
|
186
|
-
50% { -webkit-transform: translate(0, 15px); -ms-transform: translate(0, 15px); transform: translate(0, 15px); }
|
|
187
|
-
100% { -webkit-transform: translate(0, -0px); -ms-transform: translate(0, -0px); transform: translate(0, -0px); }`
|
|
188
|
-
|
|
189
|
-
const floatShadow = keyframes`
|
|
190
|
-
0% {
|
|
191
|
-
-webkit-box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6);
|
|
192
|
-
box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6);
|
|
193
|
-
-webkit-transform: translateY(0px);
|
|
194
|
-
-ms-transform: translateY(0px);
|
|
195
|
-
transform: translateY(0px);
|
|
196
|
-
}
|
|
197
|
-
50% {
|
|
198
|
-
-webkit-box-shadow: 0 25px 15px 0px rgba(0,0,0,0.2);
|
|
199
|
-
box-shadow: 0 25px 15px 0px rgba(0,0,0,0.2);
|
|
200
|
-
-webkit-transform: translateY(-20px);
|
|
201
|
-
-ms-transform: translateY(-20px);
|
|
202
|
-
transform: translateY(-20px);
|
|
203
|
-
}
|
|
204
|
-
100% {
|
|
205
|
-
-webkit-box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6);
|
|
206
|
-
box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6);
|
|
207
|
-
-webkit-transform: translateY(0px);
|
|
208
|
-
-ms-transform: translateY(0px);
|
|
209
|
-
transform: translateY(0px);
|
|
210
|
-
}`
|
|
211
|
-
|
|
212
|
-
const pulseSM = keyframes`
|
|
213
|
-
0% {
|
|
214
|
-
-webkit-transform: scale(0.9);
|
|
215
|
-
-ms-transform: scale(0.9);
|
|
216
|
-
transform: scale(0.9);
|
|
217
|
-
}
|
|
218
|
-
70% {
|
|
219
|
-
-webkit-transform: scale(1);
|
|
220
|
-
-ms-transform: scale(1);
|
|
221
|
-
transform: scale(1);
|
|
222
|
-
}
|
|
223
|
-
100% {
|
|
224
|
-
-webkit-transform: scale(0.9);
|
|
225
|
-
-ms-transform: scale(0.9);
|
|
226
|
-
transform: scale(0.9);
|
|
227
|
-
}`
|
|
228
|
-
|
|
229
|
-
const pulseMD = keyframes`
|
|
230
|
-
0% {
|
|
231
|
-
-webkit-transform: scale(0.7);
|
|
232
|
-
-ms-transform: scale(0.7);
|
|
233
|
-
transform: scale(0.7);
|
|
234
|
-
}
|
|
235
|
-
70% {
|
|
236
|
-
-webkit-transform: scale(1);
|
|
237
|
-
-ms-transform: scale(1);
|
|
238
|
-
transform: scale(1);
|
|
239
|
-
}
|
|
240
|
-
100% {
|
|
241
|
-
-webkit-transform: scale(0.7);
|
|
242
|
-
-ms-transform: scale(0.7);
|
|
243
|
-
transform: scale(0.7);
|
|
244
|
-
}`
|
|
245
|
-
|
|
246
|
-
const pulseLG = keyframes`
|
|
247
|
-
0% {
|
|
248
|
-
-webkit-transform: scale(0.5);
|
|
249
|
-
-ms-transform: scale(0.5);
|
|
250
|
-
transform: scale(0.5);
|
|
251
|
-
}
|
|
252
|
-
70% {
|
|
253
|
-
-webkit-transform: scale(1);
|
|
254
|
-
-ms-transform: scale(1);
|
|
255
|
-
transform: scale(1);
|
|
256
|
-
}
|
|
257
|
-
100% {
|
|
258
|
-
-webkit-transform: scale(0.5);
|
|
259
|
-
-ms-transform: scale(0.5);
|
|
260
|
-
transform: scale(0.5);
|
|
261
|
-
}`
|
|
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
|
-
}
|
|
290
|
-
}
|
|
@@ -1,30 +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 { width = 0, height = 0, perspective = 600, perspectiveOrigin = '50% 50%', zIndex = 10, children = {} } = props
|
|
15
|
-
|
|
16
|
-
const SceneStyleDiv: any = styled.div`
|
|
17
|
-
width: ${width}px;
|
|
18
|
-
height: ${height}px;
|
|
19
|
-
-webkit-perspective: ${perspective}px;
|
|
20
|
-
perspective: ${perspective}px;
|
|
21
|
-
-webkit-perspective-origin: ${perspectiveOrigin};
|
|
22
|
-
perspective-origin: ${perspectiveOrigin};
|
|
23
|
-
`
|
|
24
|
-
|
|
25
|
-
return (
|
|
26
|
-
<div style={{ zIndex }}>
|
|
27
|
-
<SceneStyleDiv>{children}</SceneStyleDiv>
|
|
28
|
-
</div>
|
|
29
|
-
)
|
|
30
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
//import MyCounter from './components/App'
|
|
2
|
-
//export { MyCounter }
|
|
3
|
-
|
|
4
|
-
import Face from './components/Faces/Face'
|
|
5
|
-
import { Cuboid } from './components/Cuboid'
|
|
6
|
-
import { Ribbon } from './components/Ribbon'
|
|
7
|
-
import { Card } from './components/Card'
|
|
8
|
-
|
|
9
|
-
export { Face, Cuboid, Ribbon, Card }
|
package/tests/common.test.tsx
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//import * as React from 'react'
|
|
2
|
-
import { render } from '@testing-library/react'
|
|
3
|
-
|
|
4
|
-
import 'jest-canvas-mock'
|
|
5
|
-
|
|
6
|
-
import { Face, Cuboid, Ribbon, Card } from '../src'
|
|
7
|
-
|
|
8
|
-
describe('Common render', () => {
|
|
9
|
-
it('renders without crashing', () => {
|
|
10
|
-
render(
|
|
11
|
-
<div>
|
|
12
|
-
<Cuboid />
|
|
13
|
-
<Face />
|
|
14
|
-
<Ribbon />
|
|
15
|
-
<Card />
|
|
16
|
-
</div>,
|
|
17
|
-
)
|
|
18
|
-
})
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
/*
|
|
22
|
-
import { MyCounter } from '../src'
|
|
23
|
-
|
|
24
|
-
describe('Common render', () => {
|
|
25
|
-
it('renders without crashing', () => {
|
|
26
|
-
render(<MyCounter />)
|
|
27
|
-
})
|
|
28
|
-
})
|
|
29
|
-
*/
|
package/tsconfig.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es5",
|
|
4
|
-
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"skipLibCheck": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"allowSyntheticDefaultImports": true,
|
|
9
|
-
"strict": true,
|
|
10
|
-
"forceConsistentCasingInFileNames": true,
|
|
11
|
-
"noFallthroughCasesInSwitch": true,
|
|
12
|
-
"module": "esnext",
|
|
13
|
-
"moduleResolution": "node",
|
|
14
|
-
"resolveJsonModule": true,
|
|
15
|
-
"isolatedModules": true,
|
|
16
|
-
"noEmit": true,
|
|
17
|
-
"jsx": "react-jsx",
|
|
18
|
-
"importHelpers": true,
|
|
19
|
-
"declaration": true,
|
|
20
|
-
"sourceMap": true,
|
|
21
|
-
"rootDir": "./src",
|
|
22
|
-
"outDir": "./dist/esm",
|
|
23
|
-
"noImplicitReturns": true,
|
|
24
|
-
"noUnusedLocals": true,
|
|
25
|
-
"noUnusedParameters": true
|
|
26
|
-
},
|
|
27
|
-
"include": ["src"],
|
|
28
|
-
"exclude": ["dist", "node_modules"]
|
|
29
|
-
}
|