From 0e5b69f6cfcc4b47511bcf20b1851dbace65a263 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Sun, 21 Feb 2021 03:51:29 +0100 Subject: [PATCH] Hide controls when needed --- InitUiElements.ts | 5 +- UI/Base/ScrollableFullScreen.ts | 2 +- UI/BigComponents/Basemap.ts | 2 + assets/svg/min.svg | 272 +++++++++++++++++++++++++++++++ assets/svg/osm-copyright.svg | 111 +++++++++++++ assets/svg/plus.svg | 277 ++++++++++++++++++++++++++++++++ index.css | 51 +----- index.html | 2 +- 8 files changed, 671 insertions(+), 51 deletions(-) create mode 100644 assets/svg/min.svg create mode 100644 assets/svg/osm-copyright.svg create mode 100644 assets/svg/plus.svg diff --git a/InitUiElements.ts b/InitUiElements.ts index 4be6179..09dbea3 100644 --- a/InitUiElements.ts +++ b/InitUiElements.ts @@ -236,7 +236,8 @@ export class InitUiElements { }); // ?-Button on Desktop, opens panel with close-X. - const help = Svg.help_svg().SetClass("open-welcome-button block"); + const help = new MapControlButton(Svg.help_svg()); + // .SetClass("open-welcome-button block"); const checkbox = new CheckBox( fullOptions .SetClass("welcomeMessage") @@ -295,7 +296,7 @@ export class InitUiElements { ).SetClass("p-0.5 md:hidden") new Combine([copyrightButton, checkbox]) - .AttachTo("layer-selection"); + .AttachTo("bottom-left"); State.state.locationControl diff --git a/UI/Base/ScrollableFullScreen.ts b/UI/Base/ScrollableFullScreen.ts index 9c31997..d1e8fc6 100644 --- a/UI/Base/ScrollableFullScreen.ts +++ b/UI/Base/ScrollableFullScreen.ts @@ -43,7 +43,7 @@ export default class ScrollableFullScreen extends UIElement { .SetClass("block p-2 md:pt-4 w-full h-full overflow-y-auto md:max-h-65vh"), // We add an ornament which takes around 5em. This is in order to make sure the Web UI doesn't hide ]).SetClass("flex flex-col h-full relative bg-white") - ]).SetClass("fixed top-0 left-0 right-0 h-screen w-screen md:max-h-65vh md:w-auto md:relative"); + ]).SetClass("fixed top-0 left-0 right-0 h-screen w-screen md:max-h-65vh md:w-auto md:relative z-above-controls"); this.dumbMode = false; } diff --git a/UI/BigComponents/Basemap.ts b/UI/BigComponents/Basemap.ts index 38e2f32..b9adb54 100644 --- a/UI/BigComponents/Basemap.ts +++ b/UI/BigComponents/Basemap.ts @@ -18,6 +18,8 @@ export class Basemap { center: [location.data.lat ?? 0, location.data.lon ?? 0], zoom: location.data.zoom ?? 2, layers: [currentLayer.data.layer], + zoomControl: false + }); L.control.scale( diff --git a/assets/svg/min.svg b/assets/svg/min.svg new file mode 100644 index 0000000..e038aa2 --- /dev/null +++ b/assets/svg/min.svg @@ -0,0 +1,272 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/svg/osm-copyright.svg b/assets/svg/osm-copyright.svg new file mode 100644 index 0000000..7dc7caf --- /dev/null +++ b/assets/svg/osm-copyright.svg @@ -0,0 +1,111 @@ + + diff --git a/assets/svg/plus.svg b/assets/svg/plus.svg new file mode 100644 index 0000000..ff5024b --- /dev/null +++ b/assets/svg/plus.svg @@ -0,0 +1,277 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/index.css b/index.css index a7ff5fc..ba86a51 100644 --- a/index.css +++ b/index.css @@ -16,6 +16,10 @@ z-index: 10000 } + .z-above-controls{ + z-index: 10001 + } + } .btn { @@ -347,38 +351,6 @@ a { color: var(--foreground-color); } -.close-welcome-button { - position: absolute; - display: inline-block; - height: 100%; - background-color: var(--subtle-detail-color); - color: var(--subtle-detail-color-contrast); - box-sizing: border-box; - width: 4em; - padding: 1em; - border-top-left-radius: 1em; - border-bottom-left-radius: 1em; -} - -.close-welcome-button svg { - width: 2em; - height: 2em; -} - -.open-welcome-button { - box-sizing: border-box; - background: var(--subtle-detail-color); - color: var(--foreground-color); - - height: 3.5em; - width: 3.5em; - padding: 0.75em; -} - -.open-welcome-button svg { - width: 2em; - height: 2em; -} #messagesbox { /*Only shown on big screens*/ @@ -438,21 +410,6 @@ a { } -.iframe-escape { - background-color: var(--background-color); - color: var(--foreground-color); - - border-radius: 2em; - display: block; - width: min-content; -} - -.iframe-escape img { - padding: 1em; - width: 2em; - height: 2em; -} - /** Switch layout **/ .small-image img { height: 1em; diff --git a/index.html b/index.html index 0b87fa4..5b343fa 100644 --- a/index.html +++ b/index.html @@ -55,7 +55,7 @@
-
+