diff --git a/README.md b/README.md index 1ca36aa..422265a 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Gluon is currently **barely 1 week old**, so is still in an **early and experime ### Apps - [Gluworld](gluworld): Hello World demo app with version info shown +- [Gludoom](gludoom): Simple demo app - Doom running as WASM, made into a native looking app with Gluon - [Glucord](glucord): minimal desktop Discord client loading official webapp (demo/example)
diff --git a/gludoom/index.js b/gludoom/index.js new file mode 100644 index 0000000..ad96779 --- /dev/null +++ b/gludoom/index.js @@ -0,0 +1,36 @@ +import * as Gluon from '../gluon/index.js'; + +(async () => { + // Load existing site with WASM doom + await Gluon.open(`https://silentspacemarine.com`, { + windowSize: [ 760, 600 ], + onLoad: () => { + // Wait until fully loaded + setTimeout(() => { + // Inject CSS to remove border / padding + const el = document.createElement('style'); + el.appendChild(document.createTextNode(` +body, html, #container, #monitor { + overflow: hidden; + max-width: unset; + margin: 0; + padding: 0; + border: 0; + border-radius: 0; + + width: 100%; + height: 100%; +} + +#monitor:after { + display: none; +}`)); + document.body.appendChild(el); + + // Force window title to our own + document.title = `Gludoom (${Gluon.versions.product} ${Gluon.versions.browser})`; + Object.defineProperty(document, 'title', { get() {}, set() {} }); + }, 1000); + } + }); +})(); \ No newline at end of file diff --git a/gludoom/package.json b/gludoom/package.json new file mode 100644 index 0000000..bb34440 --- /dev/null +++ b/gludoom/package.json @@ -0,0 +1 @@ +{ "type": "module" } \ No newline at end of file