fix: Expand the world info viewer so you can see content (#25)

Also update to latest x_ite.d.ts
  Resolves #22.

Reviewed-on: #25
Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Co-committed-by: Glen Whitney <glen@studioinfinity.org>
This commit is contained in:
Glen Whitney 2023-09-18 02:05:19 +00:00 committed by Glen Whitney
parent af472d7bfe
commit 285554137d
2 changed files with 96 additions and 16 deletions

View file

@ -6,7 +6,24 @@ certainlyHandled := '.x3d .gltf .glb .obj .stl .ply'.split ' '
// The next line will need to change when we handle pages with more than
// one link, since we will potentially need a canvas for each one.
canvas := X3D.createBrowser()
$(canvas).css width: '150px', height: '150px'
// Fix up the css so the browser is a nice size and we can see the world info
$(canvas).css width: '150px', height: '150px', overflow: 'visible'
x_ite_shadow := canvas.shadowRoot
if x_ite_shadow
x_ite_style := x_ite_shadow.querySelector('link')
if x_ite_style
$(x_ite_style).after '<style type="text/css">
.x_ite-private-world-info-overlay {
inset: unset;
width: 300px;
height: 300px;
}</style>'
x_ite_browser := x_ite_shadow.querySelector '.x_ite-private-browser'
if x_ite_browser
$(x_ite_browser).css overflow: 'visible'
// Now get the browser and load the requested VRML, converting if need be
browser := X3D.getBrowser canvas
browser.setBrowserOption 'StraightenHorizon', false
site := $('a[href^="http"]')