diff --git a/frontend/public/index.html b/frontend/public/index.html index 343c14dd..adab4cb8 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -77,7 +77,7 @@ opacity: 0; } - .spinner { + #loading .spinner { width: 70px; text-align: center; position: fixed; @@ -87,7 +87,7 @@ transform: translate(-50%, -50%); } - .spinner > div { + #loading .spinner > div { width: 18px; height: 18px; background-color: #333; @@ -97,12 +97,12 @@ animation: sk-bouncedelay 1.4s infinite ease-in-out both; } - .spinner .bounce1 { + #loading .spinner .bounce1 { -webkit-animation-delay: -0.32s; animation-delay: -0.32s; } - .spinner .bounce2 { + #loading .spinner .bounce2 { -webkit-animation-delay: -0.16s; animation-delay: -0.16s; } diff --git a/frontend/public/themes/dark.css b/frontend/public/themes/dark.css index 4e3c6f5f..98353831 100644 --- a/frontend/public/themes/dark.css +++ b/frontend/public/themes/dark.css @@ -16,7 +16,7 @@ body { #loading { background: var(--background); } -#loading .spinner div, #previewer .loading .spinner div { +#loading .spinner div, main .spinner div { background: var(--icon); } diff --git a/frontend/src/css/styles.css b/frontend/src/css/styles.css index e32856e3..6e6d6ba2 100644 --- a/frontend/src/css/styles.css +++ b/frontend/src/css/styles.css @@ -17,6 +17,48 @@ color: var(--blue); } +main .spinner { + display: block; + text-align: center; + line-height: 0; + padding: 1em 0; +} + +main .spinner > div { + width: .8em; + height: .8em; + margin: 0 .1em; + font-size: 1em; + background-color: rgba(0, 0, 0, 0.3); + border-radius: 100%; + display: inline-block; + animation: sk-bouncedelay 1.4s infinite ease-in-out both; +} + +main .spinner .bounce1 { + animation-delay: -0.32s; +} + +main .spinner .bounce2 { + animation-delay: -0.16s; +} + +.delayed { + animation: delayed linear 100ms; +} + +@keyframes delayed { + 0% { + opacity: 0; + } + 99% { + opacity: 0; + } + 100% { + opacity: 1; + } +} + /* * * * * * * * * * * * * * * * * ACTION * * * * * * * * * * * * * * * * */ @@ -204,6 +246,20 @@ right: 0.5em; } +#previewer .spinner { + text-align: center; + position: fixed; + top: calc(50% + 1.85em); + left: 50%; + transform: translate(-50%, -50%); +} + +#previewer .spinner > div { + width: 18px; + height: 18px; + background-color: white; +} + /* EDITOR */ #editor-container { @@ -217,11 +273,6 @@ overflow: hidden; } -#previewer .loading { - height: 100%; - width: 100%; -} - #editor-container #editor { height: calc(100vh - 8.4em); } @@ -283,7 +334,6 @@ @keyframes spin { 100% { - -webkit-transform: rotate(-360deg); transform: rotate(-360deg); } } diff --git a/frontend/src/views/Files.vue b/frontend/src/views/Files.vue index 781b0edb..02d73c61 100644 --- a/frontend/src/views/Files.vue +++ b/frontend/src/views/Files.vue @@ -7,7 +7,12 @@
-

+

+
+
+
+
+
{{ $t("files.loading") }}

diff --git a/frontend/src/views/Settings.vue b/frontend/src/views/Settings.vue index ef67c59a..7dabc1c7 100644 --- a/frontend/src/views/Settings.vue +++ b/frontend/src/views/Settings.vue @@ -34,6 +34,17 @@ +
+

+
+
+
+
+
+ {{ $t("files.loading") }} +

+
+ @@ -49,7 +60,7 @@ export default { HeaderBar, }, computed: { - ...mapState(["user"]), + ...mapState(["user", "loading"]), }, }; diff --git a/frontend/src/views/Share.vue b/frontend/src/views/Share.vue index a60af1c8..cc370cfe 100644 --- a/frontend/src/views/Share.vue +++ b/frontend/src/views/Share.vue @@ -19,7 +19,50 @@ -
+
+

+
+
+
+
+
+ {{ $t("files.loading") }} +

+
+
+
+
+ +
+

{{ $t("login.password") }}

+
+ +
+ +
+
+ +
+
+
+ +
+
-
-
-
- -
-

{{ $t("login.password") }}

-
- -
- -
-
- -
-
-
- -
@@ -256,9 +266,10 @@ export default { this.token = file.token || ""; this.updateRequest(file); - this.setLoading(false); } catch (e) { this.error = e; + } finally { + this.setLoading(false); } }, keyEvent(event) { diff --git a/frontend/src/views/files/Listing.vue b/frontend/src/views/files/Listing.vue index 26023b85..e3c8c253 100644 --- a/frontend/src/views/files/Listing.vue +++ b/frontend/src/views/files/Listing.vue @@ -114,8 +114,13 @@ />
-
-

+
+

+
+
+
+
+
{{ $t("files.loading") }}

@@ -284,7 +289,15 @@ export default { }; }, computed: { - ...mapState(["req", "selected", "user", "show", "multiple", "selected"]), + ...mapState([ + "req", + "selected", + "user", + "show", + "multiple", + "selected", + "loading", + ]), ...mapGetters(["selectedCount"]), nameSorted() { return this.req.sorting.by === "name"; @@ -799,17 +812,13 @@ export default { viewMode: this.user.viewMode === "mosaic" ? "list" : "mosaic", }; - try { - await users.update(data, ["viewMode"]); + users.update(data, ["viewMode"]).catch(this.$showError); - // Await ensures correct value for setItemWeight() - await this.$store.commit("updateUser", data); + // Await ensures correct value for setItemWeight() + await this.$store.commit("updateUser", data); - this.setItemWeight(); - this.fillWindow(); - } catch (e) { - this.$showError(e); - } + this.setItemWeight(); + this.fillWindow(); }, upload: function () { if ( diff --git a/frontend/src/views/files/Preview.vue b/frontend/src/views/files/Preview.vue index 26521153..73600567 100644 --- a/frontend/src/views/files/Preview.vue +++ b/frontend/src/views/files/Preview.vue @@ -46,15 +46,14 @@ -
+
- -