From af428bc9647aac4e995ac7ac532d01b925c042b1 Mon Sep 17 00:00:00 2001 From: wukko Date: Tue, 13 Aug 2024 14:17:10 +0600 Subject: [PATCH] web: stylize the file receiver, move text to i18n, update remux page --- web/i18n/en/receiver.json | 5 + web/i18n/en/remux.json | 3 + web/src/components/misc/FileReceiver.svelte | 114 ++++++++++++++++++ web/src/components/misc/OpenFileButton.svelte | 29 ----- web/src/lib/i18n/translations.ts | 1 + web/src/routes/remux/+page.svelte | 40 +++++- 6 files changed, 160 insertions(+), 32 deletions(-) create mode 100644 web/i18n/en/receiver.json create mode 100644 web/i18n/en/remux.json create mode 100644 web/src/components/misc/FileReceiver.svelte delete mode 100644 web/src/components/misc/OpenFileButton.svelte diff --git a/web/i18n/en/receiver.json b/web/i18n/en/receiver.json new file mode 100644 index 00000000..567e569f --- /dev/null +++ b/web/i18n/en/receiver.json @@ -0,0 +1,5 @@ +{ + "title": "drag or select a file", + "title.drop": "drop the file here!", + "accept": "supported formats: {{ formats }}." +} diff --git a/web/i18n/en/remux.json b/web/i18n/en/remux.json new file mode 100644 index 00000000..e2afbcc9 --- /dev/null +++ b/web/i18n/en/remux.json @@ -0,0 +1,3 @@ +{ + "description": "remuxing media files is fast, lossless, and often fixes compatibility issues with old software. files are processed on-device and never get uploaded anywhere." +} diff --git a/web/src/components/misc/FileReceiver.svelte b/web/src/components/misc/FileReceiver.svelte new file mode 100644 index 00000000..7310afa7 --- /dev/null +++ b/web/src/components/misc/FileReceiver.svelte @@ -0,0 +1,114 @@ + + +
+ + + +
+ + diff --git a/web/src/components/misc/OpenFileButton.svelte b/web/src/components/misc/OpenFileButton.svelte deleted file mode 100644 index f7421876..00000000 --- a/web/src/components/misc/OpenFileButton.svelte +++ /dev/null @@ -1,29 +0,0 @@ - - - diff --git a/web/src/lib/i18n/translations.ts b/web/src/lib/i18n/translations.ts index 9bdefaa7..21ed9abf 100644 --- a/web/src/lib/i18n/translations.ts +++ b/web/src/lib/i18n/translations.ts @@ -24,6 +24,7 @@ for (const [path, loader] of Object.entries(locFiles)) { const defaultLocale = 'en'; const config: Config<{ value?: string; + formats?: string; }> = { fallbackLocale: defaultLocale, translations: Object.keys(parsedLocfiles).reduce((obj, lang) => { diff --git a/web/src/routes/remux/+page.svelte b/web/src/routes/remux/+page.svelte index 7c570ff1..ccef6ac2 100644 --- a/web/src/routes/remux/+page.svelte +++ b/web/src/routes/remux/+page.svelte @@ -1,9 +1,10 @@ - +
+ +
+ {$t("remux.description")} +
+