anim-3d-obj 1.1.45 → 1.1.47
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/dist/esm/components/Face/index.d.ts +2 -2
- package/dist/esm/components/Face/index.js +3 -3
- package/dist/esm/components/Face/index.js.map +1 -1
- package/dist/esm/components/Ribbon.js +2 -2
- package/dist/esm/components/Ribbon.js.map +1 -1
- package/dist/esm/components/styles/Global.d.ts +6 -1
- package/dist/esm/components/styles/Global.js +18 -6
- package/dist/esm/components/styles/Global.js.map +1 -1
- package/package.json +3 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { FaceProps } from "./face";
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const _default: (props: FaceProps) => JSX.Element;
|
|
3
|
+
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
import React from "react";
|
|
3
|
-
|
|
3
|
+
export default (props) => {
|
|
4
4
|
let { depth = 10, faceType, global = {}, height = 10, custom = false, tranz = 80, width = 100, } = props;
|
|
5
5
|
let transform;
|
|
6
6
|
let styles = !!custom[faceType] && !!custom[faceType].css
|
|
@@ -52,7 +52,8 @@ const Face = (props) => {
|
|
|
52
52
|
if (!!depth)
|
|
53
53
|
tranz = +depth / 2;
|
|
54
54
|
let offset = depth / 2;
|
|
55
|
-
|
|
55
|
+
//translate3d(tx, ty, tz)
|
|
56
|
+
transform = `transform: rotateX(90deg) translateZ(${tranz}px) translateY(-${tranz * 2}px) `;
|
|
56
57
|
}
|
|
57
58
|
else {
|
|
58
59
|
if (height > width && !depth) {
|
|
@@ -79,5 +80,4 @@ const Face = (props) => {
|
|
|
79
80
|
`;
|
|
80
81
|
return React.createElement(Specs, null, body);
|
|
81
82
|
};
|
|
82
|
-
export default Face;
|
|
83
83
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Face/index.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Face/index.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAe,CAAC,KAAgB,EAAe,EAAE;IAC/C,IAAI,EACF,KAAK,GAAG,EAAE,EACV,QAAQ,EACR,MAAM,GAAG,EAAE,EACX,MAAM,GAAG,EAAE,EACX,MAAM,GAAG,KAAK,EACd,KAAK,GAAG,EAAE,EACV,KAAK,GAAG,GAAG,GACZ,GAAG,KAAK,CAAC;IAEV,IAAI,SAAS,CAAC;IACd,IAAI,MAAM,GACR,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG;QAC1C,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG;QACtB,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IACjB,MAAM,IAAI,GACR,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI;QAC3C,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI;QACvB,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;IAClB,IAAI,QAAQ,KAAK,QAAQ,EAAE;QACzB,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;QAC7B,MAAM,GAAG,CAAC,KAAK,CAAC;QAChB,SAAS,GAAG,yCAAyC,KAAK,MAAM,CAAC;QACjE,6CAA6C;KAC9C;SAAM,IAAI,QAAQ,KAAK,KAAK,EAAE;QAC7B,MAAM,GAAG,CAAC,KAAK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zB,SAAS,GAAG,wCAAwC,KAAK,mBACvD,KAAK,GAAG,CACV,OAAO,CAAC;KACT;SAAM;QACL,IAAI,MAAM,GAAG,KAAK,IAAI,CAAC,KAAK,EAAE;YAC5B,KAAK,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAChC,KAAK,GAAG,CAAC,MAAM,CAAC;SACjB;aAAM,IAAI,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE;YACnC,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;YACpB,MAAM,GAAG,CAAC,KAAK,CAAC;SACjB;aAAM;YACL,KAAK,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC;YACnB,KAAK,GAAG,CAAC,KAAK,CAAC;SAChB;QACD,SAAS,GAAG,yCAAyC,KAAK,MAAM,CAAC;KAClE;IAED,MAAM,QAAQ,GAAQ,MAAM,CAAC,OAAO,CAAA,EAAE,CAAC;IAEvC,MAAM,KAAK,GAAQ,MAAM,CAAC,OAAO,CAAA;MAC7B,MAAM;aACC,KAAK;;cAEJ,MAAM;MACd,SAAS;GACZ,CAAC;IAEF,OAAO,oBAAC,KAAK,QAAE,IAAI,CAAS,CAAC;AAC/B,CAAC,CAAC"}
|
|
@@ -3,14 +3,14 @@ import { SceneStyle } from "./styles/Scene";
|
|
|
3
3
|
import Face from "./Face";
|
|
4
4
|
import { ObjWrapper } from "./styles/Global";
|
|
5
5
|
export const Ribbon = (props) => {
|
|
6
|
-
let { anim1Specs, anim2Specs, width = 5, height = 5, depth = 5, faces, global = {}, custom = {}, tranz = (+height / 2) | 0, perspective, perspectiveOrigin, zIndex, } = props;
|
|
6
|
+
let { anim1Specs, anim2Specs, width = 5, height = 5, depth = 5, faces, global = {}, custom = {}, tranz = (+height / 2) | 0, perspective, perspectiveOrigin, zIndex, showCenterDiv = false, } = props;
|
|
7
7
|
const buildFace = (faceType) => {
|
|
8
8
|
return (React.createElement(Face, { width: width, height: height, depth: depth, faceType: faceType, id: faceType, tranz: tranz, global: global, custom: custom }));
|
|
9
9
|
};
|
|
10
10
|
return (React.createElement(SceneStyle, { width: width, height: height, perspective: perspective, perspectiveOrigin: perspectiveOrigin, zIndex: zIndex },
|
|
11
11
|
React.createElement(AnimWrap, { animSpecs: anim1Specs },
|
|
12
12
|
React.createElement(AnimWrap, { animSpecs: anim2Specs },
|
|
13
|
-
React.createElement(ObjWrapper,
|
|
13
|
+
React.createElement(ObjWrapper, { showCenterDiv: showCenterDiv },
|
|
14
14
|
!!faces && !!faces.bottom ? buildFace("bottom") : null,
|
|
15
15
|
!!faces && !!faces.back ? buildFace("back") : null,
|
|
16
16
|
!!faces && !!faces.top ? buildFace("topr") : null)))));
|
|
@@ -1 +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,QAAQ,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAe,EAAO,EAAE;IAC7C,IAAI,EACF,UAAU,EACV,UAAU,EACV,KAAK,GAAG,CAAC,EACT,MAAM,GAAG,CAAC,EACV,KAAK,GAAG,CAAC,EACT,KAAK,EACL,MAAM,GAAG,EAAE,EACX,MAAM,GAAG,EAAE,EACX,KAAK,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,EACzB,WAAW,EACX,iBAAiB,EACjB,MAAM,
|
|
1
|
+
{"version":3,"file":"Ribbon.js","sourceRoot":"","sources":["../../../src/components/Ribbon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,E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,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;oBAClD,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CACvC,CACJ,CACF,CACA,CACd,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
interface ObjWrapperProps {
|
|
2
|
+
showCenterDiv?: boolean | string | number;
|
|
3
|
+
children?: any;
|
|
4
|
+
}
|
|
5
|
+
export declare const ObjWrapper: (props: ObjWrapperProps) => any;
|
|
6
|
+
export {};
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
-
export const ObjWrapper =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
export const ObjWrapper = (props) => {
|
|
3
|
+
const { showCenterDiv = false, children = "" } = props;
|
|
4
|
+
const Wrapper = showCenterDiv
|
|
5
|
+
? styled.section `
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
position: relative;
|
|
9
|
+
transform-style: preserve-3d;
|
|
10
|
+
border: 1px solid #0f0;
|
|
11
|
+
`
|
|
12
|
+
: styled.section `
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
15
|
+
position: relative;
|
|
16
|
+
transform-style: preserve-3d;
|
|
17
|
+
`;
|
|
18
|
+
return React.createElement(Wrapper, null, children);
|
|
19
|
+
};
|
|
8
20
|
//# sourceMappingURL=Global.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Global.js","sourceRoot":"","sources":["../../../../src/components/styles/Global.
|
|
1
|
+
{"version":3,"file":"Global.js","sourceRoot":"","sources":["../../../../src/components/styles/Global.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAOvC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAsB,EAAO,EAAE;IACxD,MAAM,EAAE,aAAa,GAAG,KAAK,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,KAAK,CAAC;IAEvD,MAAM,OAAO,GAAQ,aAAa;QAChC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAA;;;;;;OAMb;QACH,CAAC,CAAC,MAAM,CAAC,OAAO,CAAA;;;;;OAKb,CAAC;IAEN,OAAO,oBAAC,OAAO,QAAE,QAAQ,CAAW,CAAC;AACvC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
|
|
7
|
+
|
|
6
8
|
{
|
|
7
9
|
"name": "anim-3d-obj",
|
|
8
10
|
"repository": {
|
|
@@ -10,7 +12,7 @@
|
|
|
10
12
|
"url": "https://github.com/mdnelles/anim-3d-objs"
|
|
11
13
|
},
|
|
12
14
|
"homepage": "https://github.com/mdnelles/anim-3d-objs",
|
|
13
|
-
"version": "1.1.
|
|
15
|
+
"version": "1.1.47",
|
|
14
16
|
"description": "React library for creating 3D objects quickly. Also these objects can be animated",
|
|
15
17
|
"main": "dist/cjs/index.js",
|
|
16
18
|
"module": "dist/esm/index.js",
|