From ac18aab77350c68d703c3b4632d615d3c039dda4 Mon Sep 17 00:00:00 2001 From: Anton Bracke Date: Tue, 22 Feb 2022 10:05:21 +0100 Subject: [PATCH] improve local-app --- desktop/local-app/package.json | 7 + desktop/local-app/src/App.svelte | 17 +- .../local-app/src/assets/nes.icons/README.md | 3 + .../local-app/src/assets/nes.icons/cog.svg | 103 ++++++++++ desktop/local-app/src/lib/InputField.svelte | 16 ++ desktop/local-app/src/lib/KeyRecord.svelte | 178 ++++++++++++++++++ desktop/local-app/src/lib/Lazy.svelte | 50 ++--- desktop/local-app/src/lib/LazyRoute.svelte | 28 +-- desktop/local-app/src/lib/Link.svelte | 23 ++- desktop/local-app/src/lib/Sidebar.svelte | 49 +++-- desktop/local-app/src/lib/TextInput.svelte | 27 +++ desktop/local-app/src/lib/ToggleSwitch.svelte | 25 +++ desktop/local-app/src/store.ts | 10 +- desktop/local-app/src/svg.d.ts | 4 + desktop/local-app/src/views/AddServer.svelte | 38 +++- desktop/local-app/src/views/Home.svelte | 17 +- desktop/local-app/src/views/Settings.svelte | 59 ++++++ desktop/local-app/tsconfig.json | 5 +- desktop/local-app/tsconfig.node.json | 3 +- desktop/local-app/vite.config.ts | 21 ++- desktop/local-app/yarn.lock | 156 +++++++++++++++ desktop/src/app.ts | 14 +- .../{update-auto-launch.ts => auto-launch.ts} | 8 +- desktop/src/ipc.ts | 33 +++- desktop/src/preload-app/preload.ts | 6 +- desktop/src/preload-app/types.ts | 4 +- desktop/src/preload-local-app/preload.ts | 5 + desktop/src/preload-local-app/types.ts | 5 + desktop/src/settings.ts | 3 +- desktop/src/shortcuts.ts | 29 +++ 30 files changed, 841 insertions(+), 105 deletions(-) create mode 100644 desktop/local-app/src/assets/nes.icons/README.md create mode 100644 desktop/local-app/src/assets/nes.icons/cog.svg create mode 100644 desktop/local-app/src/lib/InputField.svelte create mode 100644 desktop/local-app/src/lib/KeyRecord.svelte create mode 100644 desktop/local-app/src/lib/TextInput.svelte create mode 100644 desktop/local-app/src/lib/ToggleSwitch.svelte create mode 100644 desktop/local-app/src/svg.d.ts create mode 100644 desktop/local-app/src/views/Settings.svelte rename desktop/src/{update-auto-launch.ts => auto-launch.ts} (88%) create mode 100644 desktop/src/shortcuts.ts diff --git a/desktop/local-app/package.json b/desktop/local-app/package.json index 5d264a46..ce50fcb8 100644 --- a/desktop/local-app/package.json +++ b/desktop/local-app/package.json @@ -17,6 +17,8 @@ "@sveltejs/vite-plugin-svelte": "^1.0.0-next.30", "@tsconfig/svelte": "^2.0.1", "prettier": "^2.5.1", + "prettier-plugin-svelte": "^2.6.0", + "rollup-plugin-svelte-svg": "^1.0.0-beta.6", "svelte": "^3.44.0", "svelte-check": "^2.2.7", "svelte-navigator": "^3.1.5", @@ -26,5 +28,10 @@ "vite": "^2.8.0", "vite-plugin-windicss": "^1.7.1", "windicss": "^3.4.3" + }, + "dependencies": { + "@16bits/nes.css": "^2.3.2", + "@fontsource/press-start-2p": "^4.5.2", + "hotkeys-js": "^3.8.7" } } diff --git a/desktop/local-app/src/App.svelte b/desktop/local-app/src/App.svelte index 31697514..0e6e4a43 100644 --- a/desktop/local-app/src/App.svelte +++ b/desktop/local-app/src/App.svelte @@ -1,12 +1,13 @@ @@ -17,6 +18,7 @@
Loading ... Loading ... + Loading ...

404

No Route could be matched.

@@ -28,9 +30,12 @@ {/if} diff --git a/desktop/local-app/src/lib/TextInput.svelte b/desktop/local-app/src/lib/TextInput.svelte new file mode 100644 index 00000000..6063da54 --- /dev/null +++ b/desktop/local-app/src/lib/TextInput.svelte @@ -0,0 +1,27 @@ + + +
+ { + value = e.target.value; + dispatch("change", { value }); + }} + /> +
diff --git a/desktop/local-app/src/lib/ToggleSwitch.svelte b/desktop/local-app/src/lib/ToggleSwitch.svelte new file mode 100644 index 00000000..5ad98ef0 --- /dev/null +++ b/desktop/local-app/src/lib/ToggleSwitch.svelte @@ -0,0 +1,25 @@ + + +
+