hart-estate-widget 0.0.41 → 0.0.42
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 +16 -4
- package/build/assets/fonts/RobotoMono/RobotoMono-Bold.eot +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Bold.ttf +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Bold.woff +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Bold.woff2 +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-BoldItalic.eot +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-BoldItalic.ttf +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-BoldItalic.woff +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-BoldItalic.woff2 +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Italic.eot +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Italic.ttf +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Italic.woff +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Italic.woff2 +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Light.eot +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Light.ttf +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Light.woff +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Light.woff2 +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-LightItalic.eot +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-LightItalic.ttf +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-LightItalic.woff +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-LightItalic.woff2 +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Medium.eot +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Medium.ttf +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Medium.woff +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Medium.woff2 +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-MediumItalic.eot +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-MediumItalic.ttf +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-MediumItalic.woff +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-MediumItalic.woff2 +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Regular.eot +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Regular.ttf +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Regular.woff +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Regular.woff2 +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Thin.eot +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Thin.ttf +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Thin.woff +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono-Thin.woff2 +0 -0
- package/build/assets/fonts/RobotoMono/RobotoMono.css +108 -0
- package/build/assets/icons/1x.svg +4 -0
- package/build/assets/icons/2x.svg +4 -0
- package/build/assets/icons/bullet.png +0 -0
- package/build/assets/icons/close.svg +4 -0
- package/build/assets/icons/enter-fullscreen.svg +6 -0
- package/build/assets/icons/hand-move.svg +15 -0
- package/build/assets/icons/hand-research.svg +12 -0
- package/build/assets/icons/rotation-close.svg +6 -0
- package/build/assets/icons/rotation.svg +4 -0
- package/build/assets/img/logo.svg +11 -0
- package/build/assets/sass/components/instructions.sass +51 -33
- package/build/assets/sass/components/model.sass +1 -0
- package/build/assets/sass/components/panorama.sass +95 -31
- package/build/assets/sass/components/tabs.sass +90 -91
- package/build/assets/sass/index.sass +45 -2
- package/build/assets/sass/mixin.sass +12 -0
- package/build/assets/sass/vars.sass +4 -1
- package/build/components/Application.js +48 -71
- package/build/components/Buttons/FullScreenButton.js +46 -0
- package/build/components/Buttons/TabButton.js +26 -0
- package/build/components/Instructions.js +26 -15
- package/build/components/ModelTab.js +62 -39
- package/build/components/PanoramaTab.js +262 -161
- package/build/components/RotationTab.js +40 -10
- package/build/config/defaultConfig.js +5 -2
- package/build/enums/deviceOrientationStatus.js +11 -0
- package/build/enums/imageExtentions.js +21 -0
- package/build/index.css +1 -1
- package/build/index.css.map +1 -1
- package/build/index.js +4 -12
- package/build/store/fullScreenStore.js +54 -0
- package/build/store/index.js +17 -29
- package/build/utils/panoramaHelpers.js +45 -2
- package/package.json +4 -2
- package/build/components/TabPanes.js +0 -96
- package/build/components/TabWrapper.js +0 -42
@@ -17,87 +17,105 @@ var _modelHelpers = require("../utils/modelHelpers");
|
|
17
17
|
|
18
18
|
var _nipplejs = _interopRequireDefault(require("nipplejs"));
|
19
19
|
|
20
|
+
var _Instructions = _interopRequireDefault(require("./Instructions"));
|
21
|
+
|
22
|
+
var _handMove = _interopRequireDefault(require("../assets/icons/hand-move.svg"));
|
23
|
+
|
24
|
+
var _D = _interopRequireDefault(require("../assets/img/3D.jpg"));
|
25
|
+
|
20
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
21
27
|
|
22
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
23
29
|
|
24
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
25
31
|
|
32
|
+
const instructionSteps = [{
|
33
|
+
icon: _handMove.default,
|
34
|
+
text: 'Вращать планировку'
|
35
|
+
}];
|
26
36
|
const ModelTab = (0, _mobxReactLite.observer)(_ref => {
|
27
37
|
let {
|
28
|
-
json
|
38
|
+
json,
|
39
|
+
disabled
|
29
40
|
} = _ref;
|
41
|
+
const [showInstructions, setInstructionsState] = (0, _react.useState)(true);
|
30
42
|
const [menuState, setMenuState] = (0, _react.useState)(false);
|
31
43
|
const {
|
32
44
|
houseStore
|
33
45
|
} = _modelStore.default;
|
34
|
-
(0, _react.useEffect)(() => {
|
35
|
-
const container = document.querySelector('.widget-tab__model-scene');
|
36
|
-
|
37
|
-
_modelStore.default.setContainer(container);
|
38
|
-
|
39
|
-
container.appendChild(_modelStore.default.renderer.domElement);
|
40
46
|
|
41
|
-
|
47
|
+
const getNextWallsMaterialType = () => {
|
48
|
+
if (houseStore.wallsMaterialType === 'texture') return 'color';
|
49
|
+
return 'texture';
|
50
|
+
};
|
42
51
|
|
43
|
-
|
44
|
-
|
52
|
+
const onImageUploaded = _ref2 => {
|
53
|
+
let {
|
54
|
+
target
|
55
|
+
} = _ref2;
|
56
|
+
if (!target.files.length) return;
|
57
|
+
const reader = new FileReader();
|
45
58
|
|
46
|
-
|
59
|
+
reader.onload = e => houseStore.addWallTexture(e.target.result);
|
47
60
|
|
48
|
-
|
61
|
+
reader.readAsDataURL(target.files[0]);
|
62
|
+
};
|
49
63
|
|
50
|
-
|
51
|
-
|
64
|
+
const initJoystick = () => {
|
65
|
+
const zone = document.querySelector('.widget-tab__model-joystick');
|
52
66
|
|
53
|
-
_modelStore.default.init(json);
|
54
|
-
}, [json]);
|
55
|
-
(0, _react.useEffect)(() => {
|
56
67
|
const joystick = _nipplejs.default.create({
|
57
|
-
zone
|
58
|
-
color: '#F4C833',
|
59
|
-
mode: 'static',
|
68
|
+
zone,
|
60
69
|
position: {
|
61
70
|
left: '50%',
|
62
71
|
top: '50%'
|
63
|
-
}
|
72
|
+
},
|
73
|
+
color: '#F4C833',
|
74
|
+
mode: 'static'
|
64
75
|
});
|
65
76
|
|
66
77
|
joystick.on('start', () => _modelStore.default.setJoystickState(true));
|
67
78
|
joystick.on('end', () => _modelStore.default.setJoystickState(false));
|
68
|
-
joystick.on('move', (_,
|
79
|
+
joystick.on('move', (_, _ref3) => {
|
69
80
|
let {
|
70
81
|
angle
|
71
|
-
} =
|
82
|
+
} = _ref3;
|
72
83
|
const directions = (0, _modelHelpers.getDirectionsFromDegrees)(angle.degree);
|
73
84
|
|
74
85
|
_modelStore.default.setJoystickDirections(directions);
|
75
86
|
});
|
76
|
-
}, []);
|
77
|
-
|
78
|
-
const getNextWallsMaterialType = () => {
|
79
|
-
if (houseStore.wallsMaterialType === 'texture') return 'color';
|
80
|
-
return 'texture';
|
81
87
|
};
|
82
88
|
|
83
|
-
const
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
if (!target.files.length) return;
|
88
|
-
const reader = new FileReader();
|
89
|
+
const onStart = () => {
|
90
|
+
setInstructionsState(false);
|
91
|
+
initJoystick();
|
92
|
+
const container = document.querySelector('.widget-tab__model-scene');
|
89
93
|
|
90
|
-
|
94
|
+
_modelStore.default.setContainer(container);
|
91
95
|
|
92
|
-
|
96
|
+
container.appendChild(_modelStore.default.renderer.domElement);
|
97
|
+
|
98
|
+
_modelStore.default.setCurrentControlsType('orbit');
|
99
|
+
|
100
|
+
if (_modelStore.default.initialized) {
|
101
|
+
_modelStore.default.houseStore.setDoorsVisibility(true);
|
102
|
+
|
103
|
+
_modelStore.default.houseStore.setFullBuildingVisibility(true);
|
104
|
+
|
105
|
+
_modelStore.default.houseStore.setCurrentWallsMaterialType('texture');
|
106
|
+
|
107
|
+
return;
|
108
|
+
}
|
109
|
+
|
110
|
+
_modelStore.default.init(json);
|
93
111
|
};
|
94
112
|
|
95
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
113
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
96
114
|
className: "widget-tab__model"
|
97
115
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
98
116
|
className: "widget-tab__model-scene"
|
99
117
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
100
|
-
className: "widget-tab__model-joystick \n
|
118
|
+
className: "widget-tab__model-joystick \n ".concat(_modelStore.default.currentControlsType === 'wasd' ? 'widget-tab__model-joystick--active' : '')
|
101
119
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
102
120
|
className: "widget-tab-menu"
|
103
121
|
}, /*#__PURE__*/_react.default.createElement("ul", null, /*#__PURE__*/_react.default.createElement("li", {
|
@@ -147,7 +165,12 @@ const ModelTab = (0, _mobxReactLite.observer)(_ref => {
|
|
147
165
|
onChange: onImageUploaded,
|
148
166
|
type: "file",
|
149
167
|
accept: ".jpg, .jpeg, .png"
|
150
|
-
})))))))
|
168
|
+
}))))))), showInstructions && /*#__PURE__*/_react.default.createElement(_Instructions.default, {
|
169
|
+
disabled: disabled,
|
170
|
+
steps: instructionSteps,
|
171
|
+
onClick: onStart,
|
172
|
+
background: _D.default
|
173
|
+
}));
|
151
174
|
});
|
152
175
|
var _default = ModelTab;
|
153
176
|
exports.default = _default;
|