forked from xiconxi/QGF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mpview.html
1 lines (1 loc) · 2.44 KB
/
mpview.html
1
<!doctypehtml><html lang=en-us><head><meta charset=utf-8><meta content="text/html; charset=utf-8"http-equiv=Content-Type><style>body{margin:0;padding:0;overflow:hidden}.emscripten{padding-right:0;margin-left:auto;margin-right:auto;display:block}div.emscripten{text-align:center}canvas.emscripten{border:0 none;padding:0;background-color:#fff;width:100vw;height:100vh;max-height:100vh;display:block;overflow:hidden}</style></head><body><div class=emscripten id=status>Downloading...</div><div class=emscripten><progress hidden id=progress max=100 value=0></progress></div><canvas class=emscripten id=canvas oncontextmenu=event.preventDefault()></canvas><script>var statusElement=document.getElementById("status"),progressElement=document.getElementById("progress");function getUrlVars(){var o={};window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(e,t,n){o[t]=n});return o}var Module={preRun:[function(){window.frameElement&&window.frameElement.hasAttribute("controls")&&(console.log("show gui"),Module.arguments.push("-g"));var e=getUrlVars().model;if(!e&&window.frameElement&&window.frameElement.hasAttribute("model")&&(e=window.frameElement.getAttribute("model")),e){var t=e.split("/").pop();console.log("reading "+e),Module.arguments=[t],FS.createPreloadedFile("./",t,e,!0,!1)}}],postRun:[],print:function(e){console.log(e)},printErr:function(e){console.error(e)},canvas:function(){var e=document.getElementById("canvas");return e.addEventListener("webglcontextlost",function(e){alert("WebGL context lost. You will need to reload the page."),e.preventDefault()},!1),e}(),setStatus:function(e){if(Module.setStatus.last||(Module.setStatus.last={time:Date.now(),text:""}),e!==Module.setStatus.text){var t=e.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/),n=Date.now();t&&n-Date.now()<30||(progressElement.hidden=t?(e=t[1],progressElement.value=100*parseInt(t[2]),progressElement.max=100*parseInt(t[4]),!1):(progressElement.value=null,!(progressElement.max=null)),statusElement.innerHTML=e)}},totalDependencies:0,monitorRunDependencies:function(e){this.totalDependencies=Math.max(this.totalDependencies,e),Module.setStatus(e?"Preparing... ("+(this.totalDependencies-e)+"/"+this.totalDependencies+")":"All downloads complete.")}};Module.setStatus("Downloading..."),window.onerror=function(){Module.setStatus("Exception thrown, see JavaScript console"),Module.setStatus=function(e){e&&Module.printErr("[post-exception status] "+e)}}</script><script async src=mpview.js></script></body></html>