forked from Bansal0527/IITJ-ChatBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
storage
107 lines (81 loc) · 2.3 KB
/
storage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>College Query Page</title>
<style>
body {
font-family: 'Arial', sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
}
h1 {
color: #333;
}
label {
font-size: 1.2em;
margin-bottom: 10px;
color: #555;
}
input {
padding: 10px;
width: 300px;
border: 1px solid #ccc;
border-radius: 5px;
margin-bottom: 10px;
}
button {
background-color: #4caf50;
color: white;
padding: 10px 15px;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #45a049;
}
#answer-section {
margin-top: 20px;
}
p {
font-size: 1.2em;
color: #333;
}
</style>
</head>
<body>
<div>
<h1>College Query Page</h1>
<label for="query-text">Enter your question:</label>
<input type="text" id="query-text">
<button onclick="submitQuery()">Submit</button>
<div id="answer-section">
<!-- Answers will be displayed here -->
</div>
</div>
<script>
function submitQuery() {
const queryText = document.getElementById("query-text").value;
fetch(`/query?text=${encodeURIComponent(queryText)}`)
.then(response => response.json())
.then(data => {
const answerSection = document.getElementById("answer-section");
console.log(data.text);
answerSection.innerHTML = `<p>Answer: ${data.text}</p>`;
})
.catch(error => {
console.error("Error:", error);
});
}
</script>
</body>
</html>