diff --git a/locales/index.d.ts b/locales/index.d.ts index 3b27149cd8..c9f3ce3f5e 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -11902,6 +11902,16 @@ export interface Locale extends ILocale { "text3": string; }; }; + "_uploader": { + /** + * {x}に圧縮 + */ + "compressedToX": ParameterizedString<"x">; + /** + * {x}%節約 + */ + "savedXPercent": ParameterizedString<"x">; + }; } declare const locales: { [lang: string]: Locale; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 4c6e1f1e58..7045a6f46a 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -3182,3 +3182,7 @@ _serverSetupWizard: text1: "Misskeyは有志によって開発されている無料のソフトウェアです。" text2: "今後も開発を続けられるように、よろしければぜひカンパをお願いいたします。" text3: "支援者向け特典もあります!" + +_uploader: + compressedToX: "{x}に圧縮" + savedXPercent: "{x}%節約" diff --git a/packages/frontend/src/components/MkUploadDialog.vue b/packages/frontend/src/components/MkUploadDialog.vue index 9dcdea2523..7bc2febbf6 100644 --- a/packages/frontend/src/components/MkUploadDialog.vue +++ b/packages/frontend/src/components/MkUploadDialog.vue @@ -17,7 +17,13 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
@@ -27,7 +33,7 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ ctx.name }}
{{ bytes(ctx.file.size) }} - ({{ bytes(ctx.compressedSize) }}) + ({{ i18n.tsx._uploader.compressedToX({ x: bytes(ctx.compressedSize) }) }} = {{ i18n.tsx._uploader.savedXPercent({ x: Math.round((1 - ctx.compressedSize / ctx.file.size) * 100) }) }})
@@ -181,6 +187,7 @@ async function upload() { // エラーハンドリングなどを考慮してシ for (const item of items.value.filter(item => item.uploaded == null)) { item.waiting = true; + item.uploadFailed = false; const shouldCompress = item.compressedImage == null && compressionLevel.value !== 0 && compressionSettings.value && compressionSupportedTypes.includes(item.file.type) && !(await isAnimated(item.file)); @@ -272,7 +279,7 @@ onMounted(() => { width: var(--p); height: 100%; background: color(from var(--MI_THEME-accent) srgb r g b / 0.5); - transition: width 0.2s ease; + transition: width 0.2s ease, left 0.2s ease; } &.itemWaiting { @@ -291,6 +298,23 @@ onMounted(() => { animation: stripe .8s infinite linear; } } + + &.itemCompleted { + &::before { + left: 100%; + width: var(--p); + } + + .itemBody { + color: var(--MI_THEME-accent); + } + } + + &.itemFailed { + .itemBody { + color: var(--MI_THEME-error); + } + } } @keyframes stripe { @@ -310,6 +334,7 @@ onMounted(() => { .itemThumbnail { width: 70px; height: 70px; + background-color: var(--MI_THEME-bg); background-size: contain; background-position: center; background-repeat: no-repeat;