From 2f29b725942f1551c283b537d1e115dd1e781e69 Mon Sep 17 00:00:00 2001 From: N-Pex Date: Thu, 6 Jul 2023 11:18:26 +0200 Subject: [PATCH] File mode: support drag drop and fix cancellation of uploads --- src/assets/css/filedrop.scss | 13 ++- src/components/Chat.vue | 7 +- src/components/file_mode/FileDropLayout.vue | 110 +++++++++++++------- src/plugins/utils.js | 62 ++++++----- 4 files changed, 125 insertions(+), 67 deletions(-) diff --git a/src/assets/css/filedrop.scss b/src/assets/css/filedrop.scss index 54f1913..fdd6f04 100644 --- a/src/assets/css/filedrop.scss +++ b/src/assets/css/filedrop.scss @@ -36,6 +36,9 @@ $small-button-height: 36px; width: 100%; height: 50%; background-color: #181719; + &.drop-target { + background-color: #383739; + } border-radius: 19px; display: flex; flex-direction: column; @@ -90,6 +93,9 @@ $small-button-height: 36px; width: 100%; height: 70%; background-color: #181719; + &.drop-target { + background-color: #383739; + } border-radius: 19px; overflow: hidden; .v-image { @@ -242,16 +248,21 @@ $small-button-height: 36px; } } .file-drop-stack-item { - background: linear-gradient(0deg, #3a3a3c 0%, #3a3a3c 100%), #fff; + background: #3a3a3c; position: absolute; overflow: hidden; + opacity: 0; .v-image { width: 100%; height: 100%; object-fit: cover; } + &.direct { + opacity: 1 !important; + } &.animated { animation-name: fadeInStackItem; + animation-fill-mode: both; animation-duration: 1.5s; } } diff --git a/src/components/Chat.vue b/src/components/Chat.vue index 6087dc1..699aee8 100644 --- a/src/components/Chat.vue +++ b/src/components/Chat.vue @@ -16,7 +16,8 @@ v-on:close="showRecorder = false" v-on:file="onVoiceRecording" :sendTypingIndicators="useVoiceMode" /> $vuetify.icons.ic_lock
{{ $t("file_mode.secure_file_send") }}
-
- {{ $t("file_mode.choose_files") }} +
+ {{ $t("file_mode.choose_files") }}
{{ $t("file_mode.any_file_format_accepted") }}
@@ -15,7 +17,9 @@ -