From 5eb5664c12cbf4be154cab02578d3780ffa8cd58 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 22 Apr 2021 15:39:50 +1000 Subject: [PATCH] switch config to a grid; move info to popups --- ts/deckconfig/BUILD.bazel | 2 + ts/deckconfig/ConfigEditor.svelte | 1 + ts/deckconfig/ConfigEntry.svelte | 63 +++++++++++++++++++++-------- ts/deckconfig/ConfigSelector.svelte | 52 +++++++++--------------- ts/deckconfig/DeckConfigPage.svelte | 19 +++------ ts/deckconfig/HelpPopup.svelte | 32 +++++++++++++++ ts/deckconfig/RevertIcon.svelte | 9 ++++- ts/deckconfig/StepsInput.svelte | 6 --- ts/deckconfig/deckconfig-base.scss | 14 +++++++ ts/deckconfig/icons.ts | 4 +- 10 files changed, 130 insertions(+), 72 deletions(-) create mode 100644 ts/deckconfig/HelpPopup.svelte diff --git a/ts/deckconfig/BUILD.bazel b/ts/deckconfig/BUILD.bazel index 39b9a649a..7be31eff7 100644 --- a/ts/deckconfig/BUILD.bazel +++ b/ts/deckconfig/BUILD.bazel @@ -34,6 +34,7 @@ copy_bootstrap_icons( name = "bootstrap-icons", icons = [ "arrow-counterclockwise.svg", + "info-circle.svg", ], ) @@ -44,6 +45,7 @@ ts_library( "DeckConfigPage", "lib", "//ts/lib", + "@npm//@popperjs", "@npm//svelte2tsx", ], ) diff --git a/ts/deckconfig/ConfigEditor.svelte b/ts/deckconfig/ConfigEditor.svelte index c01f1420b..4ab55f5f2 100644 --- a/ts/deckconfig/ConfigEditor.svelte +++ b/ts/deckconfig/ConfigEditor.svelte @@ -20,6 +20,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html :global(input, select) { font-size: 16px; + text-align: right; } diff --git a/ts/deckconfig/ConfigEntry.svelte b/ts/deckconfig/ConfigEntry.svelte index 2b33e6691..623cd32a7 100644 --- a/ts/deckconfig/ConfigEntry.svelte +++ b/ts/deckconfig/ConfigEntry.svelte @@ -4,6 +4,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html --> -
-
-
{tr.actionsOptionsFor({ val: state.currentDeck.name })}
+ - -
- -
diff --git a/ts/deckconfig/DeckConfigPage.svelte b/ts/deckconfig/DeckConfigPage.svelte index d427118f5..8b252a729 100644 --- a/ts/deckconfig/DeckConfigPage.svelte +++ b/ts/deckconfig/DeckConfigPage.svelte @@ -10,15 +10,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html export let state: DeckConfigState; - @@ -28,8 +23,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -
-
- -
+
+
diff --git a/ts/deckconfig/HelpPopup.svelte b/ts/deckconfig/HelpPopup.svelte new file mode 100644 index 000000000..5647b4b7e --- /dev/null +++ b/ts/deckconfig/HelpPopup.svelte @@ -0,0 +1,32 @@ + + + + + + + {@html infoCircle} + diff --git a/ts/deckconfig/RevertIcon.svelte b/ts/deckconfig/RevertIcon.svelte index ca1e8dd2e..8c126ba01 100644 --- a/ts/deckconfig/RevertIcon.svelte +++ b/ts/deckconfig/RevertIcon.svelte @@ -23,11 +23,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html {#if modified} - {@html revertIcon} +
+ {@html revertIcon} +
{/if} diff --git a/ts/deckconfig/StepsInput.svelte b/ts/deckconfig/StepsInput.svelte index 4c366da3d..3989d0ab8 100644 --- a/ts/deckconfig/StepsInput.svelte +++ b/ts/deckconfig/StepsInput.svelte @@ -29,12 +29,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html } - - diff --git a/ts/deckconfig/deckconfig-base.scss b/ts/deckconfig/deckconfig-base.scss index d972d9092..c8d58cf78 100644 --- a/ts/deckconfig/deckconfig-base.scss +++ b/ts/deckconfig/deckconfig-base.scss @@ -8,6 +8,7 @@ @import "ts/sass/bootstrap/modal"; @import "ts/sass/bootstrap/close"; @import "ts/sass/bootstrap/alert"; +@import "ts/sass/bootstrap/tooltip"; .night-mode { @include scrollbar.night-mode; @@ -17,3 +18,16 @@ .form-select { -webkit-appearance: none; } + +body { + width: min(100vw, 40em); + margin: 0 auto; +} + +html { + overflow-x: hidden; +} + +#main { + padding: 0.5em; +} diff --git a/ts/deckconfig/icons.ts b/ts/deckconfig/icons.ts index e84bafcb6..b7c9901a0 100644 --- a/ts/deckconfig/icons.ts +++ b/ts/deckconfig/icons.ts @@ -4,4 +4,6 @@ // Import icons from bootstrap import revertIcon from "./arrow-counterclockwise.svg"; -export { revertIcon }; +import infoCircle from "./info-circle.svg"; + +export { revertIcon, infoCircle };