Spaces:
Runtime error
Runtime error
UI update
Browse files- templates/index.html +58 -1
templates/index.html
CHANGED
@@ -14,4 +14,61 @@
|
|
14 |
textarea {
|
15 |
width: 100%;
|
16 |
height: 200px;
|
17 |
-
padding
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
textarea {
|
15 |
width: 100%;
|
16 |
height: 200px;
|
17 |
+
padding: 10px;
|
18 |
+
margin-bottom: 20px;
|
19 |
+
border-radius: 5px;
|
20 |
+
border: 1px solid #ccc;
|
21 |
+
}
|
22 |
+
button {
|
23 |
+
padding: 10px 20px;
|
24 |
+
background-color: #007bff;
|
25 |
+
color: white;
|
26 |
+
border: none;
|
27 |
+
border-radius: 5px;
|
28 |
+
cursor: pointer;
|
29 |
+
}
|
30 |
+
button:hover {
|
31 |
+
background-color: #0056b3;
|
32 |
+
}
|
33 |
+
#result {
|
34 |
+
margin-top: 20px;
|
35 |
+
padding: 10px;
|
36 |
+
background-color: #e9ecef;
|
37 |
+
border: 1px solid #ccc;
|
38 |
+
border-radius: 5px;
|
39 |
+
}
|
40 |
+
</style>
|
41 |
+
</head>
|
42 |
+
<body>
|
43 |
+
<h1>Text Summarization</h1>
|
44 |
+
<p>Enter the text you want to summarize:</p>
|
45 |
+
<textarea id="input-text" placeholder="Paste your text here..."></textarea>
|
46 |
+
<br>
|
47 |
+
<button onclick="summarizeText()">Summarize</button>
|
48 |
+
|
49 |
+
<div id="result"></div>
|
50 |
+
|
51 |
+
<script>
|
52 |
+
async function summarizeText() {
|
53 |
+
const text = document.getElementById('input-text').value;
|
54 |
+
if (text) {
|
55 |
+
const response = await fetch('/summarize', {
|
56 |
+
method: 'POST',
|
57 |
+
headers: {
|
58 |
+
'Content-Type': 'application/json'
|
59 |
+
},
|
60 |
+
body: JSON.stringify({ text: text })
|
61 |
+
});
|
62 |
+
const result = await response.json();
|
63 |
+
if (result.summary) {
|
64 |
+
document.getElementById('result').innerText = 'Summary: ' + result.summary;
|
65 |
+
} else if (result.error) {
|
66 |
+
document.getElementById('result').innerText = 'Error: ' + result.error;
|
67 |
+
}
|
68 |
+
} else {
|
69 |
+
document.getElementById('result').innerText = 'Please enter some text.';
|
70 |
+
}
|
71 |
+
}
|
72 |
+
</script>
|
73 |
+
</body>
|
74 |
+
</html>
|