Spaces:
Running
Running
Update index.html
Browse files- index.html +300 -248
index.html
CHANGED
@@ -1,251 +1,303 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en">
|
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 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Voice Assistant</title>
|
7 |
+
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
|
8 |
+
<style>
|
9 |
+
:root {
|
10 |
+
--primary-color: #4a90e2;
|
11 |
+
--secondary-color: #f39c12;
|
12 |
+
--accent-color: #38cb96;
|
13 |
+
--background-color: #f0f4f8;
|
14 |
+
--card-bg-color: #ffffff;
|
15 |
+
--text-color: #333333;
|
16 |
+
--border-color: #e0e0e0;
|
17 |
+
--shadow-color: rgba(0, 0, 0, 0.1);
|
18 |
+
--hover-shadow-color: rgba(74, 144, 226, 0.3);
|
19 |
+
--hover-bg-color: #1e9b6e;
|
20 |
+
--active-bg-color: #1a855d;
|
21 |
+
--tooltip-bg-color: #333;
|
22 |
+
--tooltip-text-color: #fff;
|
23 |
+
}
|
24 |
+
|
25 |
+
body {
|
26 |
+
font-family: 'Roboto', sans-serif;
|
27 |
+
background: linear-gradient(135deg, var(--background-color) 0%, #dfe9f3 100%);
|
28 |
+
color: var(--text-color);
|
29 |
+
margin: 0;
|
30 |
+
padding: 0;
|
31 |
+
display: flex;
|
32 |
+
justify-content: center;
|
33 |
+
align-items: center;
|
34 |
+
min-height: 100vh;
|
35 |
+
}
|
36 |
+
|
37 |
+
.container {
|
38 |
+
width: 90%;
|
39 |
+
max-width: 800px;
|
40 |
+
}
|
41 |
+
|
42 |
+
.voice-assistant-card {
|
43 |
+
background: linear-gradient(135deg, var(--card-bg-color) 0%, #f9f9f9 100%);
|
44 |
+
border-radius: 20px;
|
45 |
+
box-shadow: 0 10px 30px var(--shadow-color);
|
46 |
+
padding: 40px;
|
47 |
+
text-align: center;
|
48 |
+
position: relative;
|
49 |
+
overflow: hidden;
|
50 |
+
}
|
51 |
+
|
52 |
+
.voice-assistant-card::before {
|
53 |
+
content: '';
|
54 |
+
position: absolute;
|
55 |
+
top: 0;
|
56 |
+
left: 0;
|
57 |
+
width: 100%;
|
58 |
+
height: 100%;
|
59 |
+
background: rgba(255, 255, 255, 0.1);
|
60 |
+
border-radius: 20px;
|
61 |
+
z-index: -1;
|
62 |
+
filter: blur(10px);
|
63 |
+
}
|
64 |
+
|
65 |
+
.title {
|
66 |
+
font-size: 2.5rem;
|
67 |
+
font-weight: 700;
|
68 |
+
margin-bottom: 20px;
|
69 |
+
color: var(--primary-color);
|
70 |
+
position: relative;
|
71 |
+
z-index: 1;
|
72 |
+
}
|
73 |
+
|
74 |
+
#responseTime {
|
75 |
+
font-size: 0.9rem;
|
76 |
+
color: #777;
|
77 |
+
margin-bottom: 20px;
|
78 |
+
position: relative;
|
79 |
+
z-index: 1;
|
80 |
+
}
|
81 |
+
|
82 |
+
.indicator-wrapper {
|
83 |
+
display: flex;
|
84 |
+
justify-content: space-around;
|
85 |
+
margin-bottom: 30px;
|
86 |
+
position: relative;
|
87 |
+
z-index: 1;
|
88 |
+
}
|
89 |
+
|
90 |
+
.indicator {
|
91 |
+
display: flex;
|
92 |
+
align-items: center;
|
93 |
+
padding: 10px 20px;
|
94 |
+
border-radius: 50px;
|
95 |
+
font-size: 1rem;
|
96 |
+
color: #fff;
|
97 |
+
transition: all 0.3s ease;
|
98 |
+
position: relative;
|
99 |
+
z-index: 1;
|
100 |
+
}
|
101 |
+
|
102 |
+
.indicator svg {
|
103 |
+
margin-right: 8px;
|
104 |
+
}
|
105 |
+
|
106 |
+
#userIndicator {
|
107 |
+
background: linear-gradient(135deg, var(--primary-color) 0%, #6fb1f2 100%);
|
108 |
+
}
|
109 |
+
|
110 |
+
#aiIndicator {
|
111 |
+
background: linear-gradient(135deg, var(--secondary-color) 0%, #ffaf5c 100%);
|
112 |
+
}
|
113 |
+
|
114 |
+
#startStopButton {
|
115 |
+
background: linear-gradient(135deg, var(--accent-color) 0%, #28b475 100%);
|
116 |
+
color: #fff;
|
117 |
+
border: none;
|
118 |
+
padding: 15px 30px;
|
119 |
+
font-size: 1.2rem;
|
120 |
+
border-radius: 50px;
|
121 |
+
cursor: pointer;
|
122 |
+
transition: all 0.3s ease;
|
123 |
+
display: flex;
|
124 |
+
align-items: center;
|
125 |
+
justify-content: center;
|
126 |
+
margin: 0 auto 30px;
|
127 |
+
position: relative;
|
128 |
+
z-index: 1;
|
129 |
+
}
|
130 |
+
|
131 |
+
#startStopButton:hover {
|
132 |
+
background: linear-gradient(135deg, var(--hover-bg-color) 0%, #28b475 100%);
|
133 |
+
transform: translateY(-2px);
|
134 |
+
box-shadow: 0 5px 15px var(--hover-shadow-color);
|
135 |
+
}
|
136 |
+
|
137 |
+
#startStopButton:active {
|
138 |
+
background: linear-gradient(135deg, var(--active-bg-color) 0%, #28b475 100%);
|
139 |
+
transform: translateY(0);
|
140 |
+
box-shadow: 0 2px 10px var(--shadow-color);
|
141 |
+
}
|
142 |
+
|
143 |
+
#startStopButton svg {
|
144 |
+
margin-right: 10px;
|
145 |
+
}
|
146 |
+
|
147 |
+
.settings {
|
148 |
+
display: grid;
|
149 |
+
grid-template-columns: 1fr 1fr 1.5fr;
|
150 |
+
gap: 20px;
|
151 |
+
margin-bottom: 30px;
|
152 |
+
position: relative;
|
153 |
+
z-index: 1;
|
154 |
+
}
|
155 |
+
|
156 |
+
.setting {
|
157 |
+
text-align: left;
|
158 |
+
position: relative;
|
159 |
+
/* Added for tooltip positioning */
|
160 |
+
}
|
161 |
+
|
162 |
+
.setting label {
|
163 |
+
display: block;
|
164 |
+
margin-bottom: 5px;
|
165 |
+
font-weight: 700;
|
166 |
+
color: var(--text-color);
|
167 |
+
}
|
168 |
+
|
169 |
+
select,
|
170 |
+
input[type="password"] {
|
171 |
+
width: 100%;
|
172 |
+
padding: 10px;
|
173 |
+
border: 1px solid var(--border-color);
|
174 |
+
border-radius: 5px;
|
175 |
+
font-size: 1rem;
|
176 |
+
background-color: #fff;
|
177 |
+
color: var(--text-color);
|
178 |
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
179 |
+
transition: all 0.3s ease;
|
180 |
+
}
|
181 |
+
|
182 |
+
select:hover,
|
183 |
+
input[type="password"]:hover {
|
184 |
+
border-color: var(--primary-color);
|
185 |
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
186 |
+
}
|
187 |
+
|
188 |
+
.tooltip {
|
189 |
+
display: none;
|
190 |
+
position: absolute;
|
191 |
+
background-color: var(--tooltip-bg-color);
|
192 |
+
color: var(--tooltip-text-color);
|
193 |
+
padding: 5px;
|
194 |
+
border-radius: 5px;
|
195 |
+
font-size: 0.8rem;
|
196 |
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
|
197 |
+
}
|
198 |
+
|
199 |
+
.setting:hover .tooltip {
|
200 |
+
display: block;
|
201 |
+
/* Show tooltip on hover */
|
202 |
+
}
|
203 |
+
|
204 |
+
#transcript {
|
205 |
+
background: linear-gradient(135deg, #f9f9f9 0%, #e6e6e6 100%);
|
206 |
+
border-radius: 10px;
|
207 |
+
padding: 20px;
|
208 |
+
margin-top: 30px;
|
209 |
+
text-align: left;
|
210 |
+
font-family: 'Courier New', monospace;
|
211 |
+
white-space: pre-wrap;
|
212 |
+
max-height: 200px;
|
213 |
+
overflow-y: auto;
|
214 |
+
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
215 |
+
position: relative;
|
216 |
+
z-index: 1;
|
217 |
+
}
|
218 |
+
|
219 |
+
@media (max-width: 600px) {
|
220 |
+
.settings {
|
221 |
+
grid-template-columns: 1fr;
|
222 |
+
}
|
223 |
+
}
|
224 |
+
</style>
|
225 |
+
</head>
|
226 |
+
<body>
|
227 |
+
<div class="container">
|
228 |
+
<div class="voice-assistant-card">
|
229 |
+
<h1 class="title">Voice Assistant</h1>
|
230 |
+
<div id="responseTime">Latency: 0ms</div>
|
231 |
+
<div class="indicator-wrapper">
|
232 |
+
<div id="userIndicator" class="indicator">
|
233 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
234 |
+
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
|
235 |
+
<circle cx="12" cy="7" r="4"></circle>
|
236 |
+
</svg>
|
237 |
+
<span>User: Idle</span>
|
238 |
+
</div>
|
239 |
+
<div id="aiIndicator" class="indicator">
|
240 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
241 |
+
<polygon points="12 2 2 7 12 12 22 7 12 2"></polygon>
|
242 |
+
<polyline points="2 17 12 22 22 17"></polyline>
|
243 |
+
<polyline points="2 12 12 17 22 12"></polyline>
|
244 |
+
</svg>
|
245 |
+
<span>AI: Idle</span>
|
246 |
+
</div>
|
247 |
+
</div>
|
248 |
+
<button id="startStopButton">
|
249 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
250 |
+
<path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path>
|
251 |
+
<path d="M19 10v2a7 7 0 0 1-14 0v-2"></path>
|
252 |
+
<line x1="12" y1="19" x2="12" y2="23"></line>
|
253 |
+
<line x1="8" y1="23" x2="16" y2="23"></line>
|
254 |
+
</svg> Start Listening </button>
|
255 |
+
<div class="settings">
|
256 |
+
<div class="setting">
|
257 |
+
<label for="voiceSelect">Voice:</label>
|
258 |
+
<select id="voiceSelect">
|
259 |
+
<option value="Amy">Female</option>
|
260 |
+
<option value="Brian">Male</option>
|
261 |
+
</select>
|
262 |
+
<span class="tooltip">Select the voice type for the assistant.</span>
|
263 |
+
</div>
|
264 |
+
<div class="setting">
|
265 |
+
<label for="modelSelect">Model:</label>
|
266 |
+
<select id="modelSelect">
|
267 |
+
<option value="8b">Fastest</option>
|
268 |
+
<option value="70b">Powerful</option>
|
269 |
+
</select>
|
270 |
+
<span class="tooltip">Choose the model based on speed or power.</span>
|
271 |
+
</div>
|
272 |
+
<div class="setting">
|
273 |
+
<label for="apiKey">SambaNava API Key (optional):</label>
|
274 |
+
<input type="password" id="apiKey" placeholder="Enter your API Key">
|
275 |
+
<span class="tooltip">Use SambaNova API key for enhanced speed. You can obtain a free key from <a href="https://cloud.sambanova.ai/apis" style="color: #00f9f0;">https://cloud.sambanova.ai/apis</a>. </span>
|
276 |
+
</div>
|
277 |
+
</div>
|
278 |
+
<div id="transcript"></div>
|
279 |
+
</div>
|
280 |
+
</div>
|
281 |
+
<script>
|
282 |
+
function loadScript() {
|
283 |
+
var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) && !/Edg/.test(navigator.userAgent);
|
284 |
+
var isDesktop = window.innerWidth > 768;
|
285 |
+
var existingScript = document.querySelector('script[src="script1.js"], script[src="script2.js"]');
|
286 |
+
if (existingScript) {
|
287 |
+
existingScript.remove();
|
288 |
+
}
|
289 |
+
var script = document.createElement('script');
|
290 |
+
if (isChrome && isDesktop) {
|
291 |
+
script.src = 'script1.js';
|
292 |
+
} else {
|
293 |
+
script.src = 'script2.js';
|
294 |
+
}
|
295 |
+
script.onerror = function() {
|
296 |
+
console.error('Error loading script:', script.src);
|
297 |
+
};
|
298 |
+
document.head.appendChild(script);
|
299 |
+
}
|
300 |
+
document.addEventListener('DOMContentLoaded', loadScript);
|
301 |
+
</script>
|
302 |
+
</body>
|
303 |
</html>
|