partey_workadventure/desktop
Anton Bracke 4337264157
cleanup
2022-02-20 21:06:27 +01:00
..
assets/icons fix name and icons 2022-02-19 01:17:38 +01:00
local-app cleanup 2022-02-20 21:06:27 +01:00
src add svelte local-app 2022-02-20 20:30:53 +01:00
tests add ci 2022-02-18 10:26:36 +01:00
.eslintrc.json add desktop app 2022-02-17 18:09:57 +01:00
.gitignore add release and electron-builder setup 2022-02-18 11:49:53 +01:00
.prettierignore add ci 2022-02-18 10:26:36 +01:00
.prettierrc.json add ci 2022-02-18 10:26:36 +01:00
electron-builder.yml add svelte local-app 2022-02-20 20:30:53 +01:00
LICENSE.txt add desktop app 2022-02-17 18:09:57 +01:00
package.json cleanup 2022-02-20 21:06:27 +01:00
README.md cleanup 2022-02-20 21:06:27 +01:00
tsconfig.json fix loading & cleanup 2022-02-19 01:48:56 +01:00
yarn.lock add svelte local-app 2022-02-20 20:30:53 +01:00

Desktop app

The desktop component is an electron app. It uses a hybrid setup based of two main components:

  • A local-app bundled into the electron app. It has two main parts:
    • A sidebar to show the server list, with the currently selected server
    • A main page which is used to manage servers and to show other "local" pages like the options
  • A BrowserView (often called appView or app) showing the actual frontend of an external WorkAdventure deployment. If a server is selected the BrowserView / appView is overlaying the main part right to the sidebar.

Development

# start local-app
yarn dev:local-app

# start electron app
LOCAL_APP_URL=http://localhost:3000 yarn dev

# or create an executable by running:
yarn bundle

API for front

TODO:

if (window?.WorkAdventureDesktopApi?.desktop) {
  alert('Yeah you are using the desktop app ;)');
}

let muted = false;

window?.WorkAdventureDesktopApi?.onMutedKeyPress((event) => {
  if (muted) {
    document.getElementById("info-box").innerHTML =
      "Ready to speak! Press ctrl-alt-m to mute.";
  } else {
    document.getElementById("info-box").innerHTML =
      "Muted! Press ctrl-alt-m to unmute again.";
  }
  muted = !muted;
});

window.WorkAdventureDesktopApi.notify("Hello from front");