Update static/index.html
Browse files- static/index.html +6 -10
static/index.html
CHANGED
@@ -403,17 +403,12 @@ input[type="number"]#best_max_flavors:focus {
|
|
403 |
const resultContainer = document.getElementById('resultContainer');
|
404 |
const data = await response.text(); // Get response as text
|
405 |
|
406 |
-
//
|
407 |
-
const
|
|
|
408 |
|
409 |
-
//
|
410 |
-
|
411 |
-
|
412 |
-
// Join the unique words to form a complete sentence
|
413 |
-
const completeSentence = uniqueWords.join(' ');
|
414 |
-
|
415 |
-
// Display the complete sentence in the result container
|
416 |
-
resultContainer.innerHTML = `<p style="color: white;">The image features ${completeSentence}.</p>`;
|
417 |
} else {
|
418 |
document.getElementById('resultContainer').innerHTML = `<p style="color: white;">Oops! Something went wrong. Please try again later.</p>`;
|
419 |
}
|
@@ -423,6 +418,7 @@ input[type="number"]#best_max_flavors:focus {
|
|
423 |
}
|
424 |
}
|
425 |
|
|
|
426 |
function copyTextToClipboard() {
|
427 |
const resultContainer = document.getElementById('resultContainer');
|
428 |
const textToCopy = resultContainer.innerText;
|
|
|
403 |
const resultContainer = document.getElementById('resultContainer');
|
404 |
const data = await response.text(); // Get response as text
|
405 |
|
406 |
+
// Extract the last sentence from the response string
|
407 |
+
const lastCommaIndex = data.lastIndexOf(',');
|
408 |
+
const lastSentence = data.substring(lastCommaIndex + 1).trim();
|
409 |
|
410 |
+
// Display the last sentence in the result container
|
411 |
+
resultContainer.innerHTML = `<p style="color: white;">${lastSentence}</p>`;
|
|
|
|
|
|
|
|
|
|
|
|
|
412 |
} else {
|
413 |
document.getElementById('resultContainer').innerHTML = `<p style="color: white;">Oops! Something went wrong. Please try again later.</p>`;
|
414 |
}
|
|
|
418 |
}
|
419 |
}
|
420 |
|
421 |
+
|
422 |
function copyTextToClipboard() {
|
423 |
const resultContainer = document.getElementById('resultContainer');
|
424 |
const textToCopy = resultContainer.innerText;
|