From ec0cc7d2e4bc5a2a2cddd3904c4e6e3ffc49940f Mon Sep 17 00:00:00 2001 From: 4yn <4yn@users.noreply.github.com> Date: Wed, 23 Mar 2022 01:42:14 +0800 Subject: [PATCH] add warnings and adjust button layout --- public/global.css | 25 ++ src/App.svelte | 600 ++++++++++++++++++++++++---------------------- 2 files changed, 337 insertions(+), 288 deletions(-) diff --git a/public/global.css b/public/global.css index dbb284e..ff6ac87 100644 --- a/public/global.css +++ b/public/global.css @@ -71,12 +71,33 @@ body { .main { margin-top: 2rem; + height: calc(100% - 2rem); display: flex; flex-flow: column nowrap; align-items: stretch; justify-content: flex-start; } +.preview-row { + flex: 0 1; +} + +.options { + padding: 0.5rem 0; + + flex: 1 1; + display: flex; + flex-flow: column nowrap; + align-items: stretch; + justify-content: flex-start; + + overflow-y: auto; +} + +.buttons-row { + flex: 0 1; +} + .row, .row-2 { margin: 0 0 0.5rem 0; @@ -102,6 +123,10 @@ body { flex: 2 2 0; } +.comment { + font-size: 0.75rem; +} + .serverlist { width: 100%; max-height: 5rem; diff --git a/src/App.svelte b/src/App.svelte index 5e8e52b..736025f 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -169,313 +169,337 @@
-
+
-
-
Input Device
-
- -
-
- {#if deviceMode.slice(0, 8) === "tasoller" || deviceMode.slice(0, 7) === "yuancon" || (deviceMode.slice(0, 10) === "brokenithm" && deviceMode !== "brokenithm-nostalgia")} +
-
+
Input Device
- - - - +
- {/if} - {#if deviceMode.slice(0, 10) === "brokenithm"} -
-
-
-
- Brokenithm server running, access at one of: -
- {ips - .map((x) => `http://${x}:1606/`) - .join("\n") - .trim()} + {#if deviceMode.slice(0, 8) === "tasoller" || deviceMode.slice(0, 7) === "yuancon" || (deviceMode.slice(0, 10) === "brokenithm" && deviceMode !== "brokenithm-nostalgia")} +
+
+
+ + + + +
+
+ {/if} + {#if deviceMode.slice(0, 10) === "brokenithm"} +
+
+
+
+ Brokenithm server running, access at one of: +
+ {ips + .map((x) => `http://${x}:1606/`) + .join("\n") + .trim()} +
-
- {/if} - {#if deviceMode === "diva"} -
-
Slider Serial Port
-
- + {/if} + {#if deviceMode === "diva"} +
+
Slider Serial Port
+
+ +
-
-
-
Brightness
-
- -
-
-
-
-
- -
-
- {/if} - -
-
Output Mode
-
- -
-
- {#if outputMode !== "none"} -
-
Output Polling
-
- -
-
- {/if} - {#if outputMode.slice(0, 7) === "gamepad"} -
-
-
- Gamepad emulation requires ViGEMBus -
-
- {/if} - {#if (outputMode.slice(0, 2) === "kb" || outputMode.slice(0, 7) === "gamepad") && deviceMode.slice(0, 10) !== "brokenithm"} -
-
- Sensitivity -
-
- -
-
-
-
-
- -
-
- {/if} - {#if outputMode === "websocket"} -
-
Output URL
-
- -
-
- {/if} - -
-
LED Mode
-
- -
-
- {#if ledMode !== "none"} -
-
-
- +
+
Brightness
+
- - +
-
- {/if} - {#if ledMode.slice(0, 8) === "reactive" && ["16", "8", "6", "4"].includes(ledMode.slice(9))} +
+
+
+ +
+
+ {/if} +
-
Active Color
+
Output Mode
- -
-
-
-
Base Color
-
- -
-
- {/if} - {#if ledMode.slice(0, 8) === "reactive" && deviceMode.slice(0, 10) !== "brokenithm"} -
-
- Sensitivity -
-
- -
-
-
-
-
- -
-
- {/if} - {#if ledMode === "websocket"} -
-
LED URL
-
- -
-
- {/if} - {#if ledMode === "serial"} -
-
-
- Serial LED may require com0com -
-
-
-
LED Serial Port
-
- + + + + + + + + + + + +
- {/if} -
+ {#if deviceMode === "brokenithm-nostalgia" && outputMode !== "none" && outputMode.slice(0, 5) !== "kb-32"} +
+
+
+ 32 key layout is recommended for Brokestalgia controllers +
+
+ {:else if deviceMode.slice(0, 10) === "brokenithm" && ["kb-voltex", "kb-neardayo", "gamepad-voltex", "gamepad-neardayo"].includes(outputMode)} +
+
+
+ Voltex-like layouts are not recommended for Brokenithm controllers +
+
+ {/if} + {#if outputMode.slice(0, 7) === "gamepad"} +
+
+
+ Gamepad emulation requires ViGEMBus +
+
+ {/if} + {#if outputMode !== "none"} +
+
Output Polling
+
+ +
+
+ {/if} + {#if (outputMode.slice(0, 2) === "kb" || outputMode.slice(0, 7) === "gamepad") && deviceMode.slice(0, 10) !== "brokenithm"} +
+
+ Sensitivity +
+
+ +
+
+
+
+
+ +
+
+ {/if} + {#if outputMode === "websocket"} +
+
Output URL
+
+ +
+
+ {/if} + +
+
LED Mode
+
+ +
+
+ {#if ledMode !== "none"} +
+
+
+ + + + +
+
+ {/if} + {#if ledMode.slice(0, 8) === "reactive" && ["16", "8", "6", "4"].includes(ledMode.slice(9))} +
+
Active Color
+
+ +
+
+
+
Base Color
+
+ +
+
+ {/if} + {#if ledMode.slice(0, 8) === "reactive" && deviceMode.slice(0, 10) !== "brokenithm"} +
+
+ Sensitivity +
+
+ +
+
+
+
+
+ +
+
+ {/if} + {#if ledMode === "websocket"} +
+
LED URL
+
+ +
+
+ {/if} + {#if ledMode === "serial"} +
+
+
+ Serial LED may require com0com +
+
+
+
LED Serial Port
+
+ +
+
+ {/if} +
+