YagoLopez/vrview-react

View on GitHub
public/vrview/vrview.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html lang="en">
<head>
  <title>VR view</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  <meta name="mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
  <style type="text/css">
    html, body {
      background-color: #000;
      color: #eee;
      margin: 0;
      padding: 0;
      position: fixed;
      overflow: hidden;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      /* Prevent user selection. */
      user-select: none;
      touch-callout: none;
      -webkit-touch-callout: none;
      -webkit-user-select: none;
    }
    .dialog {
      display: none;
      align-items: center;
      justify-content: center;
      font-family: sans-serif;
      font-size: 170%;
      position: absolute;
      width: 100%;
      height: 100%;
      background: rgba(255, 255, 255, 0.2);
      -webkit-user-select: none;
      -moz-user-select: none;
      user-select: none;
    }
    .dialog.visible {display: flex}
    .dialog .wrap {
      padding: 30px 60px;
      margin: 20px auto;
      width: 60%;
      background: rgba(0, 0, 0, 0.8);
      border-radius: 5px;
    }
    .dialog h1 {margin: 0}
    a, a:visited {color: skyblue}
    #watermark img {
      position: fixed;
      overflow: hidden;
      left: 0;
      bottom: 0;
      opacity: 0.3;
      width: 24px;
      height: 24px;
      padding: 12px;
      -webkit-user-select: none;
      -moz-user-select: none;
      user-select: none;
    }
    #watermark img:hover {opacity: 1; -webkit-filter: drop-shadow(white 0 0 5px)}
    canvas {cursor: -webkit-grab}
    canvas:active {cursor: -webkit-grabbing}
    #play-overlay {
      position: fixed;
      width: 100%;
      height: 100%;
      left: 0;
      top: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, 0.5);
      display: none;
      align-items: center;
      justify-content: center;
    }
    #play-overlay.visible {display: flex}
    #play-overlay img {width: 30%; height: 30%}
    #error .message {font-family: monospace}
  </style>
</head>

<body>
  <div id="loader" class="dialog">Loading</div>
  <div id="error" class="dialog">
    <div class="wrap">
      <h1 class="title">Error</h1>
      <p class="message">An unknown error occurred</p>
    </div>
  </div>
  <div id="play-overlay"><img src="ic_play_arrow_white_24dp.svg" /></div>
  <a id="watermark" href="info.html" target="_blank"><img src="ic_info_outline_black_24dp.svg" /></a>
  <script>
    WebVRConfig = {
      BUFFER_SCALE: 0.5,
      TOUCH_PANNER_DISABLED: false
    };
  </script>
  <script src="three.js"></script>
  <script src="embed.js"></script>
</body>

</html>