├── .gitignore ├── LICENSE ├── README.md ├── glucord ├── index.js └── package.json ├── gludoom ├── index.js └── package.json └── gluworld ├── index.html ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | # npm 2 | node_modules 3 | package-lock.json 4 | 5 | # gluon 6 | gluon_data -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Gluon 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # examples 2 | Various Gluon example apps 3 | -------------------------------------------------------------------------------- /glucord/index.js: -------------------------------------------------------------------------------- 1 | import * as Gluon from '@gluon-framework/gluon'; 2 | 3 | Gluon.open('https://discord.com/app', { 4 | onLoad: () => { 5 | setTimeout(() => { 6 | document.title = 'Glucord'; 7 | Object.defineProperty(document, 'title', { 8 | get() { 9 | return this._title; 10 | }, 11 | 12 | set(original) { 13 | if (original === 'Discord') original = 'Glucord'; 14 | 15 | // web style title -> desktop style title 16 | this._title = original.replace('Discord | ', ''); 17 | if (this._title !== 'Glucord') this._title += ' - Glucord'; 18 | 19 | document.getElementsByTagName('title')[0].textContent = this._title; // actually set title 20 | return this._title; 21 | } 22 | }); 23 | 24 | // set icon to Glucord icon 25 | const iconEl = document.querySelector("link[rel~='icon']"); 26 | iconEl.href = `https://media.discordapp.net/attachments/1051941471365910608/1089240980542205962/logo.png`; 27 | 28 | iconEl.setAttribute = () => {}; // stop Discord overwriting our icon 29 | 30 | document.head.appendChild(document.createElement("style")).innerHTML = ` 31 | .socialLinks-3ywLUf + .info-3pQQBb { 32 | position: relative; 33 | } 34 | 35 | .socialLinks-3ywLUf + .info-3pQQBb::after { 36 | content: 'Glucord 0.1.1 \\a Gluon ${Gluon.versions.gluon} ${Gluon.versions.builder !== 'nothing' ? `(${Gluon.versions.builder})` : ''} \\a ${Gluon.versions.browserType[0].toUpperCase() + Gluon.versions.browserType.slice(1)} ${Gluon.versions.browser} (${Gluon.versions.product}) \\a Node ${Gluon.versions.node}'; 37 | white-space: pre-wrap; 38 | text-transform: none; 39 | color: var(--text-muted); 40 | font-weight: 400; 41 | font-family: var(--font-primary); 42 | font-size: 12px; 43 | line-height: 16px; 44 | width: 100%; 45 | padding: 8px 0; 46 | margin: 8px 0; 47 | display: inline-block; 48 | border-top: 1px solid var(--background-modifier-accent); 49 | }`; 50 | }, 200); 51 | } 52 | }); -------------------------------------------------------------------------------- /glucord/package.json: -------------------------------------------------------------------------------- 1 | {"type":"module","dependencies":{"@gluon-framework/gluon":"^0.14.0"}} -------------------------------------------------------------------------------- /gludoom/index.js: -------------------------------------------------------------------------------- 1 | import * as Gluon from '@gluon-framework/gluon'; 2 | 3 | (async () => { 4 | // Load existing site with WASM doom 5 | await Gluon.open(`https://silentspacemarine.com`, { 6 | windowSize: [ 760, 600 ], 7 | onLoad: () => { 8 | // Wait until fully loaded 9 | setTimeout(() => { 10 | // Inject CSS to remove border / padding 11 | const el = document.createElement('style'); 12 | el.appendChild(document.createTextNode(` 13 | body, html, #container, #monitor { 14 | overflow: hidden; 15 | max-width: unset; 16 | margin: 0; 17 | padding: 0; 18 | border: 0; 19 | border-radius: 0; 20 | 21 | width: 100%; 22 | height: 100%; 23 | } 24 | 25 | #monitor:after { 26 | display: none; 27 | }`)); 28 | document.body.appendChild(el); 29 | 30 | // Force window title to our own 31 | document.title = `Gludoom (${Gluon.versions.product} ${Gluon.versions.browser})`; 32 | Object.defineProperty(document, 'title', { get() {}, set() {} }); 33 | }, 1000); 34 | } 35 | }); 36 | })(); -------------------------------------------------------------------------------- /gludoom/package.json: -------------------------------------------------------------------------------- 1 | {"type":"module","dependencies":{"@gluon-framework/gluon":"^0.14.0"}} -------------------------------------------------------------------------------- /gluworld/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Gluworld 7 | 8 | 9 |

10 | Gluon
11 | built with
12 | running on 13 |

14 | 15 |
16 |

17 |
18 |
19 |

20 |

21 | 22 |

23 | Build Size
24 | 25 |

26 | 27 |

28 | Node
29 |
30 |

V8

31 |

32 |
33 | 34 | 99 | 100 | 135 | 136 | -------------------------------------------------------------------------------- /gluworld/index.js: -------------------------------------------------------------------------------- 1 | import * as Gluon from '@gluon-framework/gluon'; 2 | 3 | (async () => { 4 | const browsers = process.argv.slice(2).filter(x => !x.startsWith('-')); 5 | 6 | if (browsers.length > 0) { // use argv as browsers to use 7 | for (const forceBrowser of browsers) { 8 | await Gluon.open('index.html', { 9 | windowSize: [ 800, 500 ], 10 | forceBrowser 11 | }); 12 | } 13 | 14 | return; 15 | } 16 | 17 | await Gluon.open('index.html', { 18 | windowSize: [ 800, 500 ] 19 | }); 20 | })(); -------------------------------------------------------------------------------- /gluworld/package.json: -------------------------------------------------------------------------------- 1 | {"type":"module","dependencies":{"@gluon-framework/gluon":"^0.14.0"}} --------------------------------------------------------------------------------