gludoom: initial add

This commit is contained in:
CanadaHonk 2022-12-13 15:08:30 +00:00
parent e6cac49f8c
commit d8fd189762
3 changed files with 38 additions and 0 deletions

View File

@ -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)
<br>

36
gludoom/index.js Normal file
View File

@ -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);
}
});
})();

1
gludoom/package.json Normal file
View File

@ -0,0 +1 @@
{ "type": "module" }