jclyo1 commited on
Commit
e51e7d3
1 Parent(s): 409803f
static/images/download_icon.svg ADDED
static/images/link_icon.svg ADDED
static/index.html CHANGED
@@ -75,6 +75,21 @@
75
  style="display: none"
76
  />
77
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  </div>
79
  <div class="display-verify">
80
  <div class="row mt-5 pb-4" id="original-image">
@@ -214,9 +229,12 @@
214
  const imagePrompt = document.getElementById("prompt");
215
  const model = document.getElementById("model");
216
  const generateImageContainer = document.querySelector(".display-generate .image-container");
 
217
  const verifyImageContainer = document.querySelector(".display-verify .image-container");
218
  const uploadedImageContainer = document.querySelector("#original-image");
 
219
 
 
220
  generateTab.addEventListener("click", (event) => {
221
  event.target.classList.add("active");
222
  verifyTab.classList.remove("active");
@@ -233,6 +251,11 @@
233
  setVerifyElementsDisplay("block");
234
  });
235
 
 
 
 
 
 
236
  function setGenerateElementsDisplay(displayStatus) {
237
  displayGenerate.forEach((item) => {
238
  item.style.display = displayStatus;
@@ -344,6 +367,7 @@
344
 
345
  placeholder = document.querySelector('.display-generate .placeholder');
346
  spinner = document.querySelector('.display-generate .spinner');
 
347
 
348
  // verificationDetails.style.display = "none";
349
  // parameters.style.display = "none";
@@ -381,6 +405,13 @@
381
  spinner.style.display = "none";
382
  generateImageContainer.appendChild(truepicDisplay);
383
 
 
 
 
 
 
 
 
384
  /*
385
  downloadLink.style.display = "block";
386
  downloadLink.href = path;
@@ -390,6 +421,7 @@
390
  promptParam.innerHTML = textGenInput.value;
391
  parameters.style.display = "block";
392
  */
 
393
  } catch (err) {
394
  console.error(err);
395
  }
 
75
  style="display: none"
76
  />
77
  </div>
78
+
79
+ <div class="alert alert-secondary action-menu" role="alert">
80
+ <div class="row">
81
+ <div class="col">
82
+ <p><strong>Non consectetur erat in non et in?</strong></p>
83
+ <p>Ornare a est accumsan et platea quis rhoncus.</p>
84
+ </div>
85
+ <div class="col flex-grow-0">
86
+ <button type="button" id="download-button" class="btn btn-outline-primary">Download image <img src="images/download_icon.svg" /></button>
87
+ </div>
88
+ <div class="col flex-grow-0">
89
+ <button type="button" id="goto-verify-button" class="btn btn-outline-primary">Go to verify tab <img src="images/link_icon.svg" /></button>
90
+ </div>
91
+ </div>
92
+ </div>
93
  </div>
94
  <div class="display-verify">
95
  <div class="row mt-5 pb-4" id="original-image">
 
229
  const imagePrompt = document.getElementById("prompt");
230
  const model = document.getElementById("model");
231
  const generateImageContainer = document.querySelector(".display-generate .image-container");
232
+ const generateActionMenu = document.querySelector(".action-menu");
233
  const verifyImageContainer = document.querySelector(".display-verify .image-container");
234
  const uploadedImageContainer = document.querySelector("#original-image");
235
+ const downloadButton = document.getElementById("download-button");
236
 
237
+
238
  generateTab.addEventListener("click", (event) => {
239
  event.target.classList.add("active");
240
  verifyTab.classList.remove("active");
 
251
  setVerifyElementsDisplay("block");
252
  });
253
 
254
+ document.getElementById('goto-verify-button').addEventListener("click", (event) => {
255
+ setVerifyElementsDisplay('block');
256
+ setGenerateElementsDisplay('none');
257
+ });
258
+
259
  function setGenerateElementsDisplay(displayStatus) {
260
  displayGenerate.forEach((item) => {
261
  item.style.display = displayStatus;
 
367
 
368
  placeholder = document.querySelector('.display-generate .placeholder');
369
  spinner = document.querySelector('.display-generate .spinner');
370
+ generateActionMenu.style.display = "none";
371
 
372
  // verificationDetails.style.display = "none";
373
  // parameters.style.display = "none";
 
405
  spinner.style.display = "none";
406
  generateImageContainer.appendChild(truepicDisplay);
407
 
408
+ generateActionMenu.style.display = "block";
409
+
410
+ downloadButton.addEventListener("click", (event) => {
411
+ event.preventDefault();
412
+ window.open(path);
413
+ });
414
+
415
  /*
416
  downloadLink.style.display = "block";
417
  downloadLink.href = path;
 
421
  promptParam.innerHTML = textGenInput.value;
422
  parameters.style.display = "block";
423
  */
424
+
425
  } catch (err) {
426
  console.error(err);
427
  }
static/style.css CHANGED
@@ -117,4 +117,12 @@ img.thumbnail {
117
 
118
  #resultLabel {
119
  display:none;
 
 
 
 
 
 
 
 
120
  }
 
117
 
118
  #resultLabel {
119
  display:none;
120
+ }
121
+
122
+ .action-menu {
123
+ display: none;
124
+ }
125
+
126
+ .action-menu button {
127
+ width: 175px;
128
  }