From 712c3d90c73112d0d7ed0fb2a5c370e69874e258 Mon Sep 17 00:00:00 2001 From: Justin Georgi Date: Fri, 12 Jan 2024 21:29:14 -0700 Subject: [PATCH] Add preloader animation (#72) Closes: #70 Adds a prelaoder animation to the results container while the image is loading and being processed for detections. Signed-off-by: Justin Georgi Reviewed-on: https://gitea.azgeorgis.net/Georgi_Lab/ALVINN_f7/pulls/72 --- src/pages/detect.vue | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/pages/detect.vue b/src/pages/detect.vue index 48398db..baa5a93 100644 --- a/src/pages/detect.vue +++ b/src/pages/detect.vue @@ -8,9 +8,8 @@
-
-
+
- No results. + No results. +
@@ -99,7 +99,7 @@ .detect-grid { display: grid; grid-template-columns: 1fr; - grid-template-rows: 1fr auto auto min-content; + grid-template-rows: 1fr 56px auto min-content; grid-template-areas: "image-view" "result-view" @@ -203,7 +203,7 @@ @media (max-height: 450px) and (orientation: landscape) { .detect-grid { - grid-template-columns: minmax(0,1fr) max-content auto auto; + grid-template-columns: minmax(0,1fr) minmax(56px,max-content) auto auto; grid-template-rows: calc(100vh - var(--f7-navbar-height) - var(--f7-safe-area-top) - var(--f7-safe-area-bottom) - 64px); grid-template-areas: "image-view result-view detect-settings menu-view"; @@ -304,6 +304,7 @@ imageLoaded: false, imageView: null, imageLoadMode: "environment", + detecting: false, detectPanel: false, showDetectSettings: false, detectorName: '', @@ -400,10 +401,12 @@ if (this.status !== 200) { //this.response.text().then(function(message){alert(message)}) console.log(xhr.response) + self.detecting = false return; } self.resultData = JSON.parse(xhr.response) self.uploadDirty = true + self.detecting = false } var doodsData = { @@ -496,6 +499,7 @@ const searchImage = this.$refs.image_chooser.files[0] var reader = new FileReader() reader.addEventListener("loadend", () => { + this.detecting = true resolve(reader.result) }) reader.readAsDataURL(searchImage)