index.html 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <!DOCTYPE html>
  2. <!-- Copyright 2012 United States Government, as represented by the Secretary of Defense, Under -->
  3. <!-- Secretary of Defense (Personnel & Readiness). -->
  4. <!-- -->
  5. <!-- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file -->
  6. <!-- except in compliance with the License. You may obtain a copy of the License at -->
  7. <!-- -->
  8. <!-- http://www.apache.org/licenses/LICENSE-2.0 -->
  9. <!-- -->
  10. <!-- Unless required by applicable law or agreed to in writing, software distributed under the -->
  11. <!-- License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -->
  12. <!-- either express or implied. See the License for the specific language governing permissions -->
  13. <!-- and limitations under the License. -->
  14. <html>
  15. <!-- The Virtual World Framework client is a collection of scripts and a world specification -->
  16. <!-- passed to an initialization call. In this sample, the world specification is provided -->
  17. <!-- inline for clarity, but it is normally provided by the reflector or may be specified as a -->
  18. <!-- URI and loaded from a network-visible location. -->
  19. <head>
  20. <title>Virtual World Framework</title>
  21. <link rel="icon" type="image/x-icon" href="favicon.ico" />
  22. <meta name="viewport" content="initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  23. <script type="text/javascript" src="compatibilitycheck.js"></script>
  24. <script type="text/javascript" src="socket.io/socket.io.js"></script>
  25. <!-- <script type="text/javascript" src="socket.io-sessionid-patch.js"></script> -->
  26. <script src="vwf/view/webrtc/dist/adapter-latest.js"></script>
  27. <script type="text/javascript" src="vwf/view/lib/cell.js"></script>
  28. <script type="text/javascript" src="vwf/view/lib/he.js"></script>
  29. <script type="text/javascript" src="vwf/view/lib/draggabilly.pkgd.js"></script>
  30. <script type="text/javascript" src="js/screenfull.min.js"></script>
  31. <!-- <script type="text/javascript" src="vwf/view/lib/polyglot/polyglot.min.js"></script> -->
  32. <link rel="stylesheet" href="vwf/view/lib/mdc/dist/material-components-web.css">
  33. <script src="vwf/view/lib/mdc/dist/material-components-web.js"></script>
  34. <script type="text/javascript" src="require.js"></script>
  35. <script type="text/javascript" src="async.js"></script>
  36. <script type="text/javascript" src="crypto.js"></script>
  37. <script type="text/javascript" src="md5.js"></script>
  38. <script type="text/javascript" src="alea.js"></script>
  39. <script type="text/javascript" src="mash.js"></script>
  40. <script type="text/javascript" src="Class.create.js"></script>
  41. <script type="text/javascript" src="rAF.js"></script>
  42. <script type="text/javascript" src="performance.now-polyfill.js"></script>
  43. <!-- This is the main client library. vwf.js creates a framework manager and attaches it to -->
  44. <!-- the global window object as window.vwf. All access to the framework is through that -->
  45. <!-- reference, and no other objects are globally visible. -->
  46. <script type="text/javascript" src="vwf.js"></script>
  47. <!-- The core framework manages the simulation and synchronizes it across worlds shared by -->
  48. <!-- multiple users. But, the manner in which the simulation is expressed is controlled by -->
  49. <!-- extension modules. There are two flavors. Models directly control the simulation but -->
  50. <!-- cannot accept external input. The model configuration is identical for all participants -->
  51. <!-- in a shared world. Views may accept external input -such as pointer and key events or -->
  52. <!-- directives from a connection to an outside engine that is not visible to all users- but -->
  53. <!-- may only affect the simulation indirectly through the synchronization server. -->
  54. <script type="text/javascript">
  55. // Users can specify which libraries the application will load by adding parameters to the URL.
  56. // Model libraries are specified as a query parameter and view libraries as a hash fragment.
  57. var queryString = window.location.search.substring(1);
  58. var hashString = window.location.hash.substring(2);
  59. var userLibraries = { model: {}, view: {} };
  60. var googleEarth = false;
  61. var match;
  62. var application;
  63. var regex = /([^&=]+)=?([^&]*)/g;
  64. var requireConfig = {
  65. paths: {
  66. jquery: "jquery-1.10.2.min",
  67. "jquery-ui": "jquery-ui-1.10.3.custom.min"
  68. },
  69. shim: {
  70. "jquery-ui": {
  71. deps: ["jquery"],
  72. exports: "$"
  73. },
  74. "jquery-encoder-0.1.0": ["jquery"]
  75. }
  76. };
  77. require(requireConfig, ["jquery", "jquery-encoder-0.1.0"], function ($) {
  78. while (match = regex.exec(queryString)) {
  79. var key = $.encoder.canonicalize(match[1]);
  80. var parameters = $.encoder.canonicalize(match[2]);
  81. if (key == "application") {
  82. // Get the application specification if one is provided in the query string.
  83. application = parameters;
  84. }
  85. else {
  86. try {
  87. parameters = JSON.parse(parameters);
  88. }
  89. catch (e) {
  90. }
  91. userLibraries["model"]["vwf/model/" + key] = (parameters && parameters != "") ? parameters : undefined;
  92. }
  93. }
  94. while (match = regex.exec(hashString)) {
  95. var key = $.encoder.canonicalize(match[1]);
  96. var parameters = $.encoder.canonicalize(match[2]);
  97. try {
  98. parameters = JSON.parse(parameters);
  99. }
  100. catch (e) {
  101. }
  102. userLibraries["view"]["vwf/view/" + key] = (parameters && parameters != "") ? parameters : undefined;
  103. if (key == "google-earth") {
  104. googleEarth = true;
  105. }
  106. }
  107. googleEarth && document.write("<scr" + "ipt type='text/javascript' src='http://www.google.com/jsapi?hl=en&amp;key=ABQIAAAAwbkbZLyhsmTCWXbTcjbgbRSzHs7K5SvaUdm8ua-Xxy_-2dYwMxQMhnagaawTo7L1FE1-amhuQxIlXw'></scr" + "ipt>");
  108. vwf.loadConfiguration(application, userLibraries, compatibilityCheck);
  109. });
  110. </script>
  111. <!-- This is the common view implementation and an example view that summarizes the -->
  112. <!-- simulation state in HTML on the main page. -->
  113. <link rel="stylesheet" type="text/css" href="index.css" />
  114. <!-- Global Site Tag (gtag.js) - Google Analytics -->
  115. <script async src="https://www.googletagmanager.com/gtag/js?id=UA-11815598-9"></script>
  116. <script>
  117. window.dataLayer = window.dataLayer || [];
  118. function gtag() { dataLayer.push(arguments) };
  119. gtag('js', new Date());
  120. gtag('config', 'UA-11815598-9');
  121. </script>
  122. </head>
  123. <body class="mdc-typography">
  124. <!-- Generic clients may have nearly empty pages, but pages for custom clients may be laid -->
  125. <!-- out in any manner desired. Any view and models that render to the page should be -->
  126. <!-- instructed where to attach their content. -->
  127. <!-- The main content renders to "#vwf-root", the item with the id "vwf-root". -->
  128. <!-- The loading spinner -->
  129. <div id="vwf-loading-spinner" class="pace pace-active">
  130. <div class="pace-activity"></div>
  131. </div>
  132. <div id="incompatibleBrowser">
  133. <div>
  134. <span style="color:#3090C7;">
  135. <br/>
  136. <br/>Your browser does not support Virtual World Framework. Please review our
  137. <a href='https://virtual.wf/requirements.html'>requirements</a> for supported browser versions.</span>
  138. </div>
  139. </div>
  140. <div id="vwf-root"></div>
  141. <div id="ui-controls" class="guiwindow">
  142. <i id="hideui" class="mdc-icon-toggle material-icons" role="button" aria-pressed="true" aria-label="Hide Toollbar" tabindex="0"
  143. data-toggle-on='{"label": "Hide", "content": "grid_on"}' data-toggle-off='{"label": "Show", "content": "grid_off"}'>
  144. grid_on
  145. </i>
  146. <i id="fullscreenui" class="mdc-icon-toggle material-icons" role="button" aria-pressed="true" aria-label="Hide Toollbar" tabindex="0"
  147. data-toggle-on='{"label": "Hide", "content": "fullscreen"}' data-toggle-off='{"label": "Show", "content": "fullscreen_exit"}'>
  148. fullscreen
  149. </i>
  150. </div>
  151. <script>
  152. mdc.autoInit();
  153. window.addEventListener("load", function (event) {
  154. console.log("All resources finished loading!");
  155. });
  156. const iconEl = document.querySelector('#hideui');
  157. iconEl.addEventListener('MDCIconToggle:change', (e) => {
  158. let ui = document.querySelector('.mdc-toolbar');
  159. if (ui) {
  160. let chkAttr = e.detail.isOn;
  161. if (chkAttr) {
  162. ui.style.visibility = 'visible'
  163. } else {
  164. ui.style.visibility = 'hidden'
  165. }
  166. }
  167. });
  168. const fullScreenToggle = document.querySelector('#fullscreenui');
  169. fullScreenToggle.addEventListener('MDCIconToggle:change', (e) => {
  170. if (screenfull.enabled) {
  171. screenfull.toggle();
  172. } else {
  173. // Ignore or do something else
  174. }
  175. });
  176. </script>
  177. </body>
  178. </html>