hart-estate-widget 0.0.51 → 0.0.54
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/build/assets/css/app.css +1 -1
- package/build/assets/css/app.css.map +1 -1
- package/build/assets/sass/components/instructions.sass +1 -1
- package/build/assets/sass/components/panorama.sass +38 -33
- package/build/assets/sass/components/tabs.sass +8 -7
- package/build/assets/sass/index.sass +2 -2
- package/build/components/Application.js +4 -18
- package/build/components/Instructions.js +3 -1
- package/build/components/ModelTab.js +17 -15
- package/build/components/PanoramaTab.js +152 -81
- package/build/components/RotationTab.js +13 -9
- package/build/components/Widget.js +7 -1
- package/build/config/defaultConfig.js +1 -0
- package/build/enums/deviceOrientationStatuses.js +11 -0
- package/build/enums/deviceWidth.js +11 -0
- package/build/locale/en_US/data.json +24 -0
- package/build/locale/index.js +71 -0
- package/build/locale/ru_RU/data.json +24 -0
- package/build/store/fullScreenStore.js +2 -2
- package/build/threesixty/events.js +3 -1
- package/build/utils/helpers.js +12 -0
- package/build/utils/panoramaHelpers.js +8 -8
- package/package.json +4 -1
- package/build/enums/deviceOrientationStatus.js +0 -11
package/build/assets/css/app.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
*,*:before,*:after{box-sizing:border-box;-webkit-box-sizing:border-box;margin:0;padding:0}html,body{font-size:20px}.widget-application{--vh: 100vh;width:100%;height:calc(100*var(--vh));overflow:hidden;position:relative;z-index:1;background-color:#fff}.widget-application *,.widget-application *:before,.widget-application *:after{font-family:"Roboto Mono",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;outline:none;font-weight:700;text-decoration:none;color:#413e3e}.widget-application .widget-logo{position:absolute;left:45px;top:30px;z-index:3}@media only screen and (max-width: 545px){.widget-application .widget-logo{left:20px;top:20px}}.widget-application .widget-logo img{display:block;width:82px;height:82px;object-fit:contain;object-position:center}@media only screen and (max-width: 900px){.widget-application .widget-logo img{width:65px;height:65px}}.widget-application .widget-enter-fullscreen,.widget-application .widget-exit-fullscreen{position:absolute;right:45px;top:36px;z-index:3;ouline:none;border:none;box-shadow:none;background:rgba(0,0,0,0);cursor:pointer;padding:10px}@media only screen and (max-width: 545px){.widget-application .widget-enter-fullscreen,.widget-application .widget-exit-fullscreen{right:20px;top:20px}}.widget-application .widget-enter-fullscreen img,.widget-application .widget-exit-fullscreen img{display:block;width:50px;height:50px;object-fit:contain;object-position:center}@media only screen and (max-width: 900px){.widget-application .widget-enter-fullscreen img,.widget-application .widget-exit-fullscreen img{width:40px;height:40px}}.widget-application .widget-close{position:absolute;display:flex;align-items:center;justify-content:center;z-index:3;right:15px;top:15px;color:#000;background-color:#fac62d;padding:5px 15px;border-radius:10px;font-size:.8rem;border:none;cursor:pointer}.widget-application .widget-close:hover{box-shadow:1px 1px 10px rgba(0,0,0,.15)}.widget-application .widget-tab-buttons{position:absolute;z-index:3;right:44px;bottom:35px;display:flex;align-items:center;justify-content:flex-end}@media only screen and (max-width: 545px){.widget-application .widget-tab-buttons{right:20px;bottom:20px}}.widget-application .widget-tab-button{ouline:none;border:none;box-shadow:none;background:rgba(0,0,0,0);cursor:pointer;width:72px;height:72px;border-radius:50%;display:flex;align-items:center;justify-content:center;background-color:#eaeaea;color:#413e3e;font-size:28px;line-height:120%;font-weight:bold;margin-left:40px}@media only screen and (max-width: 900px){.widget-application .widget-tab-button{width:60px;height:60px;font-size:24px;margin-left:20px}}@media only screen and (max-width: 545px){.widget-application .widget-tab-button{margin-left:10px}}.widget-application .widget-tab-button--active{background-color:#fac62d}.widget-application .widget-tab{width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:60px 30px}@media(max-width: 630px){.widget-application .widget-tab{padding:60px 15px}}.widget-application .widget-tab__image{max-width:100%;max-height:100%;object-fit:contain;display:block}.widget-application .widget-tab__threesixty{width:100%;height:100%;touch-action:none;-webkit-touch-action:none}.widget-application .widget-tab__threesixty-start{ouline:none;border:none;box-shadow:none;background:rgba(0,0,0,0);cursor:pointer;position:absolute;left:50%;bottom:35px;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;padding:0 30px 0 27px;background-color:#eaeaea;border-radius:38px;height:72px}@media only screen and (max-width: 900px){.widget-application .widget-tab__threesixty-start{height:60px;width:60px;padding:0;left:45px;transform:none}}@media only screen and (max-width: 545px){.widget-application .widget-tab__threesixty-start{left:20px;bottom:20px}}.widget-application .widget-tab__threesixty-start img{display:block;margin-right:20px;position:relative;top:2px}@media only screen and (max-width: 900px){.widget-application .widget-tab__threesixty-start img{width:30px;margin-right:0}}.widget-application .widget-tab__threesixty-start span{font-size:24px;font-weight:bold;color:#413e3e;text-transform:uppercase}@media only screen and (max-width: 900px){.widget-application .widget-tab__threesixty-start span{display:none}}.widget-application .widget-tab__threesixty-container{width:100% !important;height:100% !important;position:relative;background-image:none !important}.widget-application .widget-tab__threesixty-container img{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);max-width:100%;max-height:100%;width:600px;height:600px;object-fit:contain;opacity:0;user-select:none;-webkit-user-select:none;user-drag:none;-webkit-user-drag:none}.widget-application .widget-tab__threesixty-container img.active{opacity:1}.widget-application .widget-tab__threesixty--active .widget-tab__threesixty-container{cursor:move}.widget-application .widget-tab-menu{position:absolute;z-index:3;left:15px;top:15px;max-height:100%;overflow-y:auto;padding-bottom:30px}.widget-application .widget-tab-menu__wallpapers{display:flex;flex-wrap:wrap;align-items:flex-start;margin-top:10px;width:100%}.widget-application .widget-tab-menu__wallpapers img{width:30px;height:30px;display:block;object-fit:cover;cursor:pointer;margin-right:10px;margin-block-end:10px}.widget-application .widget-tab-menu ul{list-style-type:none}.widget-application .widget-tab-menu ul li{color:#000;background-color:#fac62d;padding:5px 15px;border-radius:10px;font-size:.7rem;border:none;cursor:pointer;margin-bottom:15px;width:200px;user-select:none;-webkit-user-select:none;user-drag:none;-webkit-user-drag:none}.widget-application .widget-tab-menu ul li label{display:flex;cursor:inherit;width:100%}.widget-application .widget-tab-menu ul li input[type=color]{cursor:pointer;margin-left:auto;width:50px;height:20px;border:0;border-radius:5px}.widget-application .widget-tab-menu ul li input[type=color]::-webkit-color-swatch-wrapper{display:none !important}.widget-application .widget-tab-menu ul li input[type=file]{display:none}.widget-application .widget-tab-menu ul li:nth-child(1){position:relative}.widget-application .widget-tab-menu ul li:nth-child(1)::after{--bar-width: 2px;content:"";width:20px;height:15px;display:block;background:repeating-linear-gradient(180deg, #000000, #000000 var(--bar-width), rgba(0, 0, 0, 0) var(--bar-width), rgba(0, 0, 0, 0) calc(var(--bar-width) * 3));position:absolute;right:10px;top:50%;transform:translateY(-50%)}.widget-application .widget-instructions{position:absolute;z-index:2;left:0;top:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-position:center;background-repeat:no-repeat;background-size:cover}.widget-application .widget-instructions__content{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;background-color:rgba(234,234,234,.85);border-radius:20px;overflow:hidden;width:400px;max-width:calc(100% - 60px);padding:36px 30px 30px 30px;backdrop-filter:blur(5px);-moz-backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}.widget-application .widget-instructions__steps{display:flex;align-items:flex-start;justify-content:center}.widget-application .widget-instructions__step{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;margin:0 15px}@media only screen and (max-width: 900px){.widget-application .widget-instructions__step{margin:0 10px}}.widget-application .widget-instructions__step img{display:block;width:52px;height:80px;object-fit:contain;object-position:center}.widget-application .widget-instructions__step p{color:#413e3e;font-size:20px;font-weight:bold;text-align:center;margin-top:10px;max-width:135px}@media only screen and (max-width: 900px){.widget-application .widget-instructions__step p{font-size:18px}}.widget-application .widget-instructions button{ouline:none;border:none;box-shadow:none;background:rgba(0,0,0,0);cursor:pointer;display:flex;align-items:center;justify-content:center;height:44px;padding:0 33px;border-radius:52px;background-color:#fac62d;color:#413e3e;font-size:24px;font-weight:bold;text-transform:uppercase;margin:25px auto 0 auto}.widget-application .widget-tab__panorama{width:100%;height:100%;position:absolute;left:0;top:0;z-index:2}.widget-application .widget-tab__panorama-overlay{width:100%;height:100%;overflow:hidden;background:#fff !important}.widget-application .widget-tab__panorama-controls{position:absolute;left:50%;bottom:35px;display:flex;align-items:center;justify-content:center;padding:8px;border-radius:38px;background-color:rgba(0,0,0,.2);transform:translateX(-50%);backdrop-filter:blur(5px);-moz-backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}@media only screen and (max-width: 900px){.widget-application .widget-tab__panorama-controls{right:45px;left:unset;transform:none;bottom:120px}}@media only screen and (max-width: 545px){.widget-application .widget-tab__panorama-controls{right:20px;bottom:100px}}.widget-application .widget-tab__panorama-controls-button{ouline:none;border:none;box-shadow:none;background:rgba(0,0,0,0);cursor:pointer;width:55px;height:55px;border-radius:50%;background-color:#fff;display:flex;align-items:center;justify-content:center;margin-right:18px}@media only screen and (max-width: 900px){.widget-application .widget-tab__panorama-controls-button{width:40px;height:40px}}.widget-application .widget-tab__panorama-controls-button img{display:block}@media only screen and (max-width: 900px){.widget-application .widget-tab__panorama-controls-button img{transform:scale(0.7)}}.widget-application .widget-tab__panorama-controls-button:nth-last-child(1){margin-right:0}.widget-application .widget-tab__panorama-map{position:absolute;left:45px;bottom:35px;z-index:3;border-radius:10px;opacity:1;transition:opacity .5s;overflow:hidden}@media only screen and (max-width: 545px){.widget-application .widget-tab__panorama-map{left:20px;bottom:20px}}.widget-application .widget-tab__panorama-map--hidden{opacity:0;pointer-events:none}.widget-application .widget-tab__panorama-map img{width:195px;border-radius:inherit;display:block;user-select:none;-webkit-user-select:none;user-drag:none;-webkit-user-drag:none}@media only screen and (max-width: 900px){.widget-application .widget-tab__panorama-map img{width:150px}}.widget-application .widget-tab__panorama-map img:hover{box-shadow:1px 1px 10px rgba(0,0,0,.15)}.widget-application .widget-tab__panorama-map svg{position:absolute;left:0;top:0;width:195px;height:100%;z-index:3;display:block;border-radius:inherit}@media only screen and (max-width: 900px){.widget-application .widget-tab__panorama-map svg{width:150px}}.widget-application .widget-tab__panorama-map svg polygon{opacity:0;fill:#fac62d;cursor:pointer}.widget-application .widget-tab__panorama-map svg polygon:hover{opacity:.3}.widget-application .widget-tab__panorama-map__fov{position:absolute;left:0;top:0;width:0px;height:0px;border-radius:50%;border:30px solid rgba(0,0,0,0);border-top:40px solid rgba(250,198,45,.4);transform:translate(-50%, -50%) rotate(0rad);transform-origin:50% 50%;z-index:4;pointer-events:none}.widget-application .widget-tab__panorama-map__dot{position:absolute;left:0;top:0;transform:translate(-50%, -50%);width:5px;height:5px;background-color:#fac62d;border-radius:50%;z-index:5;visibility:hidden;pointer-events:none}.widget-application .widget-tab__panorama-map__dot--big{border:2px solid #fac62d;box-shadow:inset 0 0 0 2px #fff;width:15px;height:15px}.widget-application .widget-tab__panorama-map__dot--active{visibility:visible}.widget-loader{display:block;position:relative;width:80px;height:80px}.widget-loader--absolute{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.widget-loader--sm{transform:translate(-50%, -50%) scale(0.75)}.widget-loader div{position:absolute;top:33px;width:13px;height:13px;border-radius:50%;background:#fac62d;animation-timing-function:cubic-bezier(0, 1, 1, 0)}.widget-loader div:nth-child(1){left:8px;animation:widget-loader-1 .6s infinite}.widget-loader div:nth-child(2){left:8px;animation:widget-loader-2 .6s infinite}.widget-loader div:nth-child(3){left:32px;animation:widget-loader-2 .6s infinite}.widget-loader div:nth-child(4){left:56px;animation:widget-loader-3 .6s infinite}@keyframes widget-loader-1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes widget-loader-3{0%{transform:scale(1)}100%{transform:scale(0)}}@keyframes widget-loader-2{0%{transform:translate(0, 0)}100%{transform:translate(24px, 0)}}.widget-application .widget-tab__model{width:100%;height:100%;position:absolute;left:0;top:0;z-index:2}.widget-application .widget-tab__model-scene{width:100%;height:100%;display:block}.widget-application .widget-tab__model-joystick{position:absolute;left:100px;bottom:100px;opacity:0;pointer-events:none}@media only screen and (max-width: 545px){.widget-application .widget-tab__model-joystick{left:50%;transform:translateX(-50%)}}.widget-application .widget-tab__model-joystick--active{opacity:1;pointer-events:unset}/*# sourceMappingURL=app.css.map */
|
1
|
+
*,*:before,*:after{box-sizing:border-box;-webkit-box-sizing:border-box;margin:0;padding:0}html,body{font-size:20px}.widget-application{--vh: 100vh;width:100%;height:calc(100*var(--vh));overflow:hidden;position:relative;z-index:1;background-color:#fff}.widget-application *,.widget-application *:before,.widget-application *:after{font-family:"Roboto Mono",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;outline:none;font-weight:700;text-decoration:none;color:#413e3e}.widget-application .widget-logo{position:absolute;left:45px;top:30px;z-index:3}@media only screen and (max-width: 900px){.widget-application .widget-logo{left:20px;top:20px}}.widget-application .widget-logo img{display:block;width:82px;height:82px;object-fit:contain;object-position:center}@media only screen and (max-width: 900px){.widget-application .widget-logo img{width:65px;height:65px}}.widget-application .widget-enter-fullscreen,.widget-application .widget-exit-fullscreen{position:absolute;right:45px;top:36px;z-index:3;ouline:none;border:none;box-shadow:none;background:rgba(0,0,0,0);cursor:pointer;padding:10px}@media only screen and (max-width: 900px){.widget-application .widget-enter-fullscreen,.widget-application .widget-exit-fullscreen{right:20px;top:20px}}.widget-application .widget-enter-fullscreen img,.widget-application .widget-exit-fullscreen img{display:block;width:50px;height:50px;object-fit:contain;object-position:center}@media only screen and (max-width: 900px){.widget-application .widget-enter-fullscreen img,.widget-application .widget-exit-fullscreen img{width:40px;height:40px}}.widget-application .widget-close{position:absolute;display:flex;align-items:center;justify-content:center;z-index:3;right:15px;top:15px;color:#000;background-color:#fac62d;padding:5px 15px;border-radius:10px;font-size:.8rem;border:none;cursor:pointer}.widget-application .widget-close:hover{box-shadow:1px 1px 10px rgba(0,0,0,.15)}.widget-application .widget-tab-buttons{position:absolute;z-index:3;right:44px;bottom:35px;display:flex;align-items:center;justify-content:flex-end}@media only screen and (max-width: 900px){.widget-application .widget-tab-buttons{flex-direction:column;right:20px;bottom:20px}}.widget-application .widget-tab-button{ouline:none;border:none;box-shadow:none;background:rgba(0,0,0,0);cursor:pointer;width:72px;height:72px;border-radius:50%;display:flex;align-items:center;justify-content:center;background-color:#eaeaea;color:#413e3e;font-size:28px;line-height:120%;font-weight:bold;margin-left:40px}@media only screen and (max-width: 900px){.widget-application .widget-tab-button{width:60px;height:60px;font-size:24px;margin-left:0px;margin-top:20px}}@media only screen and (max-width: 545px){.widget-application .widget-tab-button{margin-top:10px}}.widget-application .widget-tab-button--active{background-color:#fac62d}.widget-application .widget-tab{width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:60px 30px}@media(max-width: 630px){.widget-application .widget-tab{padding:60px 15px}}.widget-application .widget-tab__image{max-width:100%;max-height:100%;object-fit:contain;display:block}.widget-application .widget-tab__threesixty{width:100%;height:100%;touch-action:none;-webkit-touch-action:none}.widget-application .widget-tab__threesixty-start{ouline:none;border:none;box-shadow:none;background:rgba(0,0,0,0);cursor:pointer;position:absolute;left:50%;bottom:35px;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;padding:0 30px 0 27px;background-color:#eaeaea;border-radius:38px;height:72px}@media only screen and (max-width: 900px){.widget-application .widget-tab__threesixty-start{height:60px;width:60px;padding:0;left:20px;bottom:20px;transform:none}}.widget-application .widget-tab__threesixty-start img{display:block;margin-right:20px;position:relative;top:2px}@media only screen and (max-width: 900px){.widget-application .widget-tab__threesixty-start img{width:30px;margin-right:0}}.widget-application .widget-tab__threesixty-start span{font-size:24px;font-weight:bold;color:#413e3e;text-transform:uppercase}@media only screen and (max-width: 900px){.widget-application .widget-tab__threesixty-start span{display:none}}.widget-application .widget-tab__threesixty-container{width:100% !important;height:100% !important;position:relative;background-image:none !important}.widget-application .widget-tab__threesixty-container img{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);max-width:100%;max-height:100%;width:600px;height:600px;object-fit:contain;opacity:0;pointer-events:none;user-select:none;-webkit-user-select:none;user-drag:none;-webkit-user-drag:none}.widget-application .widget-tab__threesixty-container img.active{opacity:1}.widget-application .widget-tab__threesixty--active .widget-tab__threesixty-container{cursor:move}.widget-application .widget-tab-menu{position:absolute;z-index:3;left:15px;top:15px;max-height:100%;overflow-y:auto;padding-bottom:30px}.widget-application .widget-tab-menu__wallpapers{display:flex;flex-wrap:wrap;align-items:flex-start;margin-top:10px;width:100%}.widget-application .widget-tab-menu__wallpapers img{width:30px;height:30px;display:block;object-fit:cover;cursor:pointer;margin-right:10px;margin-block-end:10px}.widget-application .widget-tab-menu ul{list-style-type:none}.widget-application .widget-tab-menu ul li{color:#413e3e;background-color:#fac62d;padding:5px 15px;border-radius:10px;font-size:.7rem;border:none;cursor:pointer;margin-bottom:15px;width:200px;user-select:none;-webkit-user-select:none;user-drag:none;-webkit-user-drag:none}.widget-application .widget-tab-menu ul li label{display:flex;cursor:inherit;width:100%}.widget-application .widget-tab-menu ul li input[type=color]{cursor:pointer;margin-left:auto;width:50px;height:20px;border:0;border-radius:5px}.widget-application .widget-tab-menu ul li input[type=color]::-webkit-color-swatch-wrapper{display:none !important}.widget-application .widget-tab-menu ul li input[type=file]{display:none}.widget-application .widget-tab-menu ul li:nth-child(1){position:relative}.widget-application .widget-tab-menu ul li:nth-child(1)::after{--bar-width: 2px;content:"";width:20px;height:15px;display:block;background:repeating-linear-gradient(180deg, #000000, #000000 var(--bar-width), rgba(0, 0, 0, 0) var(--bar-width), rgba(0, 0, 0, 0) calc(var(--bar-width) * 3));position:absolute;right:10px;top:50%;transform:translateY(-50%)}.widget-application .widget-instructions{position:absolute;z-index:2;left:0;top:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-position:center;background-repeat:no-repeat;background-size:cover}.widget-application .widget-instructions__content{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;background-color:rgba(234,234,234,.85);border-radius:20px;overflow:hidden;width:400px;max-width:calc(100% - 60px);padding:36px 30px 30px 30px;backdrop-filter:blur(5px);-moz-backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}.widget-application .widget-instructions__steps{display:flex;align-items:flex-start;justify-content:center}.widget-application .widget-instructions__step{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;margin:0 15px}@media only screen and (max-width: 900px){.widget-application .widget-instructions__step{margin:0 10px}}.widget-application .widget-instructions__step img{display:block;width:52px;height:80px;object-fit:contain;object-position:center}.widget-application .widget-instructions__step p{color:#413e3e;font-size:20px;font-weight:bold;text-align:center;margin-top:10px;max-width:130px}@media only screen and (max-width: 900px){.widget-application .widget-instructions__step p{font-size:18px}}.widget-application .widget-instructions button{ouline:none;border:none;box-shadow:none;background:rgba(0,0,0,0);cursor:pointer;display:flex;align-items:center;justify-content:center;height:44px;padding:0 33px;border-radius:52px;background-color:#fac62d;color:#413e3e;font-size:24px;font-weight:bold;text-transform:uppercase;margin:25px auto 0 auto}.widget-application .widget-tab__panorama{width:100%;height:100%;position:absolute;left:0;top:0;z-index:2}.widget-application .widget-tab__panorama-overlay{width:100%;height:100%;overflow:hidden;background:#fff !important}.widget-application .widget-tab__panorama-overlay *{display:none !important}.widget-application .widget-tab__panorama-overlay canvas{display:block !important}.widget-application .widget-tab__panorama-controls{position:absolute;z-index:2;left:50%;bottom:35px;display:flex;align-items:center;justify-content:center;padding:8px;border-radius:38px;background-color:rgba(0,0,0,.2);transform:translateX(-50%);backdrop-filter:blur(5px);-moz-backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px)}@media only screen and (max-width: 900px){.widget-application .widget-tab__panorama-controls{bottom:20px}}.widget-application .widget-tab__panorama-controls-button{ouline:none;border:none;box-shadow:none;background:rgba(0,0,0,0);cursor:pointer;width:55px;height:55px;border-radius:50%;background-color:#fff;display:flex;align-items:center;justify-content:center;margin-right:18px}@media only screen and (max-width: 900px){.widget-application .widget-tab__panorama-controls-button{width:40px;height:40px}}@media only screen and (max-width: 545px){.widget-application .widget-tab__panorama-controls-button{margin-right:13px}}.widget-application .widget-tab__panorama-controls-button img{display:block}@media only screen and (max-width: 900px){.widget-application .widget-tab__panorama-controls-button img{transform:scale(0.7)}}.widget-application .widget-tab__panorama-controls-button:nth-last-child(1){margin-right:0}.widget-application .widget-tab__panorama-map{position:absolute;left:45px;bottom:35px;z-index:3;border-radius:10px;border:8px solid #fff;background-color:#fff;opacity:1;transition:opacity .5s}@media only screen and (max-width: 900px){.widget-application .widget-tab__panorama-map{left:20px;bottom:20px;transform:scale(0.6);transform-origin:0% 100%}.widget-application .widget-tab__panorama-map svg polygon{opacity:0}.widget-application .widget-tab__panorama-map--scaled{transform:scale(1) !important}.widget-application .widget-tab__panorama-map--scaled svg polygon:active{opacity:.3 !important}}@media only screen and (max-width: 545px){.widget-application .widget-tab__panorama-map{transform:scale(0.4)}}.widget-application .widget-tab__panorama-map--hidden{opacity:0;pointer-events:none}.widget-application .widget-tab__panorama-map img{width:195px;border-radius:none;display:block;user-select:none;-webkit-user-select:none;user-drag:none;-webkit-user-drag:none}.widget-application .widget-tab__panorama-map img:hover{box-shadow:1px 1px 10px rgba(0,0,0,.15)}.widget-application .widget-tab__panorama-map svg{position:absolute;left:0;top:0;width:195px;height:100%;z-index:3;display:block;border-radius:inherit}.widget-application .widget-tab__panorama-map svg polygon{opacity:0;fill:#fac62d;cursor:pointer}.widget-application .widget-tab__panorama-map svg polygon:hover{opacity:.3}@media only screen and (max-width: 900px){.widget-application .widget-tab__panorama-map svg polygon:hover{opacity:0}}.widget-application .widget-tab__panorama-map__fov{position:absolute;left:0;top:0;width:0px;height:0px;border-radius:50%;border:30px solid rgba(0,0,0,0);border-top:40px solid rgba(250,198,45,.4);transform:translate(-50%, -50%) rotate(0rad);transform-origin:50% 50%;z-index:4;pointer-events:none}.widget-application .widget-tab__panorama-map__fov::before{content:"";position:absolute;z-index:5;left:50%;top:50%;transform:translate(-50%, -50%) translateY(-5px);width:15px;height:15px;background-color:#fac62d;border-radius:50%;border:2px solid #fac62d;box-shadow:inset 0 0 0 2px #fff}.widget-loader{display:block;position:relative;width:80px;height:80px}.widget-loader--absolute{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.widget-loader--sm{transform:translate(-50%, -50%) scale(0.75)}.widget-loader div{position:absolute;top:33px;width:13px;height:13px;border-radius:50%;background:#fac62d;animation-timing-function:cubic-bezier(0, 1, 1, 0)}.widget-loader div:nth-child(1){left:8px;animation:widget-loader-1 .6s infinite}.widget-loader div:nth-child(2){left:8px;animation:widget-loader-2 .6s infinite}.widget-loader div:nth-child(3){left:32px;animation:widget-loader-2 .6s infinite}.widget-loader div:nth-child(4){left:56px;animation:widget-loader-3 .6s infinite}@keyframes widget-loader-1{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes widget-loader-3{0%{transform:scale(1)}100%{transform:scale(0)}}@keyframes widget-loader-2{0%{transform:translate(0, 0)}100%{transform:translate(24px, 0)}}.widget-application .widget-tab__model{width:100%;height:100%;position:absolute;left:0;top:0;z-index:2}.widget-application .widget-tab__model-scene{width:100%;height:100%;display:block}.widget-application .widget-tab__model-joystick{position:absolute;left:100px;bottom:100px;opacity:0;pointer-events:none}@media only screen and (max-width: 545px){.widget-application .widget-tab__model-joystick{left:50%;transform:translateX(-50%)}}.widget-application .widget-tab__model-joystick--active{opacity:1;pointer-events:unset}/*# sourceMappingURL=app.css.map */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../../../src/assets/sass/index.sass","../../../src/assets/sass/vars.sass","../../../src/assets/sass/mixin.sass","../../../src/assets/sass/components/tabs.sass","../../../src/assets/sass/components/instructions.sass","../../../src/assets/sass/components/panorama.sass","../../../src/assets/sass/components/loader.sass","../../../src/assets/sass/components/model.sass"],"names":[],"mappings":"AAGA,mBACE,sBACA,8BACA,SACA,UAEF,UACE,eAEF,oBACE,YAEA,WACA,2BACA,gBACA,kBACA,UACA,iBCfM,KDiBN,+EACE,qCACA,mCACA,kCACA,aACA,gBACA,qBACA,MClBQ,QDoBV,iCACE,kBACA,UACA,SACA,UACA,0CALF,iCAMI,UACA,UACF,qCACE,cACA,WACA,YACA,mBACA,uBACA,0CANF,qCAOI,WACA,aAEN,yFAEE,kBACA,WACA,SACA,UErDF,YACA,YACA,gBACA,yBACA,eFmDE,aACA,0CARF,yFASI,WACA,UACF,iGACE,cACA,WACA,YACA,mBACA,uBACA,0CANF,iGAOI,WACA,aAEN,kCACE,kBACA,aACA,mBACA,uBACA,UACA,WACA,SACA,MCxEI,KDyEJ,iBCtEQ,QDuER,iBACA,mBACA,gBACA,YACA,eACA,wCACE,wCGlFJ,wCACE,kBACA,UACA,WACA,YACA,aACA,mBACA,yBACA,0CARF,wCASI,WACA,aACJ,
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../../../src/assets/sass/index.sass","../../../src/assets/sass/vars.sass","../../../src/assets/sass/mixin.sass","../../../src/assets/sass/components/tabs.sass","../../../src/assets/sass/components/instructions.sass","../../../src/assets/sass/components/panorama.sass","../../../src/assets/sass/components/loader.sass","../../../src/assets/sass/components/model.sass"],"names":[],"mappings":"AAGA,mBACE,sBACA,8BACA,SACA,UAEF,UACE,eAEF,oBACE,YAEA,WACA,2BACA,gBACA,kBACA,UACA,iBCfM,KDiBN,+EACE,qCACA,mCACA,kCACA,aACA,gBACA,qBACA,MClBQ,QDoBV,iCACE,kBACA,UACA,SACA,UACA,0CALF,iCAMI,UACA,UACF,qCACE,cACA,WACA,YACA,mBACA,uBACA,0CANF,qCAOI,WACA,aAEN,yFAEE,kBACA,WACA,SACA,UErDF,YACA,YACA,gBACA,yBACA,eFmDE,aACA,0CARF,yFASI,WACA,UACF,iGACE,cACA,WACA,YACA,mBACA,uBACA,0CANF,iGAOI,WACA,aAEN,kCACE,kBACA,aACA,mBACA,uBACA,UACA,WACA,SACA,MCxEI,KDyEJ,iBCtEQ,QDuER,iBACA,mBACA,gBACA,YACA,eACA,wCACE,wCGlFJ,wCACE,kBACA,UACA,WACA,YACA,aACA,mBACA,yBACA,0CARF,wCASI,sBACA,WACA,aACJ,uCDfA,YACA,YACA,gBACA,yBACA,eCaE,WACA,YACA,kBACA,aACA,mBACA,uBACA,iBFjBG,QEkBH,MFdQ,QEeR,eACA,iBACA,iBACA,iBACA,0CAdF,uCAeI,WACA,YACA,eACA,gBACA,iBACF,0CApBF,uCAqBI,iBACF,+CACE,iBF9BM,QEgCV,gCACE,WACA,YACA,aACA,mBACA,uBACA,kBACA,yBAPF,gCAQI,mBACF,uCACE,eACA,gBACA,mBACA,cACF,4CACE,WACA,YACA,kBACA,0BACA,kDD3DJ,YACA,YACA,gBACA,yBACA,eCyDM,kBACA,SACA,YACA,2BACA,aACA,mBACA,uBACA,sBACA,iBF/DD,QEgEC,mBACA,YACA,0CAbF,kDAcI,YACA,WACA,UACA,UACA,YACA,gBACF,sDACE,cACA,kBACA,kBACA,QACA,0CALF,sDAMI,WACA,gBACJ,uDACE,eACA,iBACA,MFhFE,QEiFF,yBACA,0CALF,uDAMI,cACN,sDACE,sBACA,uBACA,kBACA,iCACA,0DACE,kBACA,SACA,QACA,gCACA,eACA,gBACA,YACA,aACA,mBACA,UACA,oBFjGR,iBACA,yBACA,eACA,uBEgGQ,iEACE,UAEJ,sFACE,YAEN,qCACE,kBACA,UACA,UACA,SACA,gBACA,gBACA,oBACA,iDACE,aACA,eACA,uBACA,gBACA,WACA,qDACE,WACA,YACA,cACA,iBACA,eACA,kBACA,sBACJ,wCACE,qBACA,2CACE,MFrIE,QEsIF,iBFxIE,QEyIF,iBACA,mBACA,gBACA,YACA,eACA,mBACA,YF1IR,iBACA,yBACA,eACA,uBEyIQ,iDACE,aACA,eACA,WAEA,6DACE,eACA,iBACA,WACA,YACA,SACA,kBACA,2FACE,wBACJ,4DACE,aACJ,wDACE,kBACA,+DACE,iBACA,WACA,WACA,YACA,cACA,gKACA,kBACA,WACA,QACA,2BClLZ,yCACE,kBACA,UACA,OACA,MACA,WACA,YACA,aACA,mBACA,uBACA,2BACA,4BACA,sBAEA,kDACE,aACA,sBACA,mBACA,2BACA,uCACA,mBACA,gBACA,YACA,4BACA,4BFpBJ,0BACA,+BACA,kCEoBE,gDACE,aACA,uBACA,uBACF,+CACE,aACA,sBACA,mBACA,2BACA,cACA,0CANF,+CAOI,eACF,mDACE,cACA,WACA,YACA,mBACA,uBACF,iDACE,MHtCI,QGuCJ,eACA,iBACA,kBACA,gBACA,gBACA,0CAPF,iDAQI,gBACN,gDFxDF,YACA,YACA,gBACA,yBACA,eEsDI,aACA,mBACA,uBACA,YACA,eACA,mBACA,iBHxDM,QGyDN,MHvDM,QGwDN,eACA,iBACA,yBACA,wBCjEF,0CACE,WACA,YACA,kBACA,OACA,MACA,UACA,kDACE,WACA,YACA,gBACA,2BACA,oDACE,wBACF,yDACE,yBACJ,mDACE,kBACA,UACA,SACA,YACA,aACA,mBACA,uBACA,YACA,mBACA,gCACA,2BHxBN,0BACA,+BACA,kCGwBM,0CAbF,mDAcI,aACF,0DHnCN,YACA,YACA,gBACA,yBACA,eGiCQ,WACA,YACA,kBACA,iBJpCF,KIqCE,aACA,mBACA,uBACA,kBACA,0CAVF,0DAWI,WACA,aACF,0CAbF,0DAcI,mBACF,8DACE,cACA,0CAFF,8DAGI,sBACJ,4EACE,eACN,8CACE,kBACA,UACA,YACA,UACA,mBACA,sBACA,iBJ3DA,KI4DA,UACA,uBACA,0CAVF,8CAWI,UACA,YACA,qBACA,yBAEE,0DACE,UACJ,sDACE,8BAGI,yEACE,uBACV,0CAxBF,8CAyBI,sBACF,sDACE,UACA,oBACF,kDACE,YACA,mBACA,cJ3ER,iBACA,yBACA,eACA,uBI0EQ,wDACE,wCACJ,kDACE,kBACA,OACA,MACA,YACA,YACA,UACA,cACA,sBACA,0DACE,UACA,KJ/FA,QIgGA,eACA,gEACE,WACA,0CAFF,gEAGI,WACR,mDACE,kBACA,OACA,MACA,UACA,WACA,kBACA,gCACA,0CACA,6CACA,yBACA,UACA,oBACA,2DACE,WACA,kBACA,UACA,SACA,QACA,iDACA,WACA,YACA,iBJ3HA,QI4HA,kBACA,yBACA,gCCrIZ,eACE,cACA,kBACA,WACA,YACA,yBACE,kBACA,SACA,QACA,gCACF,mBACE,4CACF,mBACE,kBACA,SACA,WACA,YACA,kBACA,WLXQ,QKYR,mDACA,gCACE,SACA,uCACF,gCACE,SACA,uCACF,gCACE,UACA,uCACF,gCACE,UACA,uCAEN,2BACE,GACE,mBACF,KACE,oBAEJ,2BACE,GACE,mBACF,KACE,oBAEJ,2BACE,GACE,0BAEF,KACE,8BChDA,uCACE,WACA,YACA,kBACA,OACA,MACA,UACA,6CACE,WACA,YACA,cACF,gDACE,kBACA,WACA,aACA,UACA,oBACA,0CANF,gDAOI,SACA,4BACF,wDACE,UACA","file":"app.css"}
|
@@ -15,8 +15,13 @@
|
|
15
15
|
height: 100%
|
16
16
|
overflow: hidden
|
17
17
|
background: $white !important
|
18
|
+
*
|
19
|
+
display: none !important
|
20
|
+
canvas
|
21
|
+
display: block !important
|
18
22
|
&-controls
|
19
23
|
position: absolute
|
24
|
+
z-index: 2
|
20
25
|
left: 50%
|
21
26
|
bottom: 35px
|
22
27
|
display: flex
|
@@ -28,13 +33,7 @@
|
|
28
33
|
transform: translateX(-50%)
|
29
34
|
@include blurBackground(5px)
|
30
35
|
@media #{$tablet}
|
31
|
-
|
32
|
-
left: unset
|
33
|
-
transform: none
|
34
|
-
bottom: 120px
|
35
|
-
@media #{$mobile}
|
36
|
-
right: 20px
|
37
|
-
bottom: 100px
|
36
|
+
bottom: 20px
|
38
37
|
&-button
|
39
38
|
@include customButton
|
40
39
|
width: 55px
|
@@ -48,6 +47,8 @@
|
|
48
47
|
@media #{$tablet}
|
49
48
|
width: 40px
|
50
49
|
height: 40px
|
50
|
+
@media #{$mobile}
|
51
|
+
margin-right: 13px
|
51
52
|
img
|
52
53
|
display: block
|
53
54
|
@media #{$tablet}
|
@@ -60,22 +61,34 @@
|
|
60
61
|
bottom: 35px
|
61
62
|
z-index: 3
|
62
63
|
border-radius: 10px
|
64
|
+
border: 8px solid $white
|
65
|
+
background-color: $white
|
63
66
|
opacity: 1
|
64
67
|
transition: opacity .5s
|
65
|
-
|
66
|
-
@media #{$mobile}
|
68
|
+
@media #{$tablet}
|
67
69
|
left: 20px
|
68
70
|
bottom: 20px
|
71
|
+
transform: scale(.6)
|
72
|
+
transform-origin: 0% 100%
|
73
|
+
svg
|
74
|
+
polygon
|
75
|
+
opacity: 0
|
76
|
+
&--scaled
|
77
|
+
transform: scale(1) !important
|
78
|
+
svg
|
79
|
+
polygon
|
80
|
+
&:active
|
81
|
+
opacity: .3 !important
|
82
|
+
@media #{$mobile}
|
83
|
+
transform: scale(.4)
|
69
84
|
&--hidden
|
70
85
|
opacity: 0
|
71
86
|
pointer-events: none
|
72
87
|
img
|
73
88
|
width: 195px
|
74
|
-
border-radius:
|
89
|
+
border-radius: none
|
75
90
|
display: block
|
76
91
|
@include noSelect
|
77
|
-
@media #{$tablet}
|
78
|
-
width: 150px
|
79
92
|
&:hover
|
80
93
|
box-shadow: 1px 1px 10px rgba(0,0,0,0.15)
|
81
94
|
svg
|
@@ -87,14 +100,14 @@
|
|
87
100
|
z-index: 3
|
88
101
|
display: block
|
89
102
|
border-radius: inherit
|
90
|
-
@media #{$tablet}
|
91
|
-
width: 150px
|
92
103
|
polygon
|
93
104
|
opacity: 0
|
94
105
|
fill: $mainColor
|
95
106
|
cursor: pointer
|
96
107
|
&:hover
|
97
108
|
opacity: .3
|
109
|
+
@media #{$tablet}
|
110
|
+
opacity: 0
|
98
111
|
&__fov
|
99
112
|
position: absolute
|
100
113
|
left: 0
|
@@ -108,24 +121,16 @@
|
|
108
121
|
transform-origin: 50% 50%
|
109
122
|
z-index: 4
|
110
123
|
pointer-events: none
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
background-color: $mainColor
|
119
|
-
border-radius: 50%
|
120
|
-
z-index: 5
|
121
|
-
visibility: hidden
|
122
|
-
pointer-events: none
|
123
|
-
&--big
|
124
|
-
border: 2px solid $mainColor
|
125
|
-
box-shadow: inset 0 0 0 2px #ffffff
|
124
|
+
&::before
|
125
|
+
content: ''
|
126
|
+
position: absolute
|
127
|
+
z-index: 5
|
128
|
+
left: 50%
|
129
|
+
top: 50%
|
130
|
+
transform: translate(-50%, -50%) translateY(-5px)
|
126
131
|
width: 15px
|
127
132
|
height: 15px
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
133
|
+
background-color: $mainColor
|
134
|
+
border-radius: 50%
|
135
|
+
border: 2px solid $mainColor
|
136
|
+
box-shadow: inset 0 0 0 2px #ffffff
|
@@ -10,7 +10,8 @@
|
|
10
10
|
display: flex
|
11
11
|
align-items: center
|
12
12
|
justify-content: flex-end
|
13
|
-
@media #{$
|
13
|
+
@media #{$tablet}
|
14
|
+
flex-direction: column
|
14
15
|
right: 20px
|
15
16
|
bottom: 20px
|
16
17
|
.widget-tab-button
|
@@ -31,9 +32,10 @@
|
|
31
32
|
width: 60px
|
32
33
|
height: 60px
|
33
34
|
font-size: 24px
|
34
|
-
margin-left:
|
35
|
+
margin-left: 0px
|
36
|
+
margin-top: 20px
|
35
37
|
@media #{$mobile}
|
36
|
-
margin-
|
38
|
+
margin-top: 10px
|
37
39
|
&--active
|
38
40
|
background-color: $mainColor
|
39
41
|
|
@@ -73,11 +75,9 @@
|
|
73
75
|
height: 60px
|
74
76
|
width: 60px
|
75
77
|
padding: 0
|
76
|
-
left: 45px
|
77
|
-
transform: none
|
78
|
-
@media #{$mobile}
|
79
78
|
left: 20px
|
80
79
|
bottom: 20px
|
80
|
+
transform: none
|
81
81
|
img
|
82
82
|
display: block
|
83
83
|
margin-right: 20px
|
@@ -109,6 +109,7 @@
|
|
109
109
|
height: 600px
|
110
110
|
object-fit: contain
|
111
111
|
opacity: 0
|
112
|
+
pointer-events: none
|
112
113
|
@include noSelect
|
113
114
|
&.active
|
114
115
|
opacity: 1
|
@@ -141,7 +142,7 @@
|
|
141
142
|
ul
|
142
143
|
list-style-type: none
|
143
144
|
li
|
144
|
-
color: $
|
145
|
+
color: $text-dark
|
145
146
|
background-color: $mainColor
|
146
147
|
padding: 5px 15px
|
147
148
|
border-radius: 10px
|
@@ -34,7 +34,7 @@ html, body
|
|
34
34
|
left: 45px
|
35
35
|
top: 30px
|
36
36
|
z-index: 3
|
37
|
-
@media #{$
|
37
|
+
@media #{$tablet}
|
38
38
|
left: 20px
|
39
39
|
top: 20px
|
40
40
|
img
|
@@ -55,7 +55,7 @@ html, body
|
|
55
55
|
z-index: 3
|
56
56
|
@include customButton
|
57
57
|
padding: 10px
|
58
|
-
@media #{$
|
58
|
+
@media #{$tablet}
|
59
59
|
right: 20px
|
60
60
|
top: 20px
|
61
61
|
img
|
@@ -15,8 +15,6 @@ var _store = _interopRequireDefault(require("../store"));
|
|
15
15
|
|
16
16
|
var _fullScreenStore = _interopRequireDefault(require("../store/fullScreenStore"));
|
17
17
|
|
18
|
-
var _ImageTab = _interopRequireDefault(require("./ImageTab"));
|
19
|
-
|
20
18
|
var _RotationTab = _interopRequireDefault(require("./RotationTab"));
|
21
19
|
|
22
20
|
var _PanoramaTab = _interopRequireDefault(require("./PanoramaTab"));
|
@@ -49,6 +47,10 @@ var Application = (0, _mobxReactLite.observer)(function (_ref) {
|
|
49
47
|
var width = _ref.width,
|
50
48
|
height = _ref.height;
|
51
49
|
var config = _store.default.config;
|
50
|
+
var appStyle = {
|
51
|
+
width: width,
|
52
|
+
height: height
|
53
|
+
};
|
52
54
|
|
53
55
|
var _useState = (0, _react.useState)(config.tabs[0]),
|
54
56
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -56,18 +58,6 @@ var Application = (0, _mobxReactLite.observer)(function (_ref) {
|
|
56
58
|
setCurrentTab = _useState2[1];
|
57
59
|
|
58
60
|
var tabsList = {
|
59
|
-
'planImage': /*#__PURE__*/_react.default.createElement(_ImageTab.default, {
|
60
|
-
image: config.planImage,
|
61
|
-
alt: "plan-view"
|
62
|
-
}),
|
63
|
-
'topView': /*#__PURE__*/_react.default.createElement(_ImageTab.default, {
|
64
|
-
image: config.topView,
|
65
|
-
alt: "top-view"
|
66
|
-
}),
|
67
|
-
'topDownView': /*#__PURE__*/_react.default.createElement(_ImageTab.default, {
|
68
|
-
image: config.topDownView,
|
69
|
-
alt: "top-down-view"
|
70
|
-
}),
|
71
61
|
'rotation': /*#__PURE__*/_react.default.createElement(_RotationTab.default, {
|
72
62
|
images: config.rotationImages,
|
73
63
|
disabled: !config.rotationImages[0]
|
@@ -90,10 +80,6 @@ var Application = (0, _mobxReactLite.observer)(function (_ref) {
|
|
90
80
|
tab: 'panorama',
|
91
81
|
text: '3D'
|
92
82
|
}];
|
93
|
-
var appStyle = {
|
94
|
-
width: width,
|
95
|
-
height: height
|
96
|
-
};
|
97
83
|
|
98
84
|
var setWindowHeight = function setWindowHeight() {
|
99
85
|
document.querySelector('.widget-application').style.setProperty('--vh', window.innerHeight / 100 + 'px');
|
@@ -7,6 +7,8 @@ exports.default = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
9
|
|
10
|
+
var _locale = _interopRequireDefault(require("../locale"));
|
11
|
+
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
13
|
|
12
14
|
var Instructions = function Instructions(_ref) {
|
@@ -45,7 +47,7 @@ var Instructions = function Instructions(_ref) {
|
|
45
47
|
disabled: disabled,
|
46
48
|
onClick: onClick,
|
47
49
|
type: "button"
|
48
|
-
},
|
50
|
+
}, _locale.default.getLocaleText('ok'))));
|
49
51
|
};
|
50
52
|
|
51
53
|
var _default = Instructions;
|
@@ -13,6 +13,8 @@ var _mobxReactLite = require("mobx-react-lite");
|
|
13
13
|
|
14
14
|
var _modelStore = _interopRequireDefault(require("../store/modelStore"));
|
15
15
|
|
16
|
+
var _locale = _interopRequireDefault(require("../locale"));
|
17
|
+
|
16
18
|
var _modelHelpers = require("../utils/modelHelpers");
|
17
19
|
|
18
20
|
var _nipplejs = _interopRequireDefault(require("nipplejs"));
|
@@ -41,13 +43,13 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
41
43
|
|
42
44
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
43
45
|
|
44
|
-
var instructionSteps = [{
|
45
|
-
icon: _handMove.default,
|
46
|
-
text: 'Вращать планировку'
|
47
|
-
}];
|
48
46
|
var ModelTab = (0, _mobxReactLite.observer)(function (_ref) {
|
49
47
|
var json = _ref.json,
|
50
48
|
disabled = _ref.disabled;
|
49
|
+
var instructionSteps = [{
|
50
|
+
icon: _handMove.default,
|
51
|
+
text: _locale.default.getLocaleText('rotate-plan')
|
52
|
+
}];
|
51
53
|
|
52
54
|
var _useState = (0, _react.useState)(true),
|
53
55
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -141,39 +143,39 @@ var ModelTab = (0, _mobxReactLite.observer)(function (_ref) {
|
|
141
143
|
onClick: function onClick() {
|
142
144
|
return setMenuState(!menuState);
|
143
145
|
}
|
144
|
-
},
|
146
|
+
}, _locale.default.getLocaleText('menu')), menuState && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("li", {
|
145
147
|
onClick: function onClick() {
|
146
148
|
return _modelStore.default.setCurrentControlsType('wasd');
|
147
149
|
}
|
148
|
-
},
|
150
|
+
}, _locale.default.getLocaleText('wasd')), /*#__PURE__*/_react.default.createElement("li", {
|
149
151
|
onClick: function onClick() {
|
150
152
|
return _modelStore.default.setCurrentControlsType('plan');
|
151
153
|
}
|
152
|
-
},
|
154
|
+
}, _locale.default.getLocaleText('view-from-above')), /*#__PURE__*/_react.default.createElement("li", {
|
153
155
|
onClick: function onClick() {
|
154
156
|
return _modelStore.default.setCurrentControlsType('orbit');
|
155
157
|
}
|
156
|
-
},
|
158
|
+
}, _locale.default.getLocaleText('free-camera')), /*#__PURE__*/_react.default.createElement("li", {
|
157
159
|
onClick: function onClick() {
|
158
160
|
return houseStore.setShadowsVisibility(!houseStore.isShadowsVisible);
|
159
161
|
}
|
160
|
-
}, "
|
162
|
+
}, _locale.default.getLocaleText('shadows'), ":", houseStore.isShadowsVisible ? _locale.default.getLocaleText('on') : _locale.default.getLocaleText('off')), /*#__PURE__*/_react.default.createElement("li", {
|
161
163
|
onClick: function onClick() {
|
162
164
|
return houseStore.setPlanMode();
|
163
165
|
}
|
164
|
-
},
|
166
|
+
}, _locale.default.getLocaleText('plan')), /*#__PURE__*/_react.default.createElement("li", {
|
165
167
|
onClick: function onClick() {
|
166
168
|
return houseStore.setFullBuildingVisibility(!houseStore.isFullBuildingVisible);
|
167
169
|
}
|
168
|
-
}, houseStore.isFullBuildingVisible ? '
|
170
|
+
}, houseStore.isFullBuildingVisible ? _locale.default.getLocaleText('hide-walls') : _locale.default.getLocaleText('show-walls')), /*#__PURE__*/_react.default.createElement("li", {
|
169
171
|
onClick: function onClick() {
|
170
172
|
return houseStore.setDoorsVisibility(!houseStore.isDoorsVisible);
|
171
173
|
}
|
172
|
-
}, houseStore.isDoorsVisible ? '
|
174
|
+
}, houseStore.isDoorsVisible ? _locale.default.getLocaleText('hide-doors') : _locale.default.getLocaleText('show-doors')), /*#__PURE__*/_react.default.createElement("li", {
|
173
175
|
onClick: function onClick() {
|
174
176
|
return houseStore.setCurrentWallsMaterialType(getNextWallsMaterialType());
|
175
177
|
}
|
176
|
-
}, "
|
178
|
+
}, _locale.default.getLocaleText('material'), ":", houseStore.wallsMaterialType === 'texture' ? _locale.default.getLocaleText('texture') : _locale.default.getLocaleText('color')), /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement("label", null, _locale.default.getLocaleText('wall-color'), ":", /*#__PURE__*/_react.default.createElement("input", {
|
177
179
|
type: "color",
|
178
180
|
onChange: function onChange(_ref4) {
|
179
181
|
var target = _ref4.target;
|
@@ -183,7 +185,7 @@ var ModelTab = (0, _mobxReactLite.observer)(function (_ref) {
|
|
183
185
|
background: houseStore.wallsColor
|
184
186
|
},
|
185
187
|
value: houseStore.wallsColor
|
186
|
-
}))), /*#__PURE__*/_react.default.createElement("li", null, "
|
188
|
+
}))), /*#__PURE__*/_react.default.createElement("li", null, _locale.default.getLocaleText('wall-texture'), ":", /*#__PURE__*/_react.default.createElement("div", {
|
187
189
|
className: "widget-tab-menu__wallpapers"
|
188
190
|
}, houseStore && houseStore.wallsTextures.map(function (_ref5, index) {
|
189
191
|
var image = _ref5.image,
|
@@ -196,7 +198,7 @@ var ModelTab = (0, _mobxReactLite.observer)(function (_ref) {
|
|
196
198
|
},
|
197
199
|
alt: "texture=".concat(index)
|
198
200
|
});
|
199
|
-
}))), /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement("label", null,
|
201
|
+
}))), /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement("label", null, _locale.default.getLocaleText('upload-wall-texture'), /*#__PURE__*/_react.default.createElement("input", {
|
200
202
|
onChange: onImageUploaded,
|
201
203
|
type: "file",
|
202
204
|
accept: ".jpg, .jpeg, .png"
|
@@ -9,6 +9,8 @@ exports.default = void 0;
|
|
9
9
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
11
11
|
|
12
|
+
var _locale = _interopRequireDefault(require("../locale"));
|
13
|
+
|
12
14
|
var _store = _interopRequireDefault(require("../store"));
|
13
15
|
|
14
16
|
var THREE = _interopRequireWildcard(require("three"));
|
@@ -19,10 +21,14 @@ var _threeDeviceOrientation = _interopRequireDefault(require("three-device-orien
|
|
19
21
|
|
20
22
|
var _geometric = require("geometric");
|
21
23
|
|
22
|
-
var
|
24
|
+
var _deviceOrientationStatuses = require("../enums/deviceOrientationStatuses");
|
25
|
+
|
26
|
+
var _deviceWidth = require("../enums/deviceWidth");
|
23
27
|
|
24
28
|
var _imageExtentions = require("../enums/imageExtentions");
|
25
29
|
|
30
|
+
var _helpers = require("../utils/helpers");
|
31
|
+
|
26
32
|
var _panoramaHelpers = require("../utils/panoramaHelpers");
|
27
33
|
|
28
34
|
var _Loader = _interopRequireDefault(require("./Loader"));
|
@@ -63,13 +69,6 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
63
69
|
|
64
70
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
65
71
|
|
66
|
-
var instructionSteps = [{
|
67
|
-
icon: _handMove.default,
|
68
|
-
text: 'Вращать планировку'
|
69
|
-
}, {
|
70
|
-
icon: _handResearch.default,
|
71
|
-
text: 'Исследовать планировку'
|
72
|
-
}];
|
73
72
|
var _PANOLENS$CONTROLS = PANOLENS.CONTROLS,
|
74
73
|
DEVICEORIENTATION = _PANOLENS$CONTROLS.DEVICEORIENTATION,
|
75
74
|
ORBIT = _PANOLENS$CONTROLS.ORBIT;
|
@@ -241,59 +240,82 @@ var PanoramaTab = function PanoramaTab(_ref4) {
|
|
241
240
|
planImage = _ref4.planImage,
|
242
241
|
images = _ref4.images,
|
243
242
|
disabled = _ref4.disabled;
|
244
|
-
|
245
|
-
|
243
|
+
var instructionSteps = [{
|
244
|
+
icon: _handMove.default,
|
245
|
+
text: _locale.default.getLocaleText('rotate-plan')
|
246
|
+
}, {
|
247
|
+
icon: _handResearch.default,
|
248
|
+
text: _locale.default.getLocaleText('research-plan')
|
249
|
+
}];
|
250
|
+
|
251
|
+
var _useState = (0, _react.useState)(_deviceOrientationStatuses.deviceOrientationStatuses.DENIED),
|
246
252
|
_useState2 = _slicedToArray(_useState, 2),
|
247
|
-
|
248
|
-
|
253
|
+
deviceOrientationStatus = _useState2[0],
|
254
|
+
setDeviceOrientationStatus = _useState2[1];
|
249
255
|
|
250
256
|
var _useState3 = (0, _react.useState)(true),
|
251
257
|
_useState4 = _slicedToArray(_useState3, 2),
|
252
|
-
|
253
|
-
|
258
|
+
showInstructions = _useState4[0],
|
259
|
+
setInstructionsState = _useState4[1];
|
254
260
|
|
255
|
-
var _useState5 = (0, _react.useState)(
|
261
|
+
var _useState5 = (0, _react.useState)(true),
|
256
262
|
_useState6 = _slicedToArray(_useState5, 2),
|
257
|
-
|
258
|
-
|
263
|
+
loadingState = _useState6[0],
|
264
|
+
setLoadingState = _useState6[1];
|
259
265
|
|
260
|
-
var _useState7 = (0, _react.useState)(
|
266
|
+
var _useState7 = (0, _react.useState)({
|
267
|
+
width: 0,
|
268
|
+
height: 0
|
269
|
+
}),
|
261
270
|
_useState8 = _slicedToArray(_useState7, 2),
|
262
|
-
|
263
|
-
|
271
|
+
windowSize = _useState8[0],
|
272
|
+
setWindowSize = _useState8[1];
|
264
273
|
|
265
274
|
var _useState9 = (0, _react.useState)({
|
266
|
-
|
267
|
-
|
275
|
+
width: '195px',
|
276
|
+
height: 'auto'
|
268
277
|
}),
|
269
278
|
_useState10 = _slicedToArray(_useState9, 2),
|
270
|
-
|
271
|
-
|
279
|
+
mapSize = _useState10[0],
|
280
|
+
setMapSize = _useState10[1];
|
272
281
|
|
273
|
-
var _useState11 = (0, _react.useState)(
|
282
|
+
var _useState11 = (0, _react.useState)({
|
283
|
+
X: 1,
|
284
|
+
Y: 1
|
285
|
+
}),
|
274
286
|
_useState12 = _slicedToArray(_useState11, 2),
|
275
|
-
|
276
|
-
|
287
|
+
planScale = _useState12[0],
|
288
|
+
setPlanScale = _useState12[1];
|
277
289
|
|
278
|
-
var _useState13 = (0, _react.useState)(
|
290
|
+
var _useState13 = (0, _react.useState)(true),
|
279
291
|
_useState14 = _slicedToArray(_useState13, 2),
|
280
|
-
|
281
|
-
|
292
|
+
isMapDisabled = _useState14[0],
|
293
|
+
setMapDisabledState = _useState14[1];
|
282
294
|
|
283
|
-
var _useState15 = (0, _react.useState)(
|
295
|
+
var _useState15 = (0, _react.useState)(false),
|
284
296
|
_useState16 = _slicedToArray(_useState15, 2),
|
285
|
-
|
286
|
-
|
297
|
+
autoplayEnabled = _useState16[0],
|
298
|
+
setAutoplayState = _useState16[1];
|
287
299
|
|
288
|
-
var _useState17 = (0, _react.useState)(
|
300
|
+
var _useState17 = (0, _react.useState)(cameraFovValues.x1),
|
289
301
|
_useState18 = _slicedToArray(_useState17, 2),
|
290
|
-
|
291
|
-
|
302
|
+
cameraFov = _useState18[0],
|
303
|
+
setCameraFov = _useState18[1];
|
292
304
|
|
293
|
-
var _useState19 = (0, _react.useState)(
|
305
|
+
var _useState19 = (0, _react.useState)(0),
|
294
306
|
_useState20 = _slicedToArray(_useState19, 2),
|
295
|
-
|
296
|
-
|
307
|
+
currentRoomIndex = _useState20[0],
|
308
|
+
setCurrentRoomIndex = _useState20[1];
|
309
|
+
|
310
|
+
var _useState21 = (0, _react.useState)([]),
|
311
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
312
|
+
panoramas = _useState22[0],
|
313
|
+
setPanoramas = _useState22[1];
|
314
|
+
|
315
|
+
var _useState23 = (0, _react.useState)(null),
|
316
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
317
|
+
viewer = _useState24[0],
|
318
|
+
setViewer = _useState24[1];
|
297
319
|
|
298
320
|
var changePanorama = function changePanorama(panorama) {
|
299
321
|
setCurrentRoomIndex(panorama['panorama_index']);
|
@@ -301,8 +323,33 @@ var PanoramaTab = function PanoramaTab(_ref4) {
|
|
301
323
|
};
|
302
324
|
|
303
325
|
var setScale = function setScale() {
|
326
|
+
if (!viewer) return;
|
304
327
|
var image = document.querySelector('.widget-tab__panorama-map img');
|
305
|
-
|
328
|
+
var _viewer$container = viewer.container,
|
329
|
+
clientWidth = _viewer$container.clientWidth,
|
330
|
+
clientHeight = _viewer$container.clientHeight;
|
331
|
+
var imageWidth = image.naturalWidth;
|
332
|
+
var imageHeight = image.naturalHeight;
|
333
|
+
var imageDelta = imageWidth / imageHeight;
|
334
|
+
var maxWidth = 195;
|
335
|
+
var maxHeight = clientHeight - 200;
|
336
|
+
var width = maxWidth;
|
337
|
+
var height = width / imageDelta;
|
338
|
+
|
339
|
+
if (height >= maxHeight) {
|
340
|
+
height = maxHeight;
|
341
|
+
width = height * imageDelta;
|
342
|
+
}
|
343
|
+
|
344
|
+
setMapSize({
|
345
|
+
width: "".concat(width, "px"),
|
346
|
+
height: "".concat(height, "px")
|
347
|
+
});
|
348
|
+
setPlanScale((0, _panoramaHelpers.getScale)({
|
349
|
+
width: width,
|
350
|
+
height: height
|
351
|
+
}, json));
|
352
|
+
viewer.onWindowResize(clientWidth, clientHeight);
|
306
353
|
};
|
307
354
|
|
308
355
|
var onImageLoaded = function onImageLoaded() {
|
@@ -310,12 +357,6 @@ var PanoramaTab = function PanoramaTab(_ref4) {
|
|
310
357
|
setMapDisabledState(!json);
|
311
358
|
};
|
312
359
|
|
313
|
-
var getDotClassName = function getDotClassName(index) {
|
314
|
-
var className = 'widget-tab__panorama-map__dot widget-tab__panorama-map__dot--big';
|
315
|
-
if (currentRoomIndex === index) className += ' widget-tab__panorama-map__dot--active';
|
316
|
-
return className;
|
317
|
-
};
|
318
|
-
|
319
360
|
var getDotPosition = function getDotPosition(_ref5) {
|
320
361
|
var left = _ref5.left,
|
321
362
|
top = _ref5.top;
|
@@ -346,18 +387,37 @@ var PanoramaTab = function PanoramaTab(_ref4) {
|
|
346
387
|
|
347
388
|
if (autoplayEnabled) {
|
348
389
|
viewer.disableAutoRate();
|
390
|
+
|
391
|
+
if (deviceOrientationStatus === _deviceOrientationStatuses.deviceOrientationStatuses.GRANTED) {
|
392
|
+
viewer.enableControl(DEVICEORIENTATION);
|
393
|
+
}
|
394
|
+
|
349
395
|
return;
|
350
396
|
}
|
351
397
|
|
398
|
+
if (viewer.getControlId() !== 'orbit') {
|
399
|
+
viewer.enableControl(ORBIT);
|
400
|
+
}
|
401
|
+
|
352
402
|
viewer.enableAutoRate();
|
353
403
|
};
|
354
404
|
|
355
405
|
var updateWindowWidth = function updateWindowWidth() {
|
356
|
-
return
|
406
|
+
return setWindowSize({
|
407
|
+
width: window.innerWidth,
|
408
|
+
height: window.innerHeight
|
409
|
+
});
|
410
|
+
};
|
411
|
+
|
412
|
+
var rescaleMap = function rescaleMap() {
|
413
|
+
var map = document.querySelector('.widget-tab__panorama-map');
|
414
|
+
if (!map) return;
|
415
|
+
map.classList.remove('widget-tab__panorama-map--scaled');
|
357
416
|
};
|
358
417
|
|
359
418
|
(0, _react.useEffect)(function () {
|
360
419
|
window.addEventListener('resize', updateWindowWidth);
|
420
|
+
updateWindowWidth();
|
361
421
|
return function cleanup() {
|
362
422
|
window.removeEventListener('resize', updateWindowWidth);
|
363
423
|
};
|
@@ -366,11 +426,10 @@ var PanoramaTab = function PanoramaTab(_ref4) {
|
|
366
426
|
if (!panoramas.length) return;
|
367
427
|
var container = document.querySelector('.widget-tab__panorama-overlay');
|
368
428
|
var newViewer = new PANOLENS.Viewer({
|
369
|
-
autoRotateActivationDuration:
|
429
|
+
autoRotateActivationDuration: 1000,
|
430
|
+
cameraFov: cameraFovValues.x1,
|
370
431
|
autoHideInfospot: false,
|
371
432
|
controlButtons: [],
|
372
|
-
controlBar: false,
|
373
|
-
cameraFov: cameraFovValues.x1,
|
374
433
|
container: container
|
375
434
|
});
|
376
435
|
|
@@ -394,45 +453,52 @@ var PanoramaTab = function PanoramaTab(_ref4) {
|
|
394
453
|
newViewer.scene.rotation.y = Math.PI / 2;
|
395
454
|
newViewer.camera.currentFov = cameraFovValues.x1;
|
396
455
|
setViewer(newViewer);
|
397
|
-
var camera = new THREE.PerspectiveCamera(75,
|
456
|
+
var camera = new THREE.PerspectiveCamera(75, container.clientWidth / container.clientHeight, 1, 1000);
|
398
457
|
var orientationControls = new _threeDeviceOrientation.default(camera);
|
399
458
|
|
459
|
+
var getAngle = function getAngle(control) {
|
460
|
+
if (control.alpha) {
|
461
|
+
return control.alpha - THREE.MathUtils.degToRad(control.screenOrientation);
|
462
|
+
}
|
463
|
+
|
464
|
+
return control.getAzimuthalAngle();
|
465
|
+
};
|
466
|
+
|
400
467
|
var animate = function animate() {
|
401
468
|
window.requestAnimationFrame(animate);
|
402
|
-
camera.aspect = window.innerWidth / window.innerHeight;
|
403
|
-
camera.updateProjectionMatrix();
|
404
469
|
orientationControls.update();
|
405
470
|
var fovElement = document.querySelector('.widget-tab__panorama-map__fov');
|
406
471
|
if (!fovElement) return;
|
407
|
-
var
|
408
|
-
var angle = -(control.alpha || control.getAzimuthalAngle());
|
472
|
+
var angle = -getAngle(newViewer.getControl());
|
409
473
|
fovElement.style.transform = "translate(-50%, -50%) rotate(".concat(angle, "rad)");
|
410
474
|
};
|
411
475
|
|
412
476
|
animate();
|
413
477
|
}, [panoramas]);
|
414
|
-
(0, _react.useEffect)(setScale, [json,
|
478
|
+
(0, _react.useEffect)(setScale, [json, windowSize, viewer]);
|
415
479
|
(0, _react.useEffect)(function () {
|
416
480
|
return setPanoramas(getPanoramas(json, images, setLoadingState));
|
417
481
|
}, [json, images]);
|
418
482
|
|
483
|
+
var requestDeviceOrientation = function requestDeviceOrientation() {
|
484
|
+
return DeviceOrientationEvent.requestPermission().then(function (status) {
|
485
|
+
setDeviceOrientationStatus(status);
|
486
|
+
|
487
|
+
if (status !== _deviceOrientationStatuses.deviceOrientationStatuses.GRANTED) {
|
488
|
+
viewer.enableControl(ORBIT);
|
489
|
+
return;
|
490
|
+
}
|
491
|
+
|
492
|
+
viewer.enableControl(DEVICEORIENTATION);
|
493
|
+
});
|
494
|
+
};
|
495
|
+
|
419
496
|
var onStart = function onStart() {
|
420
497
|
setInstructionsState(false);
|
421
498
|
|
422
499
|
try {
|
423
500
|
if (!DeviceOrientationEvent.requestPermission) return;
|
424
|
-
return
|
425
|
-
if (status !== _deviceOrientationStatus.deviceOrientationStatus.GRANTED) {
|
426
|
-
setTimeout(function () {
|
427
|
-
return viewer.enableControl(ORBIT);
|
428
|
-
}, 100);
|
429
|
-
return;
|
430
|
-
}
|
431
|
-
|
432
|
-
setTimeout(function () {
|
433
|
-
return viewer.enableControl(DEVICEORIENTATION);
|
434
|
-
}, 100);
|
435
|
-
});
|
501
|
+
return requestDeviceOrientation();
|
436
502
|
} catch (error) {
|
437
503
|
console.error(error.message);
|
438
504
|
}
|
@@ -451,6 +517,17 @@ var PanoramaTab = function PanoramaTab(_ref4) {
|
|
451
517
|
};
|
452
518
|
|
453
519
|
var onMapClick = function onMapClick(event) {
|
520
|
+
if (loadingState) return;
|
521
|
+
var map = document.querySelector('.widget-tab__panorama-map');
|
522
|
+
|
523
|
+
if (windowSize.width <= _deviceWidth.deviceWidth.tablet) {
|
524
|
+
if (!map.classList.contains('widget-tab__panorama-map--scaled')) {
|
525
|
+
map.classList.add('widget-tab__panorama-map--scaled');
|
526
|
+
return;
|
527
|
+
}
|
528
|
+
}
|
529
|
+
|
530
|
+
rescaleMap();
|
454
531
|
var image = document.querySelector('.widget-tab__panorama-map img');
|
455
532
|
var clientX = event.clientX,
|
456
533
|
clientY = event.clientY;
|
@@ -471,28 +548,22 @@ var PanoramaTab = function PanoramaTab(_ref4) {
|
|
471
548
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
472
549
|
className: "widget-tab__panorama"
|
473
550
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
474
|
-
className: "widget-tab__panorama-overlay"
|
551
|
+
className: "widget-tab__panorama-overlay",
|
552
|
+
onContextMenu: _helpers.preventRightClick
|
475
553
|
}), loadingState && /*#__PURE__*/_react.default.createElement(_Loader.default, {
|
476
554
|
absolute: true
|
477
555
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
478
556
|
className: "widget-tab__panorama-map ".concat(isMapDisabled ? 'widget-tab__panorama-map--hidden' : '')
|
479
557
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
480
558
|
src: planImage,
|
481
|
-
|
482
|
-
alt: "plan"
|
483
|
-
|
484
|
-
|
485
|
-
key: index,
|
486
|
-
className: getDotClassName(index),
|
487
|
-
style: getDotPosition(panorama.userData),
|
488
|
-
onClick: function onClick() {
|
489
|
-
return changePanorama(panorama);
|
490
|
-
}
|
491
|
-
});
|
492
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
559
|
+
style: mapSize,
|
560
|
+
alt: "plan",
|
561
|
+
onLoad: onImageLoaded
|
562
|
+
}), !isMapDisabled && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
493
563
|
className: "widget-tab__panorama-map__fov",
|
494
564
|
style: getDotPosition(((_panoramas$currentRoo = panoramas[currentRoomIndex]) === null || _panoramas$currentRoo === void 0 ? void 0 : _panoramas$currentRoo.userData) || getDefaultUserData())
|
495
565
|
}), /*#__PURE__*/_react.default.createElement("svg", {
|
566
|
+
width: mapSize.width,
|
496
567
|
key: "X-".concat(planScale.X, "-Y-").concat(planScale.Y),
|
497
568
|
onClick: onMapClick
|
498
569
|
}, panoramas.map(function (_ref10, index) {
|
@@ -13,6 +13,10 @@ var _panzoom = _interopRequireDefault(require("panzoom"));
|
|
13
13
|
|
14
14
|
var _threesixty = _interopRequireDefault(require("../threesixty"));
|
15
15
|
|
16
|
+
var _helpers = require("../utils/helpers");
|
17
|
+
|
18
|
+
var _locale = _interopRequireDefault(require("../locale"));
|
19
|
+
|
16
20
|
var _Instructions = _interopRequireDefault(require("./Instructions"));
|
17
21
|
|
18
22
|
var _handMove = _interopRequireDefault(require("../assets/icons/hand-move.svg"));
|
@@ -45,15 +49,14 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
45
49
|
|
46
50
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
47
51
|
|
48
|
-
var instructionSteps = [{
|
49
|
-
icon: _handMove.default,
|
50
|
-
text: 'Вращать планировку'
|
51
|
-
}];
|
52
|
-
|
53
52
|
var RotationTab = function RotationTab(_ref) {
|
54
53
|
var images = _ref.images,
|
55
54
|
_ref$disabled = _ref.disabled,
|
56
55
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
56
|
+
var instructionSteps = [{
|
57
|
+
icon: _handMove.default,
|
58
|
+
text: _locale.default.getLocaleText('rotate-plan')
|
59
|
+
}];
|
57
60
|
|
58
61
|
var _useState = (0, _react.useState)(false),
|
59
62
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -88,8 +91,8 @@ var RotationTab = function RotationTab(_ref) {
|
|
88
91
|
var controller = (0, _panzoom.default)(container, {
|
89
92
|
maxZoom: 3,
|
90
93
|
minZoom: 0.5,
|
91
|
-
beforeMouseDown: function beforeMouseDown(
|
92
|
-
return !
|
94
|
+
beforeMouseDown: function beforeMouseDown(event) {
|
95
|
+
return !event.shiftKey;
|
93
96
|
}
|
94
97
|
});
|
95
98
|
controller.on('panstart', function () {
|
@@ -114,7 +117,8 @@ var RotationTab = function RotationTab(_ref) {
|
|
114
117
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
115
118
|
className: "widget-tab__threesixty ".concat(active ? 'widget-tab__threesixty--active' : '')
|
116
119
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
117
|
-
className: "widget-tab__threesixty-container"
|
120
|
+
className: "widget-tab__threesixty-container",
|
121
|
+
onContextMenu: _helpers.preventRightClick
|
118
122
|
}, images.map(function (img, index) {
|
119
123
|
return /*#__PURE__*/_react.default.createElement("img", {
|
120
124
|
src: img,
|
@@ -128,7 +132,7 @@ var RotationTab = function RotationTab(_ref) {
|
|
128
132
|
}, /*#__PURE__*/_react.default.createElement("img", {
|
129
133
|
src: _rotation.default,
|
130
134
|
alt: "start-icon"
|
131
|
-
}), /*#__PURE__*/_react.default.createElement("span", null,
|
135
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, _locale.default.getLocaleText('rotate'))), showInstructions && /*#__PURE__*/_react.default.createElement(_Instructions.default, {
|
132
136
|
disabled: disabled,
|
133
137
|
steps: instructionSteps,
|
134
138
|
onClick: onStart
|
@@ -13,6 +13,8 @@ var _store = _interopRequireDefault(require("../store"));
|
|
13
13
|
|
14
14
|
var _modelStore = _interopRequireDefault(require("../store/modelStore"));
|
15
15
|
|
16
|
+
var _locale = _interopRequireDefault(require("../locale"));
|
17
|
+
|
16
18
|
var _Application = _interopRequireDefault(require("./Application"));
|
17
19
|
|
18
20
|
var _defaultConfig = _interopRequireDefault(require("../config/defaultConfig"));
|
@@ -37,7 +39,7 @@ var Widget = /*#__PURE__*/function () {
|
|
37
39
|
|
38
40
|
_classCallCheck(this, Widget);
|
39
41
|
|
40
|
-
_defineProperty(this, "requiredParams", ['tabs', 'width', 'height', 'API_URL']);
|
42
|
+
_defineProperty(this, "requiredParams", ['tabs', 'width', 'height', 'locale', 'API_URL']);
|
41
43
|
|
42
44
|
var config = _objectSpread(_objectSpread({}, _defaultConfig.default), options);
|
43
45
|
|
@@ -47,6 +49,8 @@ var Widget = /*#__PURE__*/function () {
|
|
47
49
|
|
48
50
|
_store.default.setConfig(config);
|
49
51
|
|
52
|
+
_locale.default.setCurrentLocale(config.locale);
|
53
|
+
|
50
54
|
_reactDom.default.render( /*#__PURE__*/_react.default.createElement(_Application.default, {
|
51
55
|
width: config.width,
|
52
56
|
height: config.height
|
@@ -73,6 +77,8 @@ var Widget = /*#__PURE__*/function () {
|
|
73
77
|
_modelStore.default.removeHouse();
|
74
78
|
|
75
79
|
_store.default.setConfig(newConfig);
|
80
|
+
|
81
|
+
_locale.default.setCurrentLocale(config.locale);
|
76
82
|
}
|
77
83
|
}, {
|
78
84
|
key: "on",
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.deviceOrientationStatuses = void 0;
|
7
|
+
var deviceOrientationStatuses = {
|
8
|
+
GRANTED: 'granted',
|
9
|
+
DENIED: 'denied'
|
10
|
+
};
|
11
|
+
exports.deviceOrientationStatuses = deviceOrientationStatuses;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"research-plan": "Research plan",
|
3
|
+
"rotate-plan": "Rotate plan",
|
4
|
+
"rotate": "Rotate",
|
5
|
+
"plan": "Plan",
|
6
|
+
"off": "Off",
|
7
|
+
"on": "On",
|
8
|
+
"ok": "Ok",
|
9
|
+
"menu": "Menu",
|
10
|
+
"wasd": "WASD",
|
11
|
+
"view-from-above": "View from above",
|
12
|
+
"free-camera": "Free camera",
|
13
|
+
"shadows": "Shadows",
|
14
|
+
"hide-walls": "Hide walls",
|
15
|
+
"show-walls": "Show walls",
|
16
|
+
"hide-doors": "Hide doors",
|
17
|
+
"show-doors": "Show doors",
|
18
|
+
"material": "Material",
|
19
|
+
"texture": "Texture",
|
20
|
+
"color": "Color",
|
21
|
+
"wall-color": "Wall color",
|
22
|
+
"wall-texture": "Wall texture",
|
23
|
+
"upload-wall-texture": "Upload wall texture"
|
24
|
+
}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.default = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
var _mobx = require("mobx");
|
11
|
+
|
12
|
+
var _data = _interopRequireDefault(require("./ru_RU/data.json"));
|
13
|
+
|
14
|
+
var _data2 = _interopRequireDefault(require("./en_US/data.json"));
|
15
|
+
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
|
+
|
18
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
19
|
+
|
20
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
21
|
+
|
22
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
23
|
+
|
24
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
25
|
+
|
26
|
+
(0, _mobx.configure)({
|
27
|
+
useProxies: 'never'
|
28
|
+
});
|
29
|
+
|
30
|
+
var LocaleStore = /*#__PURE__*/function () {
|
31
|
+
function LocaleStore() {
|
32
|
+
var _this = this;
|
33
|
+
|
34
|
+
_classCallCheck(this, LocaleStore);
|
35
|
+
|
36
|
+
_defineProperty(this, "availableLocales", ['ru-RU', 'en-US']);
|
37
|
+
|
38
|
+
_defineProperty(this, "locales", {
|
39
|
+
'ru-RU': _data.default,
|
40
|
+
'en-US': _data2.default
|
41
|
+
});
|
42
|
+
|
43
|
+
_defineProperty(this, "currentLocale", 'en-US');
|
44
|
+
|
45
|
+
_defineProperty(this, "getLocaleText", function (key) {
|
46
|
+
return _this.localeData[key];
|
47
|
+
});
|
48
|
+
|
49
|
+
_defineProperty(this, "setCurrentLocale", function (locale) {
|
50
|
+
if (!_this.availableLocales.some(function (l) {
|
51
|
+
return l === locale;
|
52
|
+
})) return;
|
53
|
+
_this.currentLocale = locale;
|
54
|
+
});
|
55
|
+
|
56
|
+
(0, _mobx.makeAutoObservable)(this);
|
57
|
+
}
|
58
|
+
|
59
|
+
_createClass(LocaleStore, [{
|
60
|
+
key: "localeData",
|
61
|
+
get: function get() {
|
62
|
+
return this.locales[this.currentLocale];
|
63
|
+
}
|
64
|
+
}]);
|
65
|
+
|
66
|
+
return LocaleStore;
|
67
|
+
}();
|
68
|
+
|
69
|
+
var _default = new LocaleStore();
|
70
|
+
|
71
|
+
exports.default = _default;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"research-plan": "Исследовать планировку",
|
3
|
+
"rotate-plan": "Вращать планировку",
|
4
|
+
"rotate": "Вращать",
|
5
|
+
"plan": "Планировка",
|
6
|
+
"off": "Выкл",
|
7
|
+
"on": "Вкл",
|
8
|
+
"ok": "Ок",
|
9
|
+
"menu": "Меню",
|
10
|
+
"wasd": "WASD",
|
11
|
+
"view-from-above": "Обзор сверху",
|
12
|
+
"free-camera": "Свободный обзор",
|
13
|
+
"shadows": "Тени",
|
14
|
+
"hide-walls": "Скрыть стены",
|
15
|
+
"show-walls": "Показать стены",
|
16
|
+
"hide-doors": "Скрыть двери",
|
17
|
+
"show-doors": "Показать двери",
|
18
|
+
"material": "Материал",
|
19
|
+
"texture": "Текстура",
|
20
|
+
"color": "Цвет",
|
21
|
+
"wall-color": "Цвет стен",
|
22
|
+
"wall-texture": "Текстура стен",
|
23
|
+
"upload-wall-texture": "Загрузить текстуру стен"
|
24
|
+
}
|
@@ -9,10 +9,10 @@ exports.default = void 0;
|
|
9
9
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
11
11
|
|
12
|
-
var _screenfull = _interopRequireDefault(require("screenfull"));
|
13
|
-
|
14
12
|
var _mobx = require("mobx");
|
15
13
|
|
14
|
+
var _screenfull = _interopRequireDefault(require("screenfull"));
|
15
|
+
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
17
|
|
18
18
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
@@ -61,7 +61,9 @@ var Events = /*#__PURE__*/function () {
|
|
61
61
|
_classPrivateFieldSet(this, _eventHandlers, {
|
62
62
|
container: {
|
63
63
|
mousedown: function mousedown(e) {
|
64
|
-
|
64
|
+
if (e.button !== 0) return;
|
65
|
+
|
66
|
+
_classPrivateFieldSet(_this, _dragOrigin, e.pageX);
|
65
67
|
},
|
66
68
|
touchstart: function touchstart(e) {
|
67
69
|
return _classPrivateFieldSet(_this, _dragOrigin, e.touches[0].clientX);
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.preventRightClick = void 0;
|
7
|
+
|
8
|
+
var preventRightClick = function preventRightClick(event) {
|
9
|
+
event.preventDefault();
|
10
|
+
};
|
11
|
+
|
12
|
+
exports.preventRightClick = preventRightClick;
|
@@ -63,17 +63,17 @@ var getRoomCoordinates = function getRoomCoordinates(room, walls, vertices) {
|
|
63
63
|
|
64
64
|
exports.getRoomCoordinates = getRoomCoordinates;
|
65
65
|
|
66
|
-
var getScale = function getScale(
|
66
|
+
var getScale = function getScale(_ref, json) {
|
67
|
+
var width = _ref.width,
|
68
|
+
height = _ref.height;
|
67
69
|
if (!json) return {
|
68
70
|
X: 1,
|
69
71
|
Y: 1
|
70
72
|
};
|
71
|
-
var imageWidth = image.width;
|
72
|
-
var imageHeight = image.height;
|
73
73
|
var baseImageWidth = 1024;
|
74
|
-
var baseImageHeight =
|
75
|
-
var deltaX =
|
76
|
-
var deltaY =
|
74
|
+
var baseImageHeight = height * (baseImageWidth / width);
|
75
|
+
var deltaX = width / baseImageWidth / json.Scale.X;
|
76
|
+
var deltaY = height / baseImageHeight / json.Scale.X;
|
77
77
|
return {
|
78
78
|
X: deltaX,
|
79
79
|
Y: deltaY
|
@@ -88,8 +88,8 @@ var getCameraFromSrc = function getCameraFromSrc(json, src) {
|
|
88
88
|
var cameraIdIndex = src.toLowerCase().indexOf(cameraIdBeginning);
|
89
89
|
if (cameraIdIndex === -1) return null;
|
90
90
|
var cameraId = (0, _imageExtentions.removeExtention)(src.substring(cameraIdIndex));
|
91
|
-
return ((_json$Floors$0$Camera = json.Floors[0].CameraPoints) === null || _json$Floors$0$Camera === void 0 ? void 0 : _json$Floors$0$Camera.find(function (
|
92
|
-
var ID =
|
91
|
+
return ((_json$Floors$0$Camera = json.Floors[0].CameraPoints) === null || _json$Floors$0$Camera === void 0 ? void 0 : _json$Floors$0$Camera.find(function (_ref2) {
|
92
|
+
var ID = _ref2.ID;
|
93
93
|
return ID === cameraId;
|
94
94
|
})) || null;
|
95
95
|
};
|
package/package.json
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
"description": "HART Estate widget",
|
4
4
|
"author": "HART",
|
5
5
|
"keywords": [],
|
6
|
-
"version": "0.0.
|
6
|
+
"version": "0.0.54",
|
7
7
|
"private": false,
|
8
8
|
"main": "build/index.js",
|
9
9
|
"module": "build/index.js",
|
@@ -11,6 +11,9 @@
|
|
11
11
|
"build",
|
12
12
|
"README.md"
|
13
13
|
],
|
14
|
+
"engines": {
|
15
|
+
"node": "^16.0.0"
|
16
|
+
},
|
14
17
|
"scripts": {
|
15
18
|
"start": "npm run build:sass && babel src --watch -d build --copy-files",
|
16
19
|
"start-example": "cd ./example && npm run start",
|
@@ -1,11 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.deviceOrientationStatus = void 0;
|
7
|
-
var deviceOrientationStatus = {
|
8
|
-
GRANTED: 'granted',
|
9
|
-
DENIED: 'denied'
|
10
|
-
};
|
11
|
-
exports.deviceOrientationStatus = deviceOrientationStatus;
|