updates
Browse files- static/index.html +26 -22
- static/style.css +10 -1
static/index.html
CHANGED
@@ -78,11 +78,11 @@
|
|
78 |
<div class="display-generate">
|
79 |
<div class="image-container">
|
80 |
<img src="images/placeholder.png" class="placeholder" />
|
81 |
-
<
|
82 |
-
src="images/spinner.svg"
|
83 |
-
class="
|
84 |
-
|
85 |
-
|
86 |
</div>
|
87 |
|
88 |
<div class="alert alert-secondary action-menu" role="alert">
|
@@ -145,11 +145,11 @@
|
|
145 |
</div>
|
146 |
<div class="image-container">
|
147 |
<img src="images/placeholder.png" class="placeholder" />
|
148 |
-
<
|
149 |
-
src="images/spinner.svg"
|
150 |
-
class="
|
151 |
-
|
152 |
-
|
153 |
</div>
|
154 |
<div class="output-container mt-5" style="display: none">
|
155 |
<h3 class="mt-4 mb-4">Verification output</h3>
|
@@ -294,7 +294,9 @@
|
|
294 |
Submit
|
295 |
</button>
|
296 |
|
297 |
-
<div class="error mt-3">
|
|
|
|
|
298 |
</form>
|
299 |
|
300 |
<div class="how-it-works">
|
@@ -353,7 +355,9 @@
|
|
353 |
Submit
|
354 |
</button>
|
355 |
|
356 |
-
<div class="error mt-3">
|
|
|
|
|
357 |
</form>
|
358 |
<div class="how-it-works">
|
359 |
<p><strong>How it works</strong></p>
|
@@ -485,8 +489,7 @@
|
|
485 |
});
|
486 |
|
487 |
function submitForm() {
|
488 |
-
if (!fileUpload.value || !verifyTerms.checked)
|
489 |
-
return
|
490 |
|
491 |
const file = document.getElementById("fileUpload").files[0];
|
492 |
|
@@ -498,11 +501,11 @@
|
|
498 |
.setAttribute("src", fileReader.result);
|
499 |
};
|
500 |
|
501 |
-
document.querySelector(
|
502 |
placeholder = document.querySelector(".display-verify .placeholder");
|
503 |
spinner = document.querySelector(".display-verify .spinner");
|
504 |
placeholder.style.display = "none";
|
505 |
-
|
506 |
if (document.getElementById("verifyresult"))
|
507 |
document.getElementById("verifyresult").remove(); // JCL make sure to remove the correct one
|
508 |
spinner.style.display = "block";
|
@@ -605,15 +608,16 @@
|
|
605 |
})
|
606 |
.catch((error) => {
|
607 |
console.log(error);
|
608 |
-
document.querySelector(
|
|
|
609 |
|
610 |
fileUpload.value = "";
|
611 |
setVerifyButtonStatus();
|
612 |
|
613 |
document.querySelector(".display-verify .spinner").style.display =
|
614 |
"none";
|
615 |
-
|
616 |
-
"block";
|
617 |
// Handle errors
|
618 |
});
|
619 |
}
|
@@ -635,7 +639,7 @@
|
|
635 |
placeholder = document.querySelector(".display-generate .placeholder");
|
636 |
spinner = document.querySelector(".display-generate .spinner");
|
637 |
generateActionMenu.style.display = "none";
|
638 |
-
document.querySelector(
|
639 |
|
640 |
// parameters.style.display = "none";
|
641 |
|
@@ -675,10 +679,10 @@
|
|
675 |
*/
|
676 |
} catch (err) {
|
677 |
console.error(err);
|
678 |
-
document.querySelector(
|
|
|
679 |
spinner.style.display = "none";
|
680 |
placeholder.style.display = "block";
|
681 |
-
|
682 |
}
|
683 |
});
|
684 |
|
|
|
78 |
<div class="display-generate">
|
79 |
<div class="image-container">
|
80 |
<img src="images/placeholder.png" class="placeholder" />
|
81 |
+
<div class="spinner" style="display: none">
|
82 |
+
<img src="images/spinner.svg" />
|
83 |
+
<h3 class="mt-3">Generating image...</h3>
|
84 |
+
<p class="small">In some cases, this may take 1-2 minutes.</p>
|
85 |
+
</div>
|
86 |
</div>
|
87 |
|
88 |
<div class="alert alert-secondary action-menu" role="alert">
|
|
|
145 |
</div>
|
146 |
<div class="image-container">
|
147 |
<img src="images/placeholder.png" class="placeholder" />
|
148 |
+
<div class="spinner" style="display: none">
|
149 |
+
<img src="images/spinner.svg" />
|
150 |
+
<h3 class="mt-3">Verifying image...</h3>
|
151 |
+
<p class="small">In some cases, this may take 1-2 minutes.</p>
|
152 |
+
</div>
|
153 |
</div>
|
154 |
<div class="output-container mt-5" style="display: none">
|
155 |
<h3 class="mt-4 mb-4">Verification output</h3>
|
|
|
294 |
Submit
|
295 |
</button>
|
296 |
|
297 |
+
<div class="error mt-3">
|
298 |
+
Something went wrong. Please try again.
|
299 |
+
</div>
|
300 |
</form>
|
301 |
|
302 |
<div class="how-it-works">
|
|
|
355 |
Submit
|
356 |
</button>
|
357 |
|
358 |
+
<div class="error mt-3">
|
359 |
+
Something went wrong. Please try again.
|
360 |
+
</div>
|
361 |
</form>
|
362 |
<div class="how-it-works">
|
363 |
<p><strong>How it works</strong></p>
|
|
|
489 |
});
|
490 |
|
491 |
function submitForm() {
|
492 |
+
if (!fileUpload.value || !verifyTerms.checked) return;
|
|
|
493 |
|
494 |
const file = document.getElementById("fileUpload").files[0];
|
495 |
|
|
|
501 |
.setAttribute("src", fileReader.result);
|
502 |
};
|
503 |
|
504 |
+
document.querySelector(".display-verify .error").style.display = "none";
|
505 |
placeholder = document.querySelector(".display-verify .placeholder");
|
506 |
spinner = document.querySelector(".display-verify .spinner");
|
507 |
placeholder.style.display = "none";
|
508 |
+
|
509 |
if (document.getElementById("verifyresult"))
|
510 |
document.getElementById("verifyresult").remove(); // JCL make sure to remove the correct one
|
511 |
spinner.style.display = "block";
|
|
|
608 |
})
|
609 |
.catch((error) => {
|
610 |
console.log(error);
|
611 |
+
document.querySelector(".display-verify .error").style.display =
|
612 |
+
"block";
|
613 |
|
614 |
fileUpload.value = "";
|
615 |
setVerifyButtonStatus();
|
616 |
|
617 |
document.querySelector(".display-verify .spinner").style.display =
|
618 |
"none";
|
619 |
+
document.querySelector(".display-verify .placeholder").style.display =
|
620 |
+
"block";
|
621 |
// Handle errors
|
622 |
});
|
623 |
}
|
|
|
639 |
placeholder = document.querySelector(".display-generate .placeholder");
|
640 |
spinner = document.querySelector(".display-generate .spinner");
|
641 |
generateActionMenu.style.display = "none";
|
642 |
+
document.querySelector(".display-generate .error").style.display = "none";
|
643 |
|
644 |
// parameters.style.display = "none";
|
645 |
|
|
|
679 |
*/
|
680 |
} catch (err) {
|
681 |
console.error(err);
|
682 |
+
document.querySelector(".display-generate .error").style.display =
|
683 |
+
"block";
|
684 |
spinner.style.display = "none";
|
685 |
placeholder.style.display = "block";
|
|
|
686 |
}
|
687 |
});
|
688 |
|
static/style.css
CHANGED
@@ -95,12 +95,21 @@ textarea {
|
|
95 |
}
|
96 |
|
97 |
.image-container .placeholder,
|
98 |
-
.image-container .spinner {
|
99 |
width: 48px;
|
100 |
height: 48px;
|
|
|
|
|
|
|
|
|
101 |
align-self: center;
|
102 |
}
|
103 |
|
|
|
|
|
|
|
|
|
|
|
104 |
#body .container > .row > .col:first-child {
|
105 |
border-right: 1px solid rgba(227, 234, 240, 1);
|
106 |
}
|
|
|
95 |
}
|
96 |
|
97 |
.image-container .placeholder,
|
98 |
+
.image-container .spinner img {
|
99 |
width: 48px;
|
100 |
height: 48px;
|
101 |
+
}
|
102 |
+
|
103 |
+
.image-container .placeholder,
|
104 |
+
.image-container .spinner {
|
105 |
align-self: center;
|
106 |
}
|
107 |
|
108 |
+
.image-container .spinner {
|
109 |
+
text-align: center;
|
110 |
+
color: #56687a;
|
111 |
+
}
|
112 |
+
|
113 |
#body .container > .row > .col:first-child {
|
114 |
border-right: 1px solid rgba(227, 234, 240, 1);
|
115 |
}
|