Spaces:
Sleeping
Sleeping
Update templates/summarize.html
Browse files- templates/summarize.html +92 -92
templates/summarize.html
CHANGED
|
@@ -1,93 +1,93 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
-
<html lang="en">
|
| 3 |
-
|
| 4 |
-
<head>
|
| 5 |
-
<meta charset="UTF-8">
|
| 6 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
-
<title>Summarize | TaskBot
|
| 8 |
-
<link rel="Icon" href="TaskBot logo.png">
|
| 9 |
-
</head>
|
| 10 |
-
<style>
|
| 11 |
-
body {
|
| 12 |
-
background-color: #2f2f2f;
|
| 13 |
-
font-family: Arial, sans-serif;
|
| 14 |
-
color: white;
|
| 15 |
-
margin: 0;
|
| 16 |
-
padding: 20px;
|
| 17 |
-
}
|
| 18 |
-
|
| 19 |
-
h1 {
|
| 20 |
-
text-align: center;
|
| 21 |
-
}
|
| 22 |
-
|
| 23 |
-
textarea {
|
| 24 |
-
width: 100%;
|
| 25 |
-
height: 300px;
|
| 26 |
-
}
|
| 27 |
-
|
| 28 |
-
button {
|
| 29 |
-
width: 100px;
|
| 30 |
-
height: 50px;
|
| 31 |
-
text-align: center;
|
| 32 |
-
float: right;
|
| 33 |
-
}
|
| 34 |
-
|
| 35 |
-
small {
|
| 36 |
-
display: block;
|
| 37 |
-
text-align: center;
|
| 38 |
-
color: gray
|
| 39 |
-
}
|
| 40 |
-
</style>
|
| 41 |
-
|
| 42 |
-
<body>
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
<h1>Summarizer</h1>
|
| 46 |
-
<small>Powered by gemini-2.0-flash</small><br><br>
|
| 47 |
-
|
| 48 |
-
<textarea name="question" id="question" placeholder="Write your text here to summarize..."></textarea><br><br><br>
|
| 49 |
-
|
| 50 |
-
<button onclick=answer() id="answer_button">Start Summarizing</button>
|
| 51 |
-
<label for="type">Summarize to: </label>
|
| 52 |
-
<select name="type" id="type">
|
| 53 |
-
<option value="points">Points</option>
|
| 54 |
-
<option value="para">Paragraph</option>
|
| 55 |
-
</select><br><br><br>
|
| 56 |
-
<label for="lines_points">Minimum Lines/Points</label>
|
| 57 |
-
<input type="number" id="lines_points"><br><br><br>
|
| 58 |
-
|
| 59 |
-
<textarea name="answer" id="answer" placeholder="Summary will be displayed here..."></textarea>
|
| 60 |
-
<script>
|
| 61 |
-
async function answer() {
|
| 62 |
-
document.getElementById("answer_button").disabled = true
|
| 63 |
-
const userInput = document.getElementById('question').value;
|
| 64 |
-
if (userInput.trim() === '') return;
|
| 65 |
-
const question = userInput;
|
| 66 |
-
const type = document.getElementById("type").value;
|
| 67 |
-
const num_of_lines_points = document.getElementById("lines_points").value;
|
| 68 |
-
try {
|
| 69 |
-
const response = await fetch("/summarize", {
|
| 70 |
-
method: "POST",
|
| 71 |
-
headers: {
|
| 72 |
-
"Content-Type": "application/x-www-form-urlencoded"
|
| 73 |
-
},
|
| 74 |
-
body: new URLSearchParams({ question: question, type: type, num_of_lines_points: num_of_lines_points })
|
| 75 |
-
});
|
| 76 |
-
const data = await response.json();
|
| 77 |
-
const answer_area = document.getElementById("answer");
|
| 78 |
-
if (data.answer) {
|
| 79 |
-
aiResponse = data.answer;
|
| 80 |
-
} else if (data.error) {
|
| 81 |
-
aiResponse = "Error: " + data.error;
|
| 82 |
-
}
|
| 83 |
-
answer_area.value = aiResponse
|
| 84 |
-
} catch (err) {
|
| 85 |
-
console.error("Fetch Error:", err);
|
| 86 |
-
document.getElementById("answer").value = err;
|
| 87 |
-
}
|
| 88 |
-
document.getElementById("answer_button").disabled = false
|
| 89 |
-
}
|
| 90 |
-
</script>
|
| 91 |
-
</body>
|
| 92 |
-
|
| 93 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
|
| 4 |
+
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 7 |
+
<title>Summarize | TaskBot AI</title>
|
| 8 |
+
<link rel="Icon" href="TaskBot logo.png">
|
| 9 |
+
</head>
|
| 10 |
+
<style>
|
| 11 |
+
body {
|
| 12 |
+
background-color: #2f2f2f;
|
| 13 |
+
font-family: Arial, sans-serif;
|
| 14 |
+
color: white;
|
| 15 |
+
margin: 0;
|
| 16 |
+
padding: 20px;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
h1 {
|
| 20 |
+
text-align: center;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
textarea {
|
| 24 |
+
width: 100%;
|
| 25 |
+
height: 300px;
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
button {
|
| 29 |
+
width: 100px;
|
| 30 |
+
height: 50px;
|
| 31 |
+
text-align: center;
|
| 32 |
+
float: right;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
small {
|
| 36 |
+
display: block;
|
| 37 |
+
text-align: center;
|
| 38 |
+
color: gray
|
| 39 |
+
}
|
| 40 |
+
</style>
|
| 41 |
+
|
| 42 |
+
<body>
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
<h1>Summarizer</h1>
|
| 46 |
+
<small>Powered by gemini-2.0-flash</small><br><br>
|
| 47 |
+
|
| 48 |
+
<textarea name="question" id="question" placeholder="Write your text here to summarize..."></textarea><br><br><br>
|
| 49 |
+
|
| 50 |
+
<button onclick=answer() id="answer_button">Start Summarizing</button>
|
| 51 |
+
<label for="type">Summarize to: </label>
|
| 52 |
+
<select name="type" id="type">
|
| 53 |
+
<option value="points">Points</option>
|
| 54 |
+
<option value="para">Paragraph</option>
|
| 55 |
+
</select><br><br><br>
|
| 56 |
+
<label for="lines_points">Minimum Lines/Points</label>
|
| 57 |
+
<input type="number" id="lines_points"><br><br><br>
|
| 58 |
+
|
| 59 |
+
<textarea name="answer" id="answer" placeholder="Summary will be displayed here..."></textarea>
|
| 60 |
+
<script>
|
| 61 |
+
async function answer() {
|
| 62 |
+
document.getElementById("answer_button").disabled = true
|
| 63 |
+
const userInput = document.getElementById('question').value;
|
| 64 |
+
if (userInput.trim() === '') return;
|
| 65 |
+
const question = userInput;
|
| 66 |
+
const type = document.getElementById("type").value;
|
| 67 |
+
const num_of_lines_points = document.getElementById("lines_points").value;
|
| 68 |
+
try {
|
| 69 |
+
const response = await fetch("/summarize", {
|
| 70 |
+
method: "POST",
|
| 71 |
+
headers: {
|
| 72 |
+
"Content-Type": "application/x-www-form-urlencoded"
|
| 73 |
+
},
|
| 74 |
+
body: new URLSearchParams({ question: question, type: type, num_of_lines_points: num_of_lines_points })
|
| 75 |
+
});
|
| 76 |
+
const data = await response.json();
|
| 77 |
+
const answer_area = document.getElementById("answer");
|
| 78 |
+
if (data.answer) {
|
| 79 |
+
aiResponse = data.answer;
|
| 80 |
+
} else if (data.error) {
|
| 81 |
+
aiResponse = "Error: " + data.error;
|
| 82 |
+
}
|
| 83 |
+
answer_area.value = aiResponse
|
| 84 |
+
} catch (err) {
|
| 85 |
+
console.error("Fetch Error:", err);
|
| 86 |
+
document.getElementById("answer").value = err;
|
| 87 |
+
}
|
| 88 |
+
document.getElementById("answer_button").disabled = false
|
| 89 |
+
}
|
| 90 |
+
</script>
|
| 91 |
+
</body>
|
| 92 |
+
|
| 93 |
</html>
|