gluworld: rewrite to use new Gluon window object

This commit is contained in:
CanadaHonk 2022-12-10 01:28:20 +00:00
parent 79c8ea9997
commit d873e8cc84
2 changed files with 9 additions and 14 deletions

View File

@ -8,7 +8,7 @@
<body>
<h1>
Gluon <code id="gluon_version"></code> <br>
built with <code id="glugun_version"></code>
built with <code id="builder"></code>
</h1>
<div id="versions">
@ -24,7 +24,6 @@
</div>
<style>
/* @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Roboto:ital,wght@0,400;0,700;1,500&display=swap'); */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700;800;900');
html, body {
@ -74,5 +73,12 @@
margin-top: 20vh;
}
</style>
<script>
chromium_version.textContent = Gluon.versions.chromium;
node_version.textContent = Gluon.versions.node;
gluon_version.textContent = Gluon.versions.gluon;
builder.textContent = Gluon.versions.builder;
</script>
</body>
</html>

View File

@ -6,17 +6,6 @@ import { join, dirname } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Gluon.open(pathToFileURL(join(__dirname, 'index.html')).href, () => {
const setVersions = () => {
if (typeof chromium_version === 'undefined') return setTimeout(setVersions, 100);
chromium_version.textContent = CHROMIUM_VERSION;
node_version.textContent = NODE_VERSION;
gluon_version.textContent = GLUON_VERSION;
glugun_version.textContent = 'GLUGUN_VERSION' === 'G\LUGUN_VERSION' ? 'nothing' : 'Glugun GLUGUN_VERSION';
};
setVersions();
}, {
const Chromium = await Gluon.open(pathToFileURL(join(__dirname, 'index.html')).href, undefined, {
windowSize: [ 800, 450 ]
});