From 7f1e8d3f9cbaf65fa5b6bbb60fe59d1223883ff3 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 11 May 2023 02:17:41 +0200 Subject: [PATCH] Refactoring: overhaul of the visual style with CSS --- Logic/State/UserRelatedState.ts | 9 + Models/ThemeConfig/Conversion/PrepareLayer.ts | 1 + UI/Base/Loading.svelte | 2 +- UI/Base/MapControlButton.svelte | 4 +- UI/Base/SubtleButton.svelte | 48 +- UI/Base/SubtleButton.ts | 32 +- UI/Base/SubtleLink.svelte | 63 +++ UI/Base/TabbedGroup.svelte | 21 +- UI/BigComponents/CustomGeneratorButton.svelte | 32 +- UI/BigComponents/MoreScreen.ts | 45 -- UI/BigComponents/NoThemeResultButton.svelte | 5 +- .../ProfessionalServicesButton.svelte | 9 +- UI/BigComponents/ThemeButton.svelte | 188 +++---- UI/BigComponents/UnofficialThemeList.svelte | 2 + UI/Input/Checkboxes.ts | 9 +- UI/InputElement/Helpers/FloorSelector.svelte | 8 +- UI/InputElement/ValidatedInput.svelte | 1 + UI/InputElement/Validator.ts | 7 +- UI/InputElement/Validators/PhoneValidator.ts | 3 + UI/Popup/AddNewPoint/AddNewPoint.svelte | 2 +- UI/Popup/TagHint.svelte | 64 ++- UI/Popup/TagRendering/FreeformInput.svelte | 77 ++- UI/Popup/TagRendering/Questionbox.svelte | 2 +- .../TagRendering/TagRenderingEditable.svelte | 29 +- .../TagRenderingMappingInput.svelte | 2 +- .../TagRendering/TagRenderingQuestion.svelte | 81 +-- UI/SpecialVisualization.ts | 1 + UI/StylesheetTestGui.svelte | 90 ++- assets/layers/usersettings/license_info.json | 24 + .../usersettings/translate_disabled.svg | 59 ++ .../layers/usersettings/translate_mobile.svg | 50 ++ assets/svg/crosshair.svg | 4 +- assets/svg/min.svg | 4 +- assets/svg/plus.svg | 6 +- index.css | 514 +++++++++++------ package.json | 4 +- public/css/index-tailwind-output.css | 519 ++++++++++++------ 37 files changed, 1280 insertions(+), 741 deletions(-) create mode 100644 UI/Base/SubtleLink.svelte create mode 100644 assets/layers/usersettings/license_info.json create mode 100644 assets/layers/usersettings/translate_disabled.svg create mode 100644 assets/layers/usersettings/translate_mobile.svg diff --git a/Logic/State/UserRelatedState.ts b/Logic/State/UserRelatedState.ts index 8c9865cff..304f09c2f 100644 --- a/Logic/State/UserRelatedState.ts +++ b/Logic/State/UserRelatedState.ts @@ -14,6 +14,7 @@ import usersettings from "../../assets/generated/layers/usersettings.json" import Locale from "../../UI/i18n/Locale" import LinkToWeblate from "../../UI/Base/LinkToWeblate" import FeatureSwitchState from "./FeatureSwitchState" +import Constants from "../../Models/Constants"; /** * The part of the state which keeps track of user-related stuff, e.g. the OSM-connection, @@ -32,6 +33,9 @@ export default class UserRelatedState { public readonly installedUserThemes: Store public readonly showAllQuestionsAtOnce: UIEventSource + public readonly showTags: UIEventSource<"no" | undefined | "always" | "yes">; + + public readonly homeLocation: FeatureSource /** @@ -88,6 +92,7 @@ export default class UserRelatedState { "Either 'true' or 'false'. If set, all questions will be shown all at once", }) ) + this.showTags = > this.osmConnection.GetPreference("show_tags") this.mangroveIdentity = new MangroveIdentity( this.osmConnection.GetLongPreference("identity", "mangrove") @@ -254,6 +259,10 @@ export default class UserRelatedState { _supports_sharing: window.navigator.share ? "yes" : "no" }) + for (const key in Constants.userJourney) { + amendedPrefs.data["__userjourney_"+key] = Constants.userJourney[key] + } + const osmConnection = this.osmConnection osmConnection.preferencesHandler.preferences.addCallback((newPrefs) => { for (const k in newPrefs) { diff --git a/Models/ThemeConfig/Conversion/PrepareLayer.ts b/Models/ThemeConfig/Conversion/PrepareLayer.ts index fbb69c35c..348949b70 100644 --- a/Models/ThemeConfig/Conversion/PrepareLayer.ts +++ b/Models/ThemeConfig/Conversion/PrepareLayer.ts @@ -637,6 +637,7 @@ export class AddEditingElements extends DesugaringStep { or: [ "__featureSwitchIsTesting=true", "__featureSwitchIsDebugging=true", + "mapcomplete-show_tags=full", "mapcomplete-show_debug=yes", ], }, diff --git a/UI/Base/Loading.svelte b/UI/Base/Loading.svelte index 2db2e4481..f98d9fe3f 100644 --- a/UI/Base/Loading.svelte +++ b/UI/Base/Loading.svelte @@ -5,7 +5,7 @@
- +
diff --git a/UI/Base/MapControlButton.svelte b/UI/Base/MapControlButton.svelte index 915d8cf7b..7528c0ba9 100644 --- a/UI/Base/MapControlButton.svelte +++ b/UI/Base/MapControlButton.svelte @@ -8,6 +8,6 @@ -
dispatch("click", e)} class="subtle-background rounded-full h-fit w-fit m-0.5 md:m-1 p-0.5 sm:p-1 cursor-pointer"> +
+ diff --git a/UI/Base/SubtleButton.svelte b/UI/Base/SubtleButton.svelte index 88d6b233b..9bbe097f1 100644 --- a/UI/Base/SubtleButton.svelte +++ b/UI/Base/SubtleButton.svelte @@ -1,73 +1,35 @@ - dispatch("click", e)} > {#if imageUrl !== undefined} {#if typeof imageUrl === "string"} - {:else } -