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
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AnimWrap } from "./styles/AnimWrap";
|
|
3
|
+
import { SceneStyle } from "./styles/Scene";
|
|
4
|
+
import { ObjProps } from "./Face/face";
|
|
5
|
+
import Face from "./Face";
|
|
6
|
+
import { ObjWrapper } from "./styles/Global";
|
|
7
|
+
|
|
8
|
+
export const Card = (props: ObjProps): any => {
|
|
9
|
+
let {
|
|
10
|
+
anim1Specs,
|
|
11
|
+
anim2Specs,
|
|
12
|
+
width = 5,
|
|
13
|
+
height = 5,
|
|
14
|
+
faces,
|
|
15
|
+
global = {},
|
|
16
|
+
custom = {},
|
|
17
|
+
tranz = (+height / 2) | 0,
|
|
18
|
+
perspective,
|
|
19
|
+
perspectiveOrigin,
|
|
20
|
+
zIndex,
|
|
21
|
+
} = props;
|
|
22
|
+
|
|
23
|
+
const buildFace = (faceType: any): any => {
|
|
24
|
+
return (
|
|
25
|
+
<Face
|
|
26
|
+
width={width}
|
|
27
|
+
height={height}
|
|
28
|
+
depth={0.1}
|
|
29
|
+
faceType={faceType}
|
|
30
|
+
id={faceType}
|
|
31
|
+
tranz={tranz}
|
|
32
|
+
global={global}
|
|
33
|
+
custom={custom}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<SceneStyle
|
|
40
|
+
width={width}
|
|
41
|
+
height={height}
|
|
42
|
+
perspective={perspective}
|
|
43
|
+
perspectiveOrigin={perspectiveOrigin}
|
|
44
|
+
zIndex={zIndex}
|
|
45
|
+
>
|
|
46
|
+
<AnimWrap animSpecs={anim1Specs}>
|
|
47
|
+
<AnimWrap animSpecs={anim2Specs}>
|
|
48
|
+
<ObjWrapper>
|
|
49
|
+
{!!faces && !!faces.front ? buildFace("front") : null}
|
|
50
|
+
{!!faces && !!faces.back ? buildFace("back") : null}
|
|
51
|
+
</ObjWrapper>
|
|
52
|
+
</AnimWrap>
|
|
53
|
+
</AnimWrap>
|
|
54
|
+
</SceneStyle>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AnimWrap } from "./styles/AnimWrap";
|
|
3
|
+
import { SceneStyle } from "./styles/Scene";
|
|
4
|
+
import { ObjProps } from "./Face/face";
|
|
5
|
+
import Face from "./Face";
|
|
6
|
+
import { ObjWrapper } from "./styles/Global";
|
|
7
|
+
|
|
8
|
+
export const Cuboid = (props: ObjProps): any => {
|
|
9
|
+
let {
|
|
10
|
+
anim1Specs,
|
|
11
|
+
anim2Specs,
|
|
12
|
+
width = 5,
|
|
13
|
+
height = 5,
|
|
14
|
+
depth = 5,
|
|
15
|
+
faces,
|
|
16
|
+
global = {},
|
|
17
|
+
custom = {},
|
|
18
|
+
tranz = (+height / 2) | 0,
|
|
19
|
+
perspective,
|
|
20
|
+
perspectiveOrigin,
|
|
21
|
+
zIndex,
|
|
22
|
+
} = props;
|
|
23
|
+
|
|
24
|
+
const buildFace = (faceType: any): any => {
|
|
25
|
+
return (
|
|
26
|
+
<Face
|
|
27
|
+
width={width}
|
|
28
|
+
height={height}
|
|
29
|
+
depth={depth}
|
|
30
|
+
faceType={faceType}
|
|
31
|
+
id={faceType}
|
|
32
|
+
tranz={tranz}
|
|
33
|
+
global={global}
|
|
34
|
+
custom={custom}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<SceneStyle
|
|
41
|
+
width={width}
|
|
42
|
+
height={height}
|
|
43
|
+
perspective={perspective}
|
|
44
|
+
perspectiveOrigin={perspectiveOrigin}
|
|
45
|
+
zIndex={zIndex}
|
|
46
|
+
>
|
|
47
|
+
<AnimWrap animSpecs={anim1Specs}>
|
|
48
|
+
<AnimWrap animSpecs={anim2Specs}>
|
|
49
|
+
<ObjWrapper>
|
|
50
|
+
{!!faces && !!faces.front ? buildFace("front") : null}
|
|
51
|
+
{!!faces && !!faces.right ? buildFace("right") : null}
|
|
52
|
+
{!!faces && !!faces.back ? buildFace("back") : null}
|
|
53
|
+
{!!faces && !!faces.left ? buildFace("left") : null}
|
|
54
|
+
{!!faces && !!faces.top ? buildFace("top") : null}
|
|
55
|
+
{!!faces && !!faces.bottom ? buildFace("bottom") : null}
|
|
56
|
+
</ObjWrapper>
|
|
57
|
+
</AnimWrap>
|
|
58
|
+
</AnimWrap>
|
|
59
|
+
</SceneStyle>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface FaceProps {
|
|
2
|
+
children?: any;
|
|
3
|
+
depth?: number | any;
|
|
4
|
+
faceType?: any;
|
|
5
|
+
custom?: any;
|
|
6
|
+
global?: any;
|
|
7
|
+
height?: number | string;
|
|
8
|
+
id?: string | number | boolean;
|
|
9
|
+
styles?: object | any;
|
|
10
|
+
tranz: any;
|
|
11
|
+
width?: number | string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface ObjProps {
|
|
15
|
+
anim1Specs?: object | undefined;
|
|
16
|
+
anim2Specs?: object | undefined;
|
|
17
|
+
children: any;
|
|
18
|
+
depth?: number;
|
|
19
|
+
global?: { border?: string; bgc?: string; opac?: number | string } | any;
|
|
20
|
+
faces?:
|
|
21
|
+
| {
|
|
22
|
+
front: boolean;
|
|
23
|
+
back: boolean;
|
|
24
|
+
left: boolean;
|
|
25
|
+
right: boolean;
|
|
26
|
+
top: boolean;
|
|
27
|
+
bottom: boolean;
|
|
28
|
+
}
|
|
29
|
+
| undefined;
|
|
30
|
+
|
|
31
|
+
height?: number | string;
|
|
32
|
+
custom?: object | string | undefined;
|
|
33
|
+
perspective?: string | number | undefined;
|
|
34
|
+
perspectiveOrigin?: string | undefined;
|
|
35
|
+
tranz?: number | undefined;
|
|
36
|
+
txt?: string | any;
|
|
37
|
+
width?: number;
|
|
38
|
+
zIndex?: number | undefined;
|
|
39
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FaceProps } from "./face";
|
|
4
|
+
|
|
5
|
+
const Face = (props: FaceProps): JSX.Element => {
|
|
6
|
+
let {
|
|
7
|
+
depth = 10,
|
|
8
|
+
faceType,
|
|
9
|
+
global = {},
|
|
10
|
+
height = 10,
|
|
11
|
+
custom = false,
|
|
12
|
+
tranz = 80,
|
|
13
|
+
width = 100,
|
|
14
|
+
} = props;
|
|
15
|
+
|
|
16
|
+
let transform;
|
|
17
|
+
let styles =
|
|
18
|
+
!!custom[faceType] && !!custom[faceType].css
|
|
19
|
+
? custom[faceType].css
|
|
20
|
+
: global.css;
|
|
21
|
+
const body =
|
|
22
|
+
!!custom[faceType] && !!custom[faceType].body
|
|
23
|
+
? custom[faceType].body
|
|
24
|
+
: global.body;
|
|
25
|
+
if (faceType === "bottom") {
|
|
26
|
+
tranz = +height - +depth / 2;
|
|
27
|
+
height = +depth;
|
|
28
|
+
transform = `transform: rotateX(-90deg) translateZ(${tranz}px);`;
|
|
29
|
+
//styles = !!custom["top"] ? custom : global;
|
|
30
|
+
} else if (faceType === "top") {
|
|
31
|
+
height = +depth;
|
|
32
|
+
if (!!depth) tranz = +depth / 2;
|
|
33
|
+
transform = `transform: rotateX(90deg) translateZ(${tranz}px);`;
|
|
34
|
+
} else if (faceType === "front") {
|
|
35
|
+
if (!!depth) tranz = +depth / 2;
|
|
36
|
+
transform = `transform: rotateY(0deg) translateZ(${tranz}px);`;
|
|
37
|
+
} else if (faceType === "back") {
|
|
38
|
+
if (!!depth) tranz = +depth / 2;
|
|
39
|
+
transform = `transform: rotateY(180deg) translateZ(${tranz}px);`;
|
|
40
|
+
} else if (faceType === "right") {
|
|
41
|
+
if (height > width && !depth) {
|
|
42
|
+
tranz = -(+height / 2 - +width);
|
|
43
|
+
width = +height;
|
|
44
|
+
} else if (width > height && !depth) {
|
|
45
|
+
tranz = +height / 2;
|
|
46
|
+
height = +width;
|
|
47
|
+
} else {
|
|
48
|
+
tranz = +width - +depth / 2;
|
|
49
|
+
width = +depth;
|
|
50
|
+
}
|
|
51
|
+
transform = `transform: rotateY(90deg) translateZ(${tranz}px);`;
|
|
52
|
+
// topr is to of Ribbon which points back
|
|
53
|
+
} else if (faceType === "topr") {
|
|
54
|
+
height = +depth;
|
|
55
|
+
if (!!depth) tranz = +depth / 2;
|
|
56
|
+
let offset = depth / 2;
|
|
57
|
+
transform = `transform: rotateX(90deg) translateZ(${tranz}px ); `;
|
|
58
|
+
} else {
|
|
59
|
+
if (height > width && !depth) {
|
|
60
|
+
tranz = -(+height / 2 - +width);
|
|
61
|
+
width = +height;
|
|
62
|
+
} else if (width > height && !depth) {
|
|
63
|
+
tranz = +height / 2;
|
|
64
|
+
height = +width;
|
|
65
|
+
} else {
|
|
66
|
+
tranz = +depth / 2;
|
|
67
|
+
width = +depth;
|
|
68
|
+
}
|
|
69
|
+
transform = `transform: rotateY(-90deg) translateZ(${tranz}px);`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const BackFlip: any = styled.section``;
|
|
73
|
+
|
|
74
|
+
const Specs: any = styled.section`
|
|
75
|
+
${styles}
|
|
76
|
+
width: ${width}px;
|
|
77
|
+
position: absolute;
|
|
78
|
+
height: ${height}px;
|
|
79
|
+
${transform};
|
|
80
|
+
`;
|
|
81
|
+
|
|
82
|
+
return <Specs>{body}</Specs>;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export default Face;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { AnimWrap } from "./styles/AnimWrap";
|
|
3
|
+
import { SceneStyle } from "./styles/Scene";
|
|
4
|
+
import { ObjProps } from "./Face/face";
|
|
5
|
+
import Face from "./Face";
|
|
6
|
+
import { ObjWrapper } from "./styles/Global";
|
|
7
|
+
|
|
8
|
+
export const Ribbon = (props: ObjProps): any => {
|
|
9
|
+
let {
|
|
10
|
+
anim1Specs,
|
|
11
|
+
anim2Specs,
|
|
12
|
+
width = 5,
|
|
13
|
+
height = 5,
|
|
14
|
+
depth = 5,
|
|
15
|
+
faces,
|
|
16
|
+
global = {},
|
|
17
|
+
custom = {},
|
|
18
|
+
tranz = (+height / 2) | 0,
|
|
19
|
+
perspective,
|
|
20
|
+
perspectiveOrigin,
|
|
21
|
+
zIndex,
|
|
22
|
+
} = props;
|
|
23
|
+
|
|
24
|
+
const buildFace = (faceType: any): any => {
|
|
25
|
+
return (
|
|
26
|
+
<Face
|
|
27
|
+
width={width}
|
|
28
|
+
height={height}
|
|
29
|
+
depth={depth}
|
|
30
|
+
faceType={faceType}
|
|
31
|
+
id={faceType}
|
|
32
|
+
tranz={tranz}
|
|
33
|
+
global={global}
|
|
34
|
+
custom={custom}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<SceneStyle
|
|
41
|
+
width={width}
|
|
42
|
+
height={height}
|
|
43
|
+
perspective={perspective}
|
|
44
|
+
perspectiveOrigin={perspectiveOrigin}
|
|
45
|
+
zIndex={zIndex}
|
|
46
|
+
>
|
|
47
|
+
<AnimWrap animSpecs={anim1Specs}>
|
|
48
|
+
<AnimWrap animSpecs={anim2Specs}>
|
|
49
|
+
<ObjWrapper>
|
|
50
|
+
{!!faces && !!faces.bottom ? buildFace("bottom") : null}
|
|
51
|
+
{!!faces && !!faces.back ? buildFace("back") : null}
|
|
52
|
+
{!!faces && !!faces.top ? buildFace("topr") : null}
|
|
53
|
+
</ObjWrapper>
|
|
54
|
+
</AnimWrap>
|
|
55
|
+
</AnimWrap>
|
|
56
|
+
</SceneStyle>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { AnimStylesProps } from "./Anim";
|
|
4
|
+
import { allAnims } from "./Anims";
|
|
5
|
+
|
|
6
|
+
export const AnimWrap = (props: AnimStylesProps) => {
|
|
7
|
+
const { children, animSpecs } = props;
|
|
8
|
+
const AS: any = animSpecs;
|
|
9
|
+
|
|
10
|
+
const {
|
|
11
|
+
X360,
|
|
12
|
+
Y360,
|
|
13
|
+
fadeInkf,
|
|
14
|
+
wobY,
|
|
15
|
+
wobX,
|
|
16
|
+
fwdx018,
|
|
17
|
+
fwdx1836,
|
|
18
|
+
fwdx09,
|
|
19
|
+
fwdx918,
|
|
20
|
+
fwdx1827,
|
|
21
|
+
fwdx2736,
|
|
22
|
+
fwdy018,
|
|
23
|
+
fwdy1836,
|
|
24
|
+
fwdy09,
|
|
25
|
+
fwdy918,
|
|
26
|
+
fwdy1827,
|
|
27
|
+
fwdy2736,
|
|
28
|
+
floatX,
|
|
29
|
+
floatShadow,
|
|
30
|
+
pulseSM,
|
|
31
|
+
pulseMD,
|
|
32
|
+
pulseLG,
|
|
33
|
+
noAnim,
|
|
34
|
+
} = allAnims({ degreesHi: AS.degreesHi, degreesLow: AS.degreesLow });
|
|
35
|
+
|
|
36
|
+
let theAnim: any = "noAnim";
|
|
37
|
+
// need to iterate through all animation posibilities and not use eval() to satisfy TS
|
|
38
|
+
if (AS.name === "X360") theAnim = X360;
|
|
39
|
+
else if (AS.name === "Y360") theAnim = Y360;
|
|
40
|
+
else if (AS.name === "fadeInkf") theAnim = fadeInkf;
|
|
41
|
+
else if (AS.name === "wobX") theAnim = wobX;
|
|
42
|
+
else if (AS.name === "wobY") theAnim = wobY;
|
|
43
|
+
else if (AS.name === "fwdx018") theAnim = fwdx018;
|
|
44
|
+
else if (AS.name === "fwdx1836") theAnim = fwdx1836;
|
|
45
|
+
else if (AS.name === "fwdx09") theAnim = fwdx09;
|
|
46
|
+
else if (AS.name === "fwdx918") theAnim = fwdx918;
|
|
47
|
+
else if (AS.name === "fwdx1827") theAnim = fwdx1827;
|
|
48
|
+
else if (AS.name === "fwdx2736") theAnim = fwdx2736;
|
|
49
|
+
else if (AS.name === "fwdy018") theAnim = fwdy018;
|
|
50
|
+
else if (AS.name === "fwdy1836") theAnim = fwdy1836;
|
|
51
|
+
else if (AS.name === "fwdy09") theAnim = fwdy09;
|
|
52
|
+
else if (AS.name === "fwdy918") theAnim = fwdy918;
|
|
53
|
+
else if (AS.name === "fwdy1827") theAnim = fwdy1827;
|
|
54
|
+
else if (AS.name === "fwdy2736") theAnim = fwdy2736;
|
|
55
|
+
else if (AS.name === "floatX") theAnim = floatX;
|
|
56
|
+
else if (AS.name === "floatShadow") theAnim = floatShadow;
|
|
57
|
+
else if (AS.name === "pulseSM") theAnim = pulseSM;
|
|
58
|
+
else if (AS.name === "pulseMD") theAnim = pulseMD;
|
|
59
|
+
else if (AS.name === "pulseLG") theAnim = pulseLG;
|
|
60
|
+
else theAnim = noAnim;
|
|
61
|
+
|
|
62
|
+
const AnimWrapDiv: any = styled.div`
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
position: relative;
|
|
66
|
+
transform-style: preserve-3d;
|
|
67
|
+
border: ${AS.border};
|
|
68
|
+
-webkit-animation-duration: ${AS.duration}s;
|
|
69
|
+
animation-duration: ${AS.duration}s;
|
|
70
|
+
-webkit-animation-iteration-count: ${AS.iterationCount};
|
|
71
|
+
animation-iteration-count: ${AS.iterationCount};
|
|
72
|
+
-webkit-animation-name: ${theAnim};
|
|
73
|
+
animation-name: ${theAnim};
|
|
74
|
+
-webkit-animation-fill-mode: ${AS.fillMode};
|
|
75
|
+
animation-fill-mode: ${AS.fillMode};
|
|
76
|
+
animation-direction: ${AS.direction};
|
|
77
|
+
-webkit-animation-direction: ${AS.direction};
|
|
78
|
+
-webkit-animation-timing-function: ${AS.timing};
|
|
79
|
+
animation-timing-function: ${AS.timing};
|
|
80
|
+
-webkit-animation-delay: ${AS.delay}s;
|
|
81
|
+
animation-delay: ${AS.delay}s;
|
|
82
|
+
`;
|
|
83
|
+
|
|
84
|
+
return <AnimWrapDiv>{children}</AnimWrapDiv>;
|
|
85
|
+
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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`
|
|
8
12
|
from {
|
|
9
13
|
-webkit-transform: rotateX(360deg);
|
|
10
14
|
transform: rotateX(360deg);
|
|
@@ -14,8 +18,9 @@ const allAnims = (props) => {
|
|
|
14
18
|
transform: rotateX(0deg);
|
|
15
19
|
}
|
|
16
20
|
}`;
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
|
|
22
|
+
//////// Y360
|
|
23
|
+
const Y360 = keyframes`
|
|
19
24
|
from {
|
|
20
25
|
-webkit-transform: rotateY(360deg);
|
|
21
26
|
transform: rotateY(360deg);
|
|
@@ -24,14 +29,16 @@ const allAnims = (props) => {
|
|
|
24
29
|
-webkit-transform: rotateY(0deg);
|
|
25
30
|
transform: rotateY(0deg);
|
|
26
31
|
}`;
|
|
27
|
-
|
|
32
|
+
|
|
33
|
+
const fadeInkf = keyframes`
|
|
28
34
|
from {
|
|
29
35
|
opacity: 0;
|
|
30
36
|
}
|
|
31
37
|
to {
|
|
32
38
|
opacity: 1;
|
|
33
39
|
}`;
|
|
34
|
-
|
|
40
|
+
|
|
41
|
+
const wobY = keyframes`
|
|
35
42
|
0% {
|
|
36
43
|
-webkit-transform: rotateY(${degreesLow}deg);
|
|
37
44
|
transform: rotateY(${degreesLow}deg);
|
|
@@ -44,7 +51,8 @@ const allAnims = (props) => {
|
|
|
44
51
|
-webkit-transform: rotateY(${degreesLow}deg);
|
|
45
52
|
transform: rotateY(${degreesLow}deg);
|
|
46
53
|
}`;
|
|
47
|
-
|
|
54
|
+
|
|
55
|
+
const wobX = keyframes`
|
|
48
56
|
0% {
|
|
49
57
|
-webkit-transform: rotateX(${degreesLow}deg);
|
|
50
58
|
transform: rotateX(${degreesLow}deg);
|
|
@@ -57,8 +65,8 @@ const allAnims = (props) => {
|
|
|
57
65
|
-webkit-transform: rotateX(${degreesLow}deg);
|
|
58
66
|
transform: rotateX(${degreesLow}deg);
|
|
59
67
|
}`;
|
|
60
|
-
|
|
61
|
-
|
|
68
|
+
/* ============================== x-axis 0-180 >180 - 360 */
|
|
69
|
+
const fwdx018 = keyframes`
|
|
62
70
|
from {
|
|
63
71
|
-webkit-transform: rotateX(360deg);
|
|
64
72
|
transform: rotateX(360deg);
|
|
@@ -67,7 +75,7 @@ const allAnims = (props) => {
|
|
|
67
75
|
-webkit-transform: rotateX(180deg);
|
|
68
76
|
transform: rotateX(180deg);
|
|
69
77
|
}`;
|
|
70
|
-
|
|
78
|
+
const fwdx1836 = keyframes`
|
|
71
79
|
from {
|
|
72
80
|
-webkit-transform: rotateX(180deg);
|
|
73
81
|
transform: rotateX(180deg);
|
|
@@ -76,8 +84,8 @@ const allAnims = (props) => {
|
|
|
76
84
|
-webkit-transform: rotateX(0deg);
|
|
77
85
|
transform: rotateX(0deg);
|
|
78
86
|
}`;
|
|
79
|
-
|
|
80
|
-
|
|
87
|
+
/* ============================= x-axis 0-90, 90-180, 180-270, 270-360 */
|
|
88
|
+
const fwdx09 = keyframes`
|
|
81
89
|
from {
|
|
82
90
|
-webkit-transform: rotateX(360deg);
|
|
83
91
|
transform: rotateX(360deg);
|
|
@@ -86,7 +94,7 @@ const allAnims = (props) => {
|
|
|
86
94
|
-webkit-transform: rotateX(90deg);
|
|
87
95
|
transform: rotateX(90deg);
|
|
88
96
|
}`;
|
|
89
|
-
|
|
97
|
+
const fwdx918 = keyframes`
|
|
90
98
|
from {
|
|
91
99
|
-webkit-transform: rotateX(-90deg);
|
|
92
100
|
transform: rotateX(-90deg);
|
|
@@ -95,7 +103,7 @@ const allAnims = (props) => {
|
|
|
95
103
|
-webkit-transform: rotateX(-180deg);
|
|
96
104
|
transform: rotateX(-180deg);
|
|
97
105
|
}`;
|
|
98
|
-
|
|
106
|
+
const fwdx1827 = keyframes`
|
|
99
107
|
from {
|
|
100
108
|
-webkit-transform: rotateX(-180deg);
|
|
101
109
|
transform: rotateX(-180deg);
|
|
@@ -104,7 +112,7 @@ const allAnims = (props) => {
|
|
|
104
112
|
-webkit-transform: rotateX(-270deg);
|
|
105
113
|
transform: rotateX(-270deg);
|
|
106
114
|
}`;
|
|
107
|
-
|
|
115
|
+
const fwdx2736 = keyframes`
|
|
108
116
|
from {
|
|
109
117
|
-webkit-transform: rotateX(-270deg);
|
|
110
118
|
transform: rotateX(-270deg);
|
|
@@ -113,8 +121,9 @@ const allAnims = (props) => {
|
|
|
113
121
|
-webkit-transform: rotateX(-360deg);
|
|
114
122
|
transform: rotateX(-360deg);
|
|
115
123
|
}`;
|
|
116
|
-
|
|
117
|
-
|
|
124
|
+
|
|
125
|
+
/* ============================== y-axis 0-180 >180 - 360 */
|
|
126
|
+
const fwdy018 = keyframes`
|
|
118
127
|
from {
|
|
119
128
|
-webkit-transform: rotateY(360deg);
|
|
120
129
|
transform: rotateY(360deg);
|
|
@@ -123,7 +132,7 @@ const allAnims = (props) => {
|
|
|
123
132
|
-webkit-transform: rotateY(180deg);
|
|
124
133
|
transform: rotateY(180deg);
|
|
125
134
|
}`;
|
|
126
|
-
|
|
135
|
+
const fwdy1836 = keyframes`
|
|
127
136
|
from {
|
|
128
137
|
-webkit-transform: rotateY(180deg);
|
|
129
138
|
transform: rotateY(180deg);
|
|
@@ -132,8 +141,9 @@ const allAnims = (props) => {
|
|
|
132
141
|
-webkit-transform: rotateY(0deg);
|
|
133
142
|
transform: rotateY(0deg);
|
|
134
143
|
}`;
|
|
135
|
-
|
|
136
|
-
|
|
144
|
+
|
|
145
|
+
/* ============================= y-axis 0-90, 90-180, 180-270, 270-360 */
|
|
146
|
+
const fwdy09 = keyframes`
|
|
137
147
|
from {
|
|
138
148
|
-webkit-transform: rotateY(360deg);
|
|
139
149
|
transform: rotateY(360deg);
|
|
@@ -142,7 +152,7 @@ const allAnims = (props) => {
|
|
|
142
152
|
-webkit-transform: rotateY(90deg);
|
|
143
153
|
transform: rotateY(90deg);
|
|
144
154
|
}`;
|
|
145
|
-
|
|
155
|
+
const fwdy918 = keyframes`
|
|
146
156
|
from {
|
|
147
157
|
-webkit-transform: rotateY(-90deg);
|
|
148
158
|
transform: rotateY(-90deg);
|
|
@@ -151,7 +161,7 @@ const allAnims = (props) => {
|
|
|
151
161
|
-webkit-transform: rotateY(-180deg);
|
|
152
162
|
transform: rotateY(-180deg);
|
|
153
163
|
}`;
|
|
154
|
-
|
|
164
|
+
const fwdy1827 = keyframes`
|
|
155
165
|
from {
|
|
156
166
|
-webkit-transform: rotateY(-180deg);
|
|
157
167
|
transform: rotateY(-180deg);
|
|
@@ -160,7 +170,7 @@ const allAnims = (props) => {
|
|
|
160
170
|
-webkit-transform: rotateY(-270deg);
|
|
161
171
|
transform: rotateY(-270deg);
|
|
162
172
|
}`;
|
|
163
|
-
|
|
173
|
+
const fwdy2736 = keyframes`
|
|
164
174
|
from {
|
|
165
175
|
-webkit-transform: rotateY(-270deg);
|
|
166
176
|
transform: rotateY(-270deg);
|
|
@@ -169,12 +179,14 @@ const allAnims = (props) => {
|
|
|
169
179
|
-webkit-transform: rotateY(-360deg);
|
|
170
180
|
transform: rotateY(-360deg);
|
|
171
181
|
}`;
|
|
172
|
-
|
|
173
|
-
|
|
182
|
+
|
|
183
|
+
/* ============================= floating */
|
|
184
|
+
const floatX = keyframes`
|
|
174
185
|
0% { -webkit-transform: translate(0, 0px); -ms-transform: translate(0, 0px); transform: translate(0, 0px); }
|
|
175
186
|
50% { -webkit-transform: translate(0, 15px); -ms-transform: translate(0, 15px); transform: translate(0, 15px); }
|
|
176
187
|
100% { -webkit-transform: translate(0, -0px); -ms-transform: translate(0, -0px); transform: translate(0, -0px); }`;
|
|
177
|
-
|
|
188
|
+
|
|
189
|
+
const floatShadow = keyframes`
|
|
178
190
|
0% {
|
|
179
191
|
-webkit-box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6);
|
|
180
192
|
box-shadow: 0 5px 15px 0px rgba(0,0,0,0.6);
|
|
@@ -196,7 +208,8 @@ const allAnims = (props) => {
|
|
|
196
208
|
-ms-transform: translateY(0px);
|
|
197
209
|
transform: translateY(0px);
|
|
198
210
|
}`;
|
|
199
|
-
|
|
211
|
+
|
|
212
|
+
const pulseSM = keyframes`
|
|
200
213
|
0% {
|
|
201
214
|
-webkit-transform: scale(0.9);
|
|
202
215
|
-ms-transform: scale(0.9);
|
|
@@ -212,7 +225,8 @@ const allAnims = (props) => {
|
|
|
212
225
|
-ms-transform: scale(0.9);
|
|
213
226
|
transform: scale(0.9);
|
|
214
227
|
}`;
|
|
215
|
-
|
|
228
|
+
|
|
229
|
+
const pulseMD = keyframes`
|
|
216
230
|
0% {
|
|
217
231
|
-webkit-transform: scale(0.7);
|
|
218
232
|
-ms-transform: scale(0.7);
|
|
@@ -228,7 +242,8 @@ const allAnims = (props) => {
|
|
|
228
242
|
-ms-transform: scale(0.7);
|
|
229
243
|
transform: scale(0.7);
|
|
230
244
|
}`;
|
|
231
|
-
|
|
245
|
+
|
|
246
|
+
const pulseLG = keyframes`
|
|
232
247
|
0% {
|
|
233
248
|
-webkit-transform: scale(0.5);
|
|
234
249
|
-ms-transform: scale(0.5);
|
|
@@ -244,32 +259,32 @@ const allAnims = (props) => {
|
|
|
244
259
|
-ms-transform: scale(0.5);
|
|
245
260
|
transform: scale(0.5);
|
|
246
261
|
}`;
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
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
|
+
};
|
|
273
290
|
};
|
|
274
|
-
exports.allAnims = allAnims;
|
|
275
|
-
//# sourceMappingURL=Anims.js.map
|