From d7bf98a80b7d4785cab05ff7534e7b362a122563 Mon Sep 17 00:00:00 2001 From: wukko Date: Sat, 20 Jul 2024 21:48:17 +0600 Subject: [PATCH] web: settings reset confirmation, icons for small dialog - cleaned up dialog i18n - better red color - made :active state visible for dialog buttons on mobile - better body padding in small dialog - better small dialog typing with optional values --- web/i18n/en/dialog.json | 8 +++ web/i18n/en/general.json | 3 +- web/i18n/en/settings.json | 2 + .../buttons/ResetSettingsButton.svelte | 47 +++++++++++++--- web/src/components/dialog/DialogHolder.svelte | 1 + web/src/components/dialog/SmallDialog.svelte | 55 +++++++++++++++---- .../save/buttons/DownloadButton.svelte | 6 +- web/src/lib/types/dialog.ts | 13 +++-- web/src/routes/+layout.svelte | 10 +++- web/src/routes/settings/advanced/+page.svelte | 4 +- 10 files changed, 117 insertions(+), 32 deletions(-) create mode 100644 web/i18n/en/dialog.json diff --git a/web/i18n/en/dialog.json b/web/i18n/en/dialog.json new file mode 100644 index 00000000..96a552ec --- /dev/null +++ b/web/i18n/en/dialog.json @@ -0,0 +1,8 @@ +{ + "button.gotit": "got it", + "button.cancel": "cancel", + "button.erase": "erase", + + "erase.title": "erase all settings?", + "erase.body": "are you sure you want to reset all settings? this action is immediate and irreversible." +} diff --git a/web/i18n/en/general.json b/web/i18n/en/general.json index 5a371ff8..6ea5e8a0 100644 --- a/web/i18n/en/general.json +++ b/web/i18n/en/general.json @@ -1,4 +1,3 @@ { - "cobalt": "cobalt", - "gotit": "got it" + "cobalt": "cobalt" } diff --git a/web/i18n/en/settings.json b/web/i18n/en/settings.json index 4df36dc5..0d20cc15 100644 --- a/web/i18n/en/settings.json +++ b/web/i18n/en/settings.json @@ -93,5 +93,7 @@ "advanced.debug": "debug", "advanced.debug.title": "enable debug features", "advanced.debug.description": "gives you access to a page with app & device info useful for debugging.", + + "advanced.data": "settings data", "advanced.reset": "erase all settings" } diff --git a/web/src/components/buttons/ResetSettingsButton.svelte b/web/src/components/buttons/ResetSettingsButton.svelte index 85a2139d..0434c84d 100644 --- a/web/src/components/buttons/ResetSettingsButton.svelte +++ b/web/src/components/buttons/ResetSettingsButton.svelte @@ -1,22 +1,55 @@ - diff --git a/web/src/components/dialog/DialogHolder.svelte b/web/src/components/dialog/DialogHolder.svelte index 7d6ef1dd..1f306c6b 100644 --- a/web/src/components/dialog/DialogHolder.svelte +++ b/web/src/components/dialog/DialogHolder.svelte @@ -12,6 +12,7 @@ id={dialog.id} title={dialog.title} meowbalt={dialog.meowbalt} + icon={dialog.icon} bodyText={dialog.bodyText} bodySubText={dialog.bodySubText} buttons={dialog.buttons} diff --git a/web/src/components/dialog/SmallDialog.svelte b/web/src/components/dialog/SmallDialog.svelte index 3820c88e..4aa12b72 100644 --- a/web/src/components/dialog/SmallDialog.svelte +++ b/web/src/components/dialog/SmallDialog.svelte @@ -2,13 +2,16 @@ import { tick } from "svelte"; import { killDialog } from "$lib/dialogs"; - import type { DialogButton } from "$lib/types/dialog"; + import type { DialogButton, SmallDialogIcons } from "$lib/types/dialog"; import Meowbalt from "$components/misc/Meowbalt.svelte"; import type { MeowbaltEmotions } from "$lib/types/meowbalt"; + import IconAlertTriangle from "@tabler/icons-svelte/IconAlertTriangle.svelte"; + export let id: string; - export let meowbalt: MeowbaltEmotions; + export let meowbalt: MeowbaltEmotions | undefined; + export let icon: SmallDialogIcons | undefined; export let title: string = ""; export let bodyText: string = ""; export let bodySubText: string = ""; @@ -45,12 +48,19 @@ {/if} - {#if title} - - {/if}