-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
117 lines (102 loc) · 3.03 KB
/
index.html
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LLM Search Engine</title>
<style>
/* Basic CSS for a minimalistic look */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: rgb(12,12,12);
}
.search-container {
text-align: center;
}
.search-bar {
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
width: 550px;
height: 30px;
margin-bottom: 20px;
font-size: 20px;
outline: none;
background-color: rgb(40,40,40);
color: white;
}
.search-button {
margin-left: 5px;
margin-bottom: 20px;
padding: 10px;
border: none;
background-color: rgb(245,193,169);
color: white;
border-radius: 50%; /* Making it a circle */
width: 50px; /* Equal width and height */
height: 50px;
font-size: 20px;
cursor: pointer;
}
.results {
max-width: 600px;
margin: 0 auto;
background-color: #e0e0e0;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
padding: 20px;
text-align: left;
}
.source-list {
margin-top: 10px;
list-style: none;
padding-left: 0;
}
.source-list li {
margin-bottom: 5px;
}
</style>
</head>
<body>
<div class="search-container">
<input type="text" id="searchInput" class="search-bar" placeholder=" Ask your question ...">
<button id="searchButton" class="search-button" onclick="search()">🔍</button>
<div id="results" class="results" style="display: none;">
<h2>Results:</h2>
<p id="answer"></p>
<ul id="sourceList" class="source-list"></ul>
</div>
</div>
<script>
function search() {
const query = document.getElementById('searchInput').value;
// Perform actions here with the query, like using APIs and fetching data
// For demonstration purposes, let's simulate a response
const answer = "This is a sample answer from LLM";
const sources = ["Source 1 - blah", "Source 2 - blah blah", "Source 3 - blah blah blah"];
// Update the results view
document.getElementById('answer').innerText = answer;
const sourceList = document.getElementById('sourceList');
sourceList.innerHTML = ''; // Clear previous sources
sources.forEach(source => {
const li = document.createElement('li');
li.textContent = source;
sourceList.appendChild(li);
});
document.getElementById('results').style.display = 'block';
}
// Listen for 'Enter' key press on input field
document.getElementById('searchInput').addEventListener('keypress', function (e) {
if (e.key === 'Enter') {
search(); // Call the search function when Enter is pressed
}
});
</script>
</body>
</html>