Skip to content

Commit a179ec6

Browse files
committed
Sample web editor: Scripting prototype, node inspect fixes
1 parent 4abb0e6 commit a179ec6

4 files changed

Lines changed: 197 additions & 15670 deletions

File tree

shell.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
<script type="importmap">
1111
{
1212
"imports": {
13-
"lexgui": "https://cdn.skypack.dev/lexgui/build/lexgui.module.js"
13+
"lexgui": "https://cdn.skypack.dev/lexgui/build/lexgui.module.js",
14+
"lexgui/components/": "https://cdn.skypack.dev/lexgui/build/components/"
1415
}
1516
}
1617
</script>
1718
</head>
1819

1920
<body>
20-
<button id="xr-button" style="z-index:10;position:absolute;top:5%;left:1%" disabled>WebXR or WebGPU not supported</button>
21+
<button id="xr-button" style="z-index:10;position:absolute;top:1%;left:30%" disabled>WebXR or WebGPU not supported</button>
2122
<canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()" tabindex=-1
2223
style="height:100%;width:100%;resize:both;outline:none;"></canvas>
2324
<template id="main-script">

www/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!doctypehtml><html lang=en-us><head><meta charset=utf-8><meta content="text/html; charset=utf-8"http-equiv=Content-Type><title>Web-wgpuEngine</title><link href=https://cdn.skypack.dev/lexgui/build/lexgui.css rel=stylesheet><script src=https://mrdoob.github.io/stats.js/build/stats.min.js></script><script type=importmap>{
22
"imports": {
3-
"lexgui": "./lexgui.module.js"
3+
"lexgui": "https://cdn.skypack.dev/lexgui/build/lexgui.module.js",
4+
"lexgui/components/": "https://cdn.skypack.dev/lexgui/build/components/"
45
}
5-
}</script></head><body><button disabled id=xr-button style=z-index:10;position:absolute;top:5%;left:1%>WebXR or WebGPU not supported</button><canvas class=emscripten id=canvas oncontextmenu=event.preventDefault() style=height:100%;width:100%;resize:both;outline:0 tabindex=-1></canvas><template id=main-script><script src=index.js async></script></template><script>var Module={html5ResizeTarget:"#canvas-area",preRun:[],postRun:[],canvas:document.getElementById("canvas"),totalDependencies:0};async function onEnginePreInitialized(){await Promise.resolve(Module.Engine.getInstance()).then((e=>{e||console.error("Module Instance is null"),window.engineInstance=e})).catch((e=>{console.log(e)})),Promise.resolve(window.engineInstance.setWasmModuleInitialized(!0)).then().catch((e=>{console.log(e)}))}function onEngineInitialized(){var e=document.createElement("script");e.type="module",e.src="./script.js",e.async=!1,document.getElementsByTagName("head")[0].appendChild(e)}(async()=>{if(!navigator.gpu){console.error("Sorry, WebGPU is not supported by your browser.");const e=document.createElement("div");return Object.assign(e.style,{width:"50%",fontSize:"36px",fontWeight:"500",textAlign:"center",margin:"0 auto",marginTop:"25%"}),e.innerText="Sorry, WebGPU is not supported by your browser.",void document.body.appendChild(e)}{const e=document.getElementById("main-script").content.cloneNode(!0);document.body.appendChild(e)}})()</script></body></html>
6+
}</script></head><body><button disabled id=xr-button style=z-index:10;position:absolute;top:1%;left:30%>WebXR or WebGPU not supported</button><canvas class=emscripten id=canvas oncontextmenu=event.preventDefault() style=height:100%;width:100%;resize:both;outline:0 tabindex=-1></canvas><template id=main-script><script src=index.js async></script></template><script>var Module={html5ResizeTarget:"#canvas-area",preRun:[],postRun:[],canvas:document.getElementById("canvas"),totalDependencies:0};async function onEnginePreInitialized(){await Promise.resolve(Module.Engine.getInstance()).then((e=>{e||console.error("Module Instance is null"),window.engineInstance=e})).catch((e=>{console.log(e)})),Promise.resolve(window.engineInstance.setWasmModuleInitialized(!0)).then().catch((e=>{console.log(e)}))}function onEngineInitialized(){var e=document.createElement("script");e.type="module",e.src="./script.js",e.async=!1,document.getElementsByTagName("head")[0].appendChild(e)}(async()=>{if(!navigator.gpu){console.error("Sorry, WebGPU is not supported by your browser.");const e=document.createElement("div");return Object.assign(e.style,{width:"50%",fontSize:"36px",fontWeight:"500",textAlign:"center",margin:"0 auto",marginTop:"25%"}),e.innerText="Sorry, WebGPU is not supported by your browser.",void document.body.appendChild(e)}{const e=document.getElementById("main-script").content.cloneNode(!0);document.body.appendChild(e)}})()</script></body></html>

0 commit comments

Comments
 (0)