From 2a4b76ee035b741b0e9e4334e287f9b2369c49b2 Mon Sep 17 00:00:00 2001 From: Niko Abeler Date: Thu, 9 May 2024 11:02:41 +0200 Subject: [PATCH] add indication of upload error --- web/static/editor.js | 4 ++++ web/static/style.css | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/web/static/editor.js b/web/static/editor.js index f3932e7..34dc902 100644 --- a/web/static/editor.js +++ b/web/static/editor.js @@ -48,6 +48,10 @@ function addFileDrop(id) { textArea.classList.remove("drop-file-process") }).catch(err => { console.error(err); + textArea.classList.add("drop-file-error") + setTimeout(() => { + textArea.classList.remove("drop-file-error") + }, 2000) }).finally(() => { textArea.classList.remove("drop-file-process") }) diff --git a/web/static/style.css b/web/static/style.css index e036c76..9650694 100644 --- a/web/static/style.css +++ b/web/static/style.css @@ -50,3 +50,25 @@ border-color: #5391ff; animation: border-pulsate 2s infinite; } + + +@keyframes border-pulsate-error { + 0% { + border-color: #ff3e3e; + } + + 50% { + border-color: rgba(0, 255, 255, 0); + } + + 100% { + border-color: #ff3e3e; + } +} + +.drop-file-error { + border-style: solid; + border-width: 4px; + border-color: #ff3e3e; + animation: border-pulsate-error 1s 2; +} \ No newline at end of file