gludoom: initial add
This commit is contained in:
parent
e6cac49f8c
commit
d8fd189762
@ -33,6 +33,7 @@ Gluon is currently **barely 1 week old**, so is still in an **early and experime
|
|||||||
|
|
||||||
### Apps
|
### Apps
|
||||||
- [Gluworld](gluworld): Hello World demo app with version info shown
|
- [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)
|
- [Glucord](glucord): minimal desktop Discord client loading official webapp (demo/example)
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
36
gludoom/index.js
Normal file
36
gludoom/index.js
Normal 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
1
gludoom/package.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{ "type": "module" }
|
Loading…
x
Reference in New Issue
Block a user