UNPKG

react-pannellum-next

Version:

The `PanoramaViewer` component is a React component that provides a panoramic image viewer using the Pannellum library. It allows you to display a 360-degree image and add interactive hotspots to it.

671 lines (576 loc) 11.3 kB
.pnlm-container { cursor: default; -webkit-user-select: none; user-select: none; -khtml-user-select: none; -o-user-select: none; contain: content; direction: ltr; background: #f4f4f4 url("background.ddff5602.svg"); outline: 0; width: 100%; height: 100%; margin: 0; padding: 0; line-height: 1.4; position: relative; overflow: hidden; } .pnlm-container, .pnlm-load-button { font-family: Helvetica, Nimbus Sans L, Liberation Sans, Arial, sans-serif; } .pnlm-container * { box-sizing: content-box; } .pnlm-ui { z-index: 2; width: 100%; height: 100%; position: absolute; } .pnlm-grab { cursor: grab; cursor: url("grab.852c245a.svg") 12 8, default; } .pnlm-grabbing { cursor: grabbing; cursor: url("grabbing.08455ff1.svg") 12 8, default; } .pnlm-sprite { background-image: url("sprites.094e1ff8.svg"); } .pnlm-container:fullscreen { width: 100% !important; height: 100% !important; position: static !important; } .pnlm-container:fullscreen { width: 100% !important; height: 100% !important; position: static !important; } .pnlm-render-container { cursor: inherit; width: 100%; height: 100%; position: absolute; } .pnlm-controls { cursor: pointer; z-index: 3; background-color: #fff; border: 1px solid #0006; border-radius: 3px; margin-top: 4px; transform: translateZ(9999px); } .pnlm-control:hover { background-color: #f8f8f8; } .pnlm-controls-container { z-index: 2; position: absolute; top: 0; left: 4px; } .pnlm-zoom-controls { width: 26px; height: 52px; } .pnlm-zoom-in { border-radius: 3px 3px 0 0; width: 100%; height: 50%; position: absolute; top: 0; } .pnlm-zoom-out { background-position: 0 -26px; border-top: 1px solid #0000001a; border-radius: 0 0 3px 3px; width: 100%; height: 50%; position: absolute; bottom: 0; } .pnlm-fullscreen-toggle-button, .pnlm-orientation-button, .pnlm-hot-spot-debug-indicator { width: 26px; height: 26px; } .pnlm-hot-spot-debug-indicator { background-color: #ffffff80; border-radius: 13px; width: 26px; height: 26px; margin: -13px 0 0 -13px; display: none; position: absolute; top: 50%; left: 50%; } .pnlm-orientation-button-inactive { background-position: 0 -156px; } .pnlm-orientation-button-active { background-position: 0 -182px; } .pnlm-fullscreen-toggle-button-inactive { background-position: 0 -52px; } .pnlm-fullscreen-toggle-button-active { background-position: 0 -78px; } .pnlm-panorama-info { color: #fff; text-align: left; z-index: 3; background-color: #000000b3; border-radius: 0 3px 3px 0; padding-right: 10px; display: none; position: absolute; bottom: 4px; transform: translateZ(9999px); } .pnlm-title-box { margin-bottom: 3px; padding-left: 5px; font-size: 20px; display: table; position: relative; } .pnlm-author-box { padding-left: 5px; font-size: 12px; display: table; position: relative; } .pnlm-load-box { text-align: center; color: #fff; background-color: #000000b3; border-radius: 3px; width: 200px; height: 150px; margin: -75px 0 0 -100px; font-size: 20px; display: none; position: absolute; top: 50%; left: 50%; } .pnlm-load-box p { margin: 20px 0; } .pnlm-lbox { width: 20px; height: 20px; margin: -10px 0 0 -10px; display: none; position: absolute; top: 50%; left: 50%; } .pnlm-loading { background-color: #fff; width: 10px; height: 10px; animation-name: pnlm-mv; animation-duration: 1.5s; animation-timing-function: linear; animation-iteration-count: infinite; position: relative; } @keyframes pnlm-mv { from { top: 0; left: 0; } 25% { top: 0; left: 10px; } 50% { top: 10px; left: 10px; } 75% { top: 10px; left: 0; } to { top: 0; left: 0; } } .pnlm-load-button { color: #fff; cursor: pointer; background-color: #000000b3; border: none; border-radius: 3px; width: 200px; height: 100px; margin: -50px 0 0 -100px; padding: 0; font-size: 20px; line-height: 1.4; display: inline-block; position: absolute; top: 50%; left: 50%; } .pnlm-load-button:hover { background-color: #000c; } .pnlm-load-button:focus { outline: none; box-shadow: inset 0 0 0 1px #fff; } .pnlm-load-button div { text-align: center; width: 100%; display: table; } .pnlm-load-button p { vertical-align: middle; display: table-cell; } .pnlm-info-box { text-align: center; color: #fff; table-layout: fixed; z-index: 2; background-color: #000; border-radius: 3px; width: 200px; height: 150px; margin: -75px 0 0 -100px; font-size: 15px; display: table; position: absolute; top: 50%; left: 50%; } .pnlm-info-box a, .pnlm-author-box a { color: #fff; word-wrap: break-word; overflow-wrap: break-word; } .pnlm-info-box p { vertical-align: middle; padding: 0 5px; display: table-cell; } .pnlm-error-msg { display: none; } .pnlm-interaction-msg { pointer-events: none; opacity: 1; background: #000000b3; width: 100%; height: 100%; margin: 0; transition: opacity .3s ease-in-out; display: none; top: 0; left: 0; } .pnlm-outline { border: 1px solid #fff; border-radius: 3px; padding: 0 2px; } .pnlm-about-msg { color: #fff; opacity: 0; -o-transition: opacity .3s ease-in-out; z-index: 2; background: #000000b3; border-radius: 3px; padding: 5px 8px; font-size: 11px; line-height: 11px; transition: opacity .3s ease-in-out; display: none; position: absolute; top: 50px; left: 50px; } .pnlm-about-msg a:link, .pnlm-about-msg a:visited { color: #fff; } .pnlm-about-msg a:hover, .pnlm-about-msg a:active { color: #eee; } .pnlm-hotspot-base { visibility: hidden; cursor: default; vertical-align: middle; z-index: 1; position: absolute; top: 0; } .pnlm-hotspot-base:hover ~ .pnlm-hotspot-base { z-index: 0; } .pnlm-hotspot { border-radius: 13px; width: 26px; height: 26px; } .pnlm-hotspot:hover { background-color: #fff3; } .pnlm-hotspot.pnlm-info { background-position: 0 -104px; } .pnlm-hotspot.pnlm-scene { background-position: 0 -130px; } div.pnlm-tooltip span { visibility: hidden; color: #fff; text-align: center; cursor: default; background-color: #000000b3; border-radius: 3px; max-width: 200px; margin-left: -220px; padding: 5px 10px; position: absolute; } div.pnlm-tooltip:hover span { visibility: visible; } div.pnlm-tooltip:hover span:after { content: ""; border: 10px solid #0000; border-top-color: #000000b3; width: 0; height: 0; margin: 0 50%; position: absolute; bottom: -20px; left: -10px; } .pnlm-compass { cursor: default; background-image: url("compass.2a51dc48.svg"); border-radius: 25px; width: 50px; height: 50px; display: none; position: absolute; bottom: 4px; right: 4px; } .pnlm-world { position: absolute; top: 50%; left: 50%; } .pnlm-face { -webkit-transform-origin: 0 0 0; transform-origin: 0 0 0; position: absolute; } .pnlm-dragfix, .pnlm-preview-img { width: 100%; height: 100%; position: absolute; } .pnlm-preview-img { background-position: center; background-size: cover; } .pnlm-lbar { border: 1px solid #fff; width: 150px; height: 6px; margin: 0 auto; } .pnlm-lbar-fill { background: #fff; width: 0; height: 100%; } .pnlm-lmsg { font-size: 12px; } .pnlm-fade-img { position: absolute; top: 0; left: 0; } .pnlm-pointer { cursor: pointer; } #textInfo .tooltip-content { pointer-events: none; color: #fff; opacity: 0; transform-origin: 50% calc(100% + 6em); -webkit-transition: opacity .5s, -webkit-transform .5s; transition: opacity .5s, transform .5s; background-color: #333; width: 200px; padding: .8em; font-size: 1.6em; line-height: 1.2em; transition-timing-function: ease, cubic-bezier(.17, .67, .4, 1.39); position: absolute; bottom: 80px; left: -70px; transform: rotate3d(0, 0, 1, 15deg); } #textInfo:hover { z-index: 3; } #textInfo:hover .tooltip-content { opacity: 1; pointer-events: all; transform: translate3d(0, 0, 0)rotate3d(0, 0, 0, 0); } #textInfo .hotspot { cursor: pointer; box-sizing: border-box; } #textInfo .hotspot .out:before { speak: none; font-variant: normal; text-transform: none; -webkit-font-smoothing: antialiased; font-size: 48px; font-style: normal; font-weight: normal; line-height: 90px; display: block; } #textInfo .hotspot .out { -webkit-transition: -webkit-transform .1s ease-out, border .2s; -moz-transition: -moz-transform .1s ease-out, border .2s; box-sizing: border-box; border: 5px solid #fffc; border-radius: 50%; width: 60px; height: 60px; transition: transform .1s ease-out, border .2s; } #textInfo .hotspot .in { -webkit-transition: -webkit-transform .1s ease-out, background .2s; -moz-transition: -moz-transform .1s ease-out, background .2s; background-color: #fffc; border-radius: 50%; width: 40px; height: 40px; transition: transform .1s ease-out, background .2s; position: absolute; top: 10px; left: 10px; } #textInfo .hotspot .out:after { z-index: -1; opacity: 0; pointer-events: none; content: ""; box-sizing: content-box; border-radius: 50%; width: 100%; height: 100%; padding: 0; position: absolute; top: 0; left: 0; transform: scale(.9); box-shadow: 0 0 0 2px #ffffff1a; } #textInfo .hotspot:hover .out { color: #fff; border: 5px solid #fff; transform: scale(.9); } #textInfo .hotspot:hover .in { background-color: #fff; transform: scale(.8); } #textInfo .hotspot:hover .out:after { animation: 1.2s ease-out sonarEffect; } @-webkit-keyframes sonarEffect { 0% { opacity: .5; } 20% { opacity: .8; box-shadow: 0 0 0 2px #ffffff1a, 0 0 10px 10px #25aae1cc, 0 0 0 10px #ffffff80; } 100% { opacity: 0; -webkit-transform: scale(1.5); box-shadow: 0 0 0 2px #ffffff1a, 0 0 10px 10px #25aae1cc, 0 0 0 10px #ffffff80; } } @-moz-keyframes sonarEffect { 0% { opacity: .5; } 20% { opacity: .8; box-shadow: 0 0 0 2px #ffffff1a, 0 0 10px 10px #25aae1cc, 0 0 0 10px #ffffff80; } 100% { opacity: 0; -moz-transform: scale(1.5); box-shadow: 0 0 0 2px #ffffff1a, 0 0 10px 10px #25aae1cc, 0 0 0 10px #ffffff80; } } @keyframes sonarEffect { 0% { opacity: .5; } 20% { opacity: .8; box-shadow: 0 0 0 2px #ffffff1a, 0 0 10px 10px #25aae1cc, 0 0 0 10px #ffffff80; } 100% { opacity: 0; transform: scale(1.5); box-shadow: 0 0 0 2px #ffffff1a, 0 0 10px 10px #25aae1cc, 0 0 0 10px #ffffff80; } } .custom-hotspot { background-color: #ffffff80; border-radius: 100%; width: 30px; height: 30px; animation: 1.5s ease-in-out infinite pulsate-in; } @keyframes pulsate { 0% { opacity: 1; box-shadow: 0 0 #ffffff80; } 50% { opacity: .7; box-shadow: 0 0 0 30px #fff0; } 100% { opacity: 1; box-shadow: 0 0 #ffffff80; } } @keyframes pulsate-in { 0% { opacity: 1; box-shadow: 0 0 0 25px #ffffff40; } 100% { box-shadow: 0 0 #fff0; } } .custom-hotspot:hover { background-color: #0ff; } /*# sourceMappingURL=index.css.map */