From d8fd1897623e91765cc904a4d28bdc0c33f33d1e Mon Sep 17 00:00:00 2001 From: CanadaHonk Date: Tue, 13 Dec 2022 15:08:30 +0000 Subject: [PATCH] gludoom: initial add --- README.md | 1 + gludoom/index.js | 36 ++++++++++++++++++++++++++++++++++++ gludoom/package.json | 1 + 3 files changed, 38 insertions(+) create mode 100644 gludoom/index.js create mode 100644 gludoom/package.json 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