diff options
| author | stonedDiscord <Tukz@gmx.de> | 2024-08-16 23:00:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-16 23:00:40 +0200 |
| commit | c939aefb6cb8d6d000fc54658ce88b7af9829564 (patch) | |
| tree | a643d5f79a5d32721f0a7831d49e8cf7eec687a4 /webAO/ui.js | |
| parent | 2039178b0f4550534ea6cca1efe64e2a6e4e901d (diff) | |
| parent | ee56db55a90cc1f2a216b6076d88df8c0ca71053 (diff) | |
Merge pull request #226 from AttorneyOnline/mobileview
Mobile view
Diffstat (limited to 'webAO/ui.js')
| -rw-r--r-- | webAO/ui.js | 95 |
1 files changed, 91 insertions, 4 deletions
diff --git a/webAO/ui.js b/webAO/ui.js index 154b008..ca7d748 100644 --- a/webAO/ui.js +++ b/webAO/ui.js @@ -18,11 +18,20 @@ const config = { width: 40, content: [{ type: 'component', + height: 67, isClosable: false, componentName: 'template', - title: 'Game', + title: 'IC', componentState: { id: 'client_wrapper' }, - }], + }, + { + type: 'component', + height: 33, + isClosable: false, + title: 'IC Options', + componentName: 'template', + componentState: { id: 'icoptions' }, + }] }, { type: 'column', @@ -69,7 +78,7 @@ const config = { type: 'row', content: [{ type: 'component', - title: 'Server chat', + title: 'OOC', componentName: 'template', componentState: { id: 'ooc' }, }], @@ -78,9 +87,87 @@ const config = { }], }; + +const configMobile = { + settings: { + showPopoutIcon: false, + showCloseIcon: false, + }, + dimensions: { + minItemHeight: 40, + }, + content: [{ + type: 'row', + content: [{ + type: 'column', + content: [{ + type: 'component', + isClosable: false, + reorderEnabled: false, + componentName: 'template', + title: 'IC', + componentState: { id: 'client_wrapper' }, + height: 56 // Adjust the height proportion as needed + }, + { + type: 'stack', + height: 44, + content: [{ + type: 'component', + isClosable: false, + reorderEnabled: false, + title: 'IC Options', + componentName: 'template', + componentState: { id: 'icoptions' }, + }, + { + type: 'component', + isClosable: false, + reorderEnabled: false, + title: 'Main', + componentName: 'template', + componentState: { id: 'mainmenu' }, + }, + { + type: 'component', + isClosable: false, + reorderEnabled: false, + title: 'Log', + componentName: 'template', + componentState: { id: 'log' }, + }, + { + type: 'component', + isClosable: false, + reorderEnabled: false, + title: 'Music', + componentName: 'template', + componentState: { id: 'music' }, + }, + { + type: 'component', + isClosable: false, + reorderEnabled: false, + title: 'OOC', + componentName: 'template', + componentState: { id: 'ooc' }, + }] + }] + }] + }] +} + + +const isMobileDevice = window.innerWidth <= window.innerHeight; + const golden = new GoldenLayout(); golden.registerComponentFactoryFunction('template', (container, componentState) => { const template = document.querySelector(`#${componentState.id}`); container.element.innerHTML = template.innerHTML; }); -golden.loadLayout(config); +if (isMobileDevice){ + golden.loadLayout(configMobile); +} +else { + golden.loadLayout(config); +} |
