anim-3d-obj 1.1.225 → 1.2.0
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 +2 -2
- package/dist/cjs/components/Face.d.ts +11 -0
- package/dist/cjs/components/Face.js +107 -0
- package/dist/cjs/components/Obj.d.ts +2 -0
- package/dist/cjs/components/Obj.js +31 -0
- package/dist/cjs/components/index.d.ts +2 -0
- package/dist/cjs/components/index.js +18 -0
- package/dist/cjs/components/styles/AnimWrap.d.ts +2 -0
- package/dist/cjs/components/styles/AnimWrap.js +90 -0
- package/dist/cjs/components/styles/Anims.d.ts +32 -0
- package/dist/cjs/components/styles/Anims.js +329 -0
- package/dist/cjs/components/styles/Global.d.ts +6 -0
- package/dist/cjs/components/styles/Global.js +27 -0
- package/dist/cjs/components/styles/Scene.d.ts +10 -0
- package/dist/cjs/components/styles/Scene.js +22 -0
- package/dist/cjs/index.js +17 -0
- package/dist/esm/components/Face.d.ts +11 -0
- package/dist/esm/components/Face.js +101 -0
- package/dist/esm/components/Obj.d.ts +2 -0
- package/dist/esm/components/Obj.js +25 -0
- package/dist/esm/components/index.d.ts +2 -0
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/components/styles/AnimWrap.d.ts +2 -0
- package/dist/esm/components/styles/AnimWrap.js +83 -0
- package/dist/esm/components/styles/Anims.d.ts +32 -0
- package/{src/components/styles/Anims.ts → dist/esm/components/styles/Anims.js} +60 -82
- package/dist/esm/components/styles/Global.d.ts +6 -0
- package/dist/esm/components/styles/Global.js +20 -0
- package/dist/esm/components/styles/Scene.d.ts +10 -0
- package/dist/esm/components/styles/Scene.js +15 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/package.json +28 -44
- package/ang1.png +0 -0
- package/babel.config.json +0 -18
- package/jestconfig.json +0 -8
- package/public/ang2.png +0 -0
- package/public/ang3.png +0 -0
- package/public/angl1.png +0 -0
- 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/Face.tsx +0 -95
- package/src/components/Obj.tsx +0 -53
- package/src/components/index.ts +0 -4
- package/src/components/styles/Anim.d.ts +0 -17
- package/src/components/styles/AnimWrap.tsx +0 -90
- package/src/components/styles/Global.tsx +0 -28
- package/src/components/styles/Scene.tsx +0 -37
- package/src/components/types.d.ts +0 -42
- package/tsconfig.json +0 -20
- /package/{src/index.ts → dist/cjs/index.d.ts} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import React from "react";
|
|
3
|
+
export const SceneStyle = (props) => {
|
|
4
|
+
const { width = 0, height = 0, perspective = 600, perspectiveOrigin = "50% 50%", zIndex = 10, children = {}, } = props;
|
|
5
|
+
const SceneStyleDiv = styled.div `
|
|
6
|
+
width: ${width}px;
|
|
7
|
+
height: ${height}px;
|
|
8
|
+
-webkit-perspective: ${perspective}px;
|
|
9
|
+
perspective: ${perspective}px;
|
|
10
|
+
-webkit-perspective-origin: ${perspectiveOrigin};
|
|
11
|
+
perspective-origin: ${perspectiveOrigin};
|
|
12
|
+
`;
|
|
13
|
+
return (React.createElement("div", { style: { zIndex } },
|
|
14
|
+
React.createElement(SceneStyleDiv, null, children)));
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./components";
|
package/package.json
CHANGED
|
@@ -1,57 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anim-3d-obj",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"private": false,
|
|
3
|
+
"version": "1.2.0",
|
|
5
4
|
"repository": {
|
|
6
5
|
"type": "git",
|
|
7
6
|
"url": "https://github.com/mdnelles/anim-3d-obj-npm-publisher.git"
|
|
8
7
|
},
|
|
9
|
-
"homepage": "https://
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
8
|
+
"homepage": "https://github.com/mdnelles/anim-3d-obj-npm-publisher.git",
|
|
9
|
+
"description": "React library for creating 3D objects quickly. Also these objects can be animated",
|
|
10
|
+
"mainOLD": "dist/cjs/index.js",
|
|
11
|
+
"main": "dist/cjs/components/Obj.js",
|
|
12
|
+
"module": "dist/esm/components/Obj.js",
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
17
16
|
"scripts": {
|
|
18
|
-
"
|
|
19
|
-
"build": "
|
|
20
|
-
"build:
|
|
21
|
-
"test": "react-scripts test",
|
|
22
|
-
"eject": "react-scripts eject"
|
|
23
|
-
},
|
|
24
|
-
"eslintConfig": {
|
|
25
|
-
"extends": [
|
|
26
|
-
"react-app",
|
|
27
|
-
"react-app/jest"
|
|
28
|
-
]
|
|
29
|
-
},
|
|
30
|
-
"browserslist": {
|
|
31
|
-
"production": [
|
|
32
|
-
">0.2%",
|
|
33
|
-
"not dead",
|
|
34
|
-
"not op_mini all"
|
|
35
|
-
],
|
|
36
|
-
"development": [
|
|
37
|
-
"last 1 chrome version",
|
|
38
|
-
"last 1 firefox version",
|
|
39
|
-
"last 1 safari version"
|
|
40
|
-
]
|
|
17
|
+
"build": "rm -rf dist/ && prettier --write src/ && npm run build:esm && npm run build:cjs",
|
|
18
|
+
"build:esm": "tsc",
|
|
19
|
+
"build:cjs": "tsc --module CommonJS --outDir dist/cjs"
|
|
41
20
|
},
|
|
21
|
+
"author": "mdnelles",
|
|
22
|
+
"license": "MIT",
|
|
42
23
|
"devDependencies": {
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
45
|
-
"@
|
|
46
|
-
"@testing-library/jest-dom": "^5.17.0",
|
|
47
|
-
"@testing-library/react": "^14.0.0",
|
|
48
|
-
"@testing-library/user-event": "^14.4.3",
|
|
49
|
-
"@types/jest": "^29.5.3",
|
|
50
|
-
"@types/node": "^20.4.2",
|
|
51
|
-
"@types/react": "^18.2.15",
|
|
52
|
-
"@types/react-dom": "^18.2.7",
|
|
24
|
+
"@types/node": "^18.11.9",
|
|
25
|
+
"@types/react": "^18.0.25",
|
|
26
|
+
"@types/react-dom": "^18.0.8",
|
|
53
27
|
"@types/styled-components": "^5.1.26",
|
|
54
|
-
"
|
|
28
|
+
"prettier": "^3.0.0",
|
|
29
|
+
"react": "^18.2.0",
|
|
30
|
+
"react-dom": "^18.2.0",
|
|
31
|
+
"typescript": "^4.8.4"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"react": "^18.2.0",
|
|
35
|
+
"react-dom": "^18.2.0"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"styled-components": "^5.3.6"
|
|
55
39
|
},
|
|
56
40
|
"keywords": [
|
|
57
41
|
"React",
|
package/ang1.png
DELETED
|
Binary file
|
package/babel.config.json
DELETED
package/jestconfig.json
DELETED
package/public/ang2.png
DELETED
|
Binary file
|
package/public/ang3.png
DELETED
|
Binary file
|
package/public/angl1.png
DELETED
|
Binary file
|
package/public/favicon.ico
DELETED
|
Binary file
|
package/public/index.html
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
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>
|
package/public/logo192.png
DELETED
|
Binary file
|
package/public/logo512.png
DELETED
|
Binary file
|
package/public/manifest.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"short_name": "React App",
|
|
3
|
-
"name": "Create React App Sample",
|
|
4
|
-
"icons": [
|
|
5
|
-
{
|
|
6
|
-
"src": "favicon.ico",
|
|
7
|
-
"sizes": "64x64 32x32 24x24 16x16",
|
|
8
|
-
"type": "image/x-icon"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"src": "logo192.png",
|
|
12
|
-
"type": "image/png",
|
|
13
|
-
"sizes": "192x192"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"src": "logo512.png",
|
|
17
|
-
"type": "image/png",
|
|
18
|
-
"sizes": "512x512"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"start_url": ".",
|
|
22
|
-
"display": "standalone",
|
|
23
|
-
"theme_color": "#000000",
|
|
24
|
-
"background_color": "#ffffff"
|
|
25
|
-
}
|
package/public/robots.txt
DELETED
package/src/components/Face.tsx
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { FaceProps } from "./types";
|
|
3
|
-
|
|
4
|
-
export default function Face(props: FaceProps): JSX.Element {
|
|
5
|
-
let display = true;
|
|
6
|
-
let {
|
|
7
|
-
depth = 10,
|
|
8
|
-
global = { css: "", body: "" },
|
|
9
|
-
height = 10,
|
|
10
|
-
face,
|
|
11
|
-
width = 100,
|
|
12
|
-
} = props;
|
|
13
|
-
|
|
14
|
-
let transform;
|
|
15
|
-
let tranz = +height / 2;
|
|
16
|
-
const body = face.body ? face.body : global.body;
|
|
17
|
-
|
|
18
|
-
////////////////////////////////////////////////////////////////////////////// BOTTOM
|
|
19
|
-
if (face.name === "bottom") {
|
|
20
|
-
tranz = +height - +depth / 2;
|
|
21
|
-
height = +depth;
|
|
22
|
-
transform = `transform: rotateX(-90deg) translateZ(${tranz}px);`;
|
|
23
|
-
} else if (face.name === "bottom_rear") {
|
|
24
|
-
tranz = +height - +depth / 2;
|
|
25
|
-
height = +depth;
|
|
26
|
-
transform = `transform: rotateX(-90deg) translateZ(${tranz}px) translateY(${height}px) `;
|
|
27
|
-
} else if (face.name === "bottom_front") {
|
|
28
|
-
tranz = +height - +depth / 2;
|
|
29
|
-
height = +depth;
|
|
30
|
-
transform = `transform: rotateX(-90deg) translateZ(${tranz}px) translateY(${-height}px) `;
|
|
31
|
-
|
|
32
|
-
////////////////////////////////////////////////////////////////////////////// TOPS
|
|
33
|
-
} else if (face.name === "top") {
|
|
34
|
-
height = +depth;
|
|
35
|
-
if (!!depth) tranz = +depth / 2;
|
|
36
|
-
transform = `transform: rotateX(90deg) translateZ(${tranz}px);`;
|
|
37
|
-
} else if (face.name === "top_rear") {
|
|
38
|
-
height = +depth;
|
|
39
|
-
if (!!depth) tranz = +depth / 2;
|
|
40
|
-
transform = `transform: rotateX(90deg) translateZ(${tranz}px) translateY(-${
|
|
41
|
-
tranz * 2
|
|
42
|
-
}px) `;
|
|
43
|
-
} else if (face.name === "top_front") {
|
|
44
|
-
height = +depth;
|
|
45
|
-
if (!!depth) tranz = +depth / 2;
|
|
46
|
-
|
|
47
|
-
transform = `transform: rotateX(90deg) translateZ(${tranz}px) translateY(${
|
|
48
|
-
tranz * 2
|
|
49
|
-
}px) `;
|
|
50
|
-
} else if (face.name === "front") {
|
|
51
|
-
if (!!depth) tranz = +depth / 2;
|
|
52
|
-
transform = `transform: rotateY(0deg) translateZ(${tranz}px);`;
|
|
53
|
-
} else if (face.name === "back") {
|
|
54
|
-
if (!!depth) tranz = +depth / 2;
|
|
55
|
-
transform = `transform: rotateY(180deg) translateZ(${tranz}px);`;
|
|
56
|
-
} else if (face.name === "right") {
|
|
57
|
-
if (height > width && !depth) {
|
|
58
|
-
tranz = -(+height / 2 - +width);
|
|
59
|
-
width = +height;
|
|
60
|
-
} else if (width > height && !depth) {
|
|
61
|
-
tranz = +height / 2;
|
|
62
|
-
height = +width;
|
|
63
|
-
} else {
|
|
64
|
-
tranz = +width - +depth / 2;
|
|
65
|
-
width = +depth;
|
|
66
|
-
}
|
|
67
|
-
transform = `transform: rotateY(90deg) translateZ(${tranz}px);`;
|
|
68
|
-
// topr is to of Ribbon which points back
|
|
69
|
-
} else if (face.name === "left") {
|
|
70
|
-
if (height > width && !depth) {
|
|
71
|
-
tranz = -(+height / 2 - +width);
|
|
72
|
-
width = +height;
|
|
73
|
-
} else if (width > height && !depth) {
|
|
74
|
-
tranz = +height / 2;
|
|
75
|
-
height = +width;
|
|
76
|
-
} else {
|
|
77
|
-
tranz = +depth / 2;
|
|
78
|
-
width = +depth;
|
|
79
|
-
}
|
|
80
|
-
transform = `transform: rotateY(-90deg) translateZ(${tranz}px);`;
|
|
81
|
-
} else {
|
|
82
|
-
//console.log(face.name + " is not a recognized face.name");
|
|
83
|
-
display = false;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const Specs: any = styled.section`
|
|
87
|
-
${face.css || global.css}
|
|
88
|
-
width: ${width}px;
|
|
89
|
-
position: absolute;
|
|
90
|
-
height: ${height}px;
|
|
91
|
-
${transform}
|
|
92
|
-
`;
|
|
93
|
-
|
|
94
|
-
return display ? <Specs>{body}</Specs> : <></>;
|
|
95
|
-
}
|
package/src/components/Obj.tsx
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { ObjWrapper } from "./styles/Global";
|
|
2
|
-
import { AnimWrap } from "./styles/AnimWrap";
|
|
3
|
-
import { SceneStyle } from "./styles/Scene";
|
|
4
|
-
import Face from "./Face";
|
|
5
|
-
import { FaceType, ObjProps } from "./types";
|
|
6
|
-
import React from "react";
|
|
7
|
-
|
|
8
|
-
export default function Obj(props: ObjProps): JSX.Element {
|
|
9
|
-
let {
|
|
10
|
-
anim1,
|
|
11
|
-
anim2,
|
|
12
|
-
width = 5,
|
|
13
|
-
height = 5,
|
|
14
|
-
depth = 5,
|
|
15
|
-
global = {},
|
|
16
|
-
faces,
|
|
17
|
-
perspective,
|
|
18
|
-
perspectiveOrigin,
|
|
19
|
-
zIndex,
|
|
20
|
-
} = props;
|
|
21
|
-
|
|
22
|
-
// process config
|
|
23
|
-
const buildFace = (face: FaceType): any => {
|
|
24
|
-
const details = {
|
|
25
|
-
width,
|
|
26
|
-
height,
|
|
27
|
-
depth,
|
|
28
|
-
face,
|
|
29
|
-
global,
|
|
30
|
-
};
|
|
31
|
-
return <Face {...details} key={face.name} />;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<SceneStyle
|
|
36
|
-
width={width}
|
|
37
|
-
height={height}
|
|
38
|
-
perspective={perspective}
|
|
39
|
-
perspectiveOrigin={perspectiveOrigin}
|
|
40
|
-
zIndex={zIndex}
|
|
41
|
-
>
|
|
42
|
-
<AnimWrap animSpecs={anim1}>
|
|
43
|
-
<AnimWrap animSpecs={anim2}>
|
|
44
|
-
<ObjWrapper>
|
|
45
|
-
{faces && faces[0]
|
|
46
|
-
? faces.map((face) => (face.name ? buildFace(face) : null))
|
|
47
|
-
: null}
|
|
48
|
-
</ObjWrapper>
|
|
49
|
-
</AnimWrap>
|
|
50
|
-
</AnimWrap>
|
|
51
|
-
</SceneStyle>
|
|
52
|
-
);
|
|
53
|
-
}
|
package/src/components/index.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface AnimStylesProps {
|
|
2
|
-
children?: any;
|
|
3
|
-
animSpecs?: any;
|
|
4
|
-
}
|
|
5
|
-
export interface AnimSpecsType {
|
|
6
|
-
border?: string | undefined;
|
|
7
|
-
degreesHi?: number | undefined;
|
|
8
|
-
degreesLow?: number | undefined;
|
|
9
|
-
delay?: number | undefined;
|
|
10
|
-
direction?: string | undefined;
|
|
11
|
-
duration?: number | string | undefined;
|
|
12
|
-
fillMode?: string | undefined;
|
|
13
|
-
iterationCount?: number | string | undefined;
|
|
14
|
-
animationPlayState?: string;
|
|
15
|
-
name?: string | undefined;
|
|
16
|
-
timing?: string | undefined;
|
|
17
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { AnimStylesProps } from "./Anim";
|
|
3
|
-
import { allAnims } from "./Anims";
|
|
4
|
-
|
|
5
|
-
export const AnimWrap = (props: AnimStylesProps) => {
|
|
6
|
-
const { children, animSpecs } = props;
|
|
7
|
-
const AS: any = animSpecs;
|
|
8
|
-
|
|
9
|
-
const {
|
|
10
|
-
X360,
|
|
11
|
-
Y360,
|
|
12
|
-
fadeInkf,
|
|
13
|
-
wobY,
|
|
14
|
-
wobX,
|
|
15
|
-
fwdx018,
|
|
16
|
-
fwdx1836,
|
|
17
|
-
fwdx09,
|
|
18
|
-
fwdx918,
|
|
19
|
-
fwdx1827,
|
|
20
|
-
fwdx2736,
|
|
21
|
-
fwdy018,
|
|
22
|
-
fwdy1836,
|
|
23
|
-
fwdy09,
|
|
24
|
-
fwdy918,
|
|
25
|
-
fwdy1827,
|
|
26
|
-
fwdy2736,
|
|
27
|
-
floatX,
|
|
28
|
-
floatShadow,
|
|
29
|
-
pulseSM,
|
|
30
|
-
pulseMD,
|
|
31
|
-
pulseLG,
|
|
32
|
-
swing,
|
|
33
|
-
swingDecay,
|
|
34
|
-
noAnim,
|
|
35
|
-
} = allAnims({ degreesHi: AS.degreesHi, degreesLow: AS.degreesLow });
|
|
36
|
-
|
|
37
|
-
let theAnim: string | any = "noAnim";
|
|
38
|
-
|
|
39
|
-
if (AS.name === "X360") theAnim = X360;
|
|
40
|
-
else if (AS.name === "Y360") theAnim = Y360;
|
|
41
|
-
else if (AS.name === "fadeInkf") theAnim = fadeInkf;
|
|
42
|
-
else if (AS.name === "wobX") theAnim = wobX;
|
|
43
|
-
else if (AS.name === "wobY") theAnim = wobY;
|
|
44
|
-
else if (AS.name === "fwdx018") theAnim = fwdx018;
|
|
45
|
-
else if (AS.name === "fwdx1836") theAnim = fwdx1836;
|
|
46
|
-
else if (AS.name === "fwdx09") theAnim = fwdx09;
|
|
47
|
-
else if (AS.name === "fwdx918") theAnim = fwdx918;
|
|
48
|
-
else if (AS.name === "fwdx1827") theAnim = fwdx1827;
|
|
49
|
-
else if (AS.name === "fwdx2736") theAnim = fwdx2736;
|
|
50
|
-
else if (AS.name === "fwdy018") theAnim = fwdy018;
|
|
51
|
-
else if (AS.name === "fwdy1836") theAnim = fwdy1836;
|
|
52
|
-
else if (AS.name === "fwdy09") theAnim = fwdy09;
|
|
53
|
-
else if (AS.name === "fwdy918") theAnim = fwdy918;
|
|
54
|
-
else if (AS.name === "fwdy1827") theAnim = fwdy1827;
|
|
55
|
-
else if (AS.name === "fwdy2736") theAnim = fwdy2736;
|
|
56
|
-
else if (AS.name === "floatX") theAnim = floatX;
|
|
57
|
-
else if (AS.name === "floatShadow") theAnim = floatShadow;
|
|
58
|
-
else if (AS.name === "pulseSM") theAnim = pulseSM;
|
|
59
|
-
else if (AS.name === "pulseMD") theAnim = pulseMD;
|
|
60
|
-
else if (AS.name === "pulseLG") theAnim = pulseLG;
|
|
61
|
-
else if (AS.name === "swing") theAnim = swing;
|
|
62
|
-
else if (AS.name === "swingDecay") theAnim = swingDecay;
|
|
63
|
-
else theAnim = noAnim;
|
|
64
|
-
|
|
65
|
-
const AnimWrapDiv: any = styled.div`
|
|
66
|
-
width: 100%;
|
|
67
|
-
height: 100%;
|
|
68
|
-
position: relative;
|
|
69
|
-
transform-style: preserve-3d;
|
|
70
|
-
border: ${AS.border};
|
|
71
|
-
-webkit-animation-duration: ${AS.duration}s;
|
|
72
|
-
animation-duration: ${AS.duration}s;
|
|
73
|
-
-webkit-animation-iteration-count: ${AS.iterationCount};
|
|
74
|
-
animation-iteration-count: ${AS.iterationCount};
|
|
75
|
-
-webkit-animation-name: ${theAnim};
|
|
76
|
-
animation-name: ${theAnim};
|
|
77
|
-
-webkit-animation-fill-mode: ${AS.fillMode};
|
|
78
|
-
animation-fill-mode: ${AS.fillMode};
|
|
79
|
-
-webkit-animation-play-state: ${AS.animationPlayState};
|
|
80
|
-
animation-play-state: ${AS.animationPlayState};
|
|
81
|
-
animation-direction: ${AS.direction};
|
|
82
|
-
-webkit-animation-direction: ${AS.direction};
|
|
83
|
-
-webkit-animation-timing-function: ${AS.timing};
|
|
84
|
-
animation-timing-function: ${AS.timing};
|
|
85
|
-
-webkit-animation-delay: ${AS.delay}s;
|
|
86
|
-
animation-delay: ${AS.delay}s;
|
|
87
|
-
`;
|
|
88
|
-
|
|
89
|
-
return <AnimWrapDiv>{children}</AnimWrapDiv>;
|
|
90
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
interface ObjWrapperProps {
|
|
5
|
-
showCenterDiv?: boolean | string | number;
|
|
6
|
-
children?: any;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const ObjWrapper = (props: ObjWrapperProps): any => {
|
|
10
|
-
const { showCenterDiv = false, children = "" } = props;
|
|
11
|
-
|
|
12
|
-
const Wrapper: any = showCenterDiv
|
|
13
|
-
? styled.section`
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 100%;
|
|
16
|
-
position: relative;
|
|
17
|
-
transform-style: preserve-3d;
|
|
18
|
-
border: 1px solid #0f0;
|
|
19
|
-
`
|
|
20
|
-
: styled.section`
|
|
21
|
-
width: 100%;
|
|
22
|
-
height: 100%;
|
|
23
|
-
position: relative;
|
|
24
|
-
transform-style: preserve-3d;
|
|
25
|
-
`;
|
|
26
|
-
|
|
27
|
-
return <Wrapper>{children}</Wrapper>;
|
|
28
|
-
};
|
|
@@ -1,37 +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 {
|
|
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
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export interface FaceType {
|
|
2
|
-
name?: string;
|
|
3
|
-
css?: string | undefined;
|
|
4
|
-
body?: any;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export interface ObjProps {
|
|
8
|
-
anim1?: object | undefined;
|
|
9
|
-
anim2?: object | undefined;
|
|
10
|
-
children?: any;
|
|
11
|
-
depth?: number;
|
|
12
|
-
global?: { border?: string; bgc?: string; opac?: number | string } | any;
|
|
13
|
-
height?: number | string;
|
|
14
|
-
faces?: FaceType[];
|
|
15
|
-
perspective?: string | number | undefined;
|
|
16
|
-
perspectiveOrigin?: string | undefined;
|
|
17
|
-
showCenterDiv?: string | number | boolean | undefined;
|
|
18
|
-
tranz?: number | undefined;
|
|
19
|
-
txt?: string | any;
|
|
20
|
-
width?: number;
|
|
21
|
-
zIndex?: number | undefined;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface GlobalType {
|
|
25
|
-
css?: string;
|
|
26
|
-
body?: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface FaceProps {
|
|
30
|
-
children?: any;
|
|
31
|
-
depth?: number | any;
|
|
32
|
-
face: FaceType;
|
|
33
|
-
global?: any;
|
|
34
|
-
height?: number | string;
|
|
35
|
-
width?: number | string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface SpecsProps {
|
|
39
|
-
width: number;
|
|
40
|
-
height: number;
|
|
41
|
-
transform: string;
|
|
42
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"allowSyntheticDefaultImports": true,
|
|
4
|
-
"declaration": true,
|
|
5
|
-
"esModuleInterop": true,
|
|
6
|
-
"jsx": "react",
|
|
7
|
-
"lib": ["es5", "es2015", "es2016", "dom", "esnext"],
|
|
8
|
-
"types": ["node"],
|
|
9
|
-
"module": "es2015",
|
|
10
|
-
"moduleResolution": "node",
|
|
11
|
-
"noImplicitAny": true,
|
|
12
|
-
"outDir": "dist/esm",
|
|
13
|
-
"sourceMap": false,
|
|
14
|
-
"strict": true,
|
|
15
|
-
"target": "es6",
|
|
16
|
-
"noUnusedLocals": false,
|
|
17
|
-
"noUnusedParameters": false
|
|
18
|
-
},
|
|
19
|
-
"include": ["src/**/*.ts", "src/**/*.tsx"]
|
|
20
|
-
}
|
|
File without changes
|