KingNish commited on
Commit
de313f3
1 Parent(s): 57c2056

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +249 -64
index.html CHANGED
@@ -1,66 +1,251 @@
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://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css rel=stylesheet>
8
- <style>.transition-all{transition:all .3s ease-in-out}body.dark{background-color:#1a202c}body.dark .bg-white{background-color:#2d3748}body.dark .text-gray-900{color:#e2e8f0}body.dark .text-gray-700{color:#a0aec0}body.dark .bg-gray-100{background-color:#4a5568}body.dark .bg-gray-200{background-color:#718096}body.dark .bg-gradient-to-r{background-size:200% auto;background-position:left center}#darkmode-toggle span{transition:transform .3s ease-in-out}.hover:bg-gradient-to-r{background-size:200% auto;transition:background-position .5s ease-in-out}.hover:bg-gradient-to-r:hover{background-position:right center}svg{stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}</style>
9
- <script>function loadScript(){var d=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)&&!/Edg/.test(navigator.userAgent);var b=window.innerWidth>768;var e=document.querySelector('script[src="script1.js"], script[src="script2.js"]');if(e){e.remove()}var a=document.createElement("script");var c=new Date().getTime();if(d&&b){a.src="script1.js?t="+c}else{a.src="script2.js?t="+c}a.onerror=function(){console.error("Error loading script:",a.src)};document.head.appendChild(a)}document.addEventListener("DOMContentLoaded",loadScript);document.addEventListener("DOMContentLoaded",loadScript);</script>
10
- </head>
11
- <body class="bg-gray-100 dark:bg-gray-900 transition-colors duration-300">
12
- <div class="container mx-auto px-4 py-16">
13
- <div class="bg-white dark:bg-gray-800 shadow-lg rounded-lg px-8 py-6 transition-all">
14
- <div class="flex items-center justify-between mb-6">
15
- <h1 class="text-3xl font-bold text-gray-900 dark:text-white">
16
- <span class="bg-gradient-to-r from-blue-500 to-purple-500 bg-clip-text text-transparent">Voice</span> Assistant
17
- </h1>
18
- <button id=darkmode-toggle class="relative w-12 h-6 rounded-full bg-gray-300 dark:bg-gray-700 transition-colors duration-300 focus:outline-none">
19
- <span class="absolute left-1 top-1 w-4 h-4 rounded-full bg-white dark:bg-gray-900 transform transition-transform duration-300"></span>
20
- </button>
21
- </div>
22
- <div id=responseTime class="text-sm text-gray-500 dark:text-gray-400 mb-4">Latency: 0ms</div>
23
- <div class="flex items-center justify-around mb-8">
24
- <div id=userIndicator class="rounded-full px-4 py-2 text-white flex items-center transition-colors duration-300 bg-gradient-to-r from-green-400 to-blue-500 hover:bg-gradient-to-r" data-content="User: Idle">
25
- <svg class="w-4 h-4 mr-2" viewBox="0 0 24 24"><path d="M12 14a7 7 0 017 7H5a7 7 0 017-7zm0-8a4 4 0 11-8 0 4 4 0 018 0z"></path></svg>
26
- <span>Idle</span>
27
- </div>
28
- <div id=aiIndicator class="rounded-full px-4 py-2 text-white flex items-center transition-colors duration-300 bg-gradient-to-r from-red-400 to-yellow-500 hover:bg-gradient-to-r" data-content="AI: Listening">
29
- <svg class="w-4 h-4 mr-2" viewBox="0 0 24 24"><path d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path></svg>
30
- <span>Listening</span>
31
- </div>
32
- </div>
33
- <div class="flex items-center justify-center mb-8">
34
- <button style=text-align:-webkit-center id=startStopButton class="bg-gradient-to-r from-blue-500 to-purple-600 hover:from-purple-600 hover:to-blue-500 text-white font-bold py-2 px-4 rounded transition-all focus:outline-none focus:shadow-outline">
35
- <svg id=microphoneIcon class="w-6 h-6 inline-block mr-2" viewBox="0 0 24 24"><path d="M12 14v2a4 4 0 004 4h0a4 4 0 004-4v-2M16 7a4 4 0 10-8 0v4h8z"></path></svg>
36
- <span>Start Listening</span>
37
- </button>
38
- </div>
39
- <div class=mt-8>
40
- <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
41
- <div>
42
- <label for=voiceSelect class="block text-gray-700 dark:text-gray-300 font-bold mb-2">Voice:</label>
43
- <select id=voiceSelect class="w-full bg-gray-200 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 py-2 px-3 rounded focus:outline-none focus:shadow-outline">
44
- <option value=Amy>Female</option>
45
- <option value=Brian>Male</option>
46
- </select>
47
- </div>
48
- <div>
49
- <label for=modelSelect class="block text-gray-700 dark:text-gray-300 font-bold mb-2">Model:</label>
50
- <select id=modelSelect class="w-full bg-gray-200 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 py-2 px-3 rounded focus:outline-none focus:shadow-outline">
51
- <option value=8b>Fastest</option>
52
- <option value=70b>Powerful</option>
53
- </select>
54
- </div>
55
- <div class="flex items-center" style=visibility:hidden>
56
- <label for=noiseSuppression class="block text-gray-700 dark:text-gray-300 font-bold mb-2">Noise Suppression:</label>
57
- <input type=checkbox id=noiseSuppression checked class="ml-2 form-checkbox h-5 w-5 text-blue-500">
58
- </div>
59
- </div>
60
- </div>
61
- <div id=transcript class="mt-8 p-4 bg-gray-200 dark:bg-gray-700 rounded-lg text-sm font-mono whitespace-pre-wrap transition-all"></div>
62
- </div>
63
- </div>
64
- <script>document.addEventListener("DOMContentLoaded",function(){const a=document.getElementById("darkmode-toggle");function d(e){if(e==="dark"){document.body.classList.add("dark");a.querySelector("span").style.transform="translateX(24px)"}else{document.body.classList.remove("dark");a.querySelector("span").style.transform="translateX(0)"}localStorage.setItem("theme",e)}function b(){const e=document.body.classList.contains("dark");d(e?"light":"dark")}const c=localStorage.getItem("theme");d(c||"light");a.addEventListener("click",b)});</script>
65
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  </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
+ --background-color: #f0f4f8;
13
+ --card-bg-color: #ffffff;
14
+ --text-color: #333333;
15
+ --border-color: #e0e0e0;
16
+ }
17
+
18
+ body {
19
+ font-family: 'Roboto', sans-serif;
20
+ background-color: var(--background-color);
21
+ color: var(--text-color);
22
+ margin: 0;
23
+ padding: 0;
24
+ display: flex;
25
+ justify-content: center;
26
+ align-items: center;
27
+ min-height: 100vh;
28
+ }
29
+
30
+ .container {
31
+ width: 90%;
32
+ max-width: 800px;
33
+ }
34
+
35
+ .voice-assistant-card {
36
+ background-color: var(--card-bg-color);
37
+ border-radius: 20px;
38
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
39
+ padding: 40px;
40
+ text-align: center;
41
+ }
42
+
43
+ .title {
44
+ font-size: 2.5rem;
45
+ font-weight: 700;
46
+ margin-bottom: 20px;
47
+ color: var(--primary-color);
48
+ }
49
+
50
+ #responseTime {
51
+ font-size: 0.9rem;
52
+ color: #777;
53
+ margin-bottom: 20px;
54
+ }
55
+
56
+ .indicator-wrapper {
57
+ display: flex;
58
+ justify-content: space-around;
59
+ margin-bottom: 30px;
60
+ }
61
+
62
+ .indicator {
63
+ display: flex;
64
+ align-items: center;
65
+ padding: 10px 20px;
66
+ border-radius: 50px;
67
+ font-size: 1rem;
68
+ color: #fff;
69
+ transition: all 0.3s ease;
70
+ }
71
+
72
+ .indicator svg {
73
+ margin-right: 8px;
74
+ }
75
+
76
+ #userIndicator {
77
+ background-color: var(--primary-color);
78
+ }
79
+
80
+ #aiIndicator {
81
+ background-color: var(--secondary-color);
82
+ }
83
+
84
+ #startStopButton {
85
+ background-color: #38cb96;
86
+ color: #fff;
87
+ border: none;
88
+ padding: 15px 30px;
89
+ font-size: 1.2rem;
90
+ border-radius: 50px;
91
+ cursor: pointer;
92
+ transition: all 0.3s ease;
93
+ display: flex;
94
+ align-items: center;
95
+ justify-content: center;
96
+ margin: 0 auto 30px;
97
+ }
98
+
99
+ #startStopButton:hover {
100
+ background-color: #1e9b6e;
101
+ transform: translateY(-2px);
102
+ box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
103
+ }
104
+
105
+ #startStopButton svg {
106
+ margin-right: 10px;
107
+ }
108
+
109
+ .settings {
110
+ display: grid;
111
+ grid-template-columns: 1fr 1fr 1.5fr;
112
+ gap: 20px;
113
+ margin-bottom: 30px;
114
+ }
115
+
116
+ .setting {
117
+ text-align: left;
118
+ position: relative;
119
+ /* Added for tooltip positioning */
120
+ }
121
+
122
+ .setting label {
123
+ display: block;
124
+ margin-bottom: 5px;
125
+ font-weight: 700;
126
+ color: var(--text-color);
127
+ }
128
+
129
+ select,
130
+ input[type="password"] {
131
+ width: 100%;
132
+ padding: 10px;
133
+ border: 1px solid var(--border-color);
134
+ border-radius: 5px;
135
+ font-size: 1rem;
136
+ background-color: #fff;
137
+ color: var(--text-color);
138
+ }
139
+
140
+ .tooltip {
141
+ display: none;
142
+ position: absolute;
143
+ background-color: #333;
144
+ color: #fff;
145
+ padding: 5px;
146
+ border-radius: 5px;
147
+ font-size: 0.8rem;
148
+ }
149
+
150
+ .setting:hover .tooltip {
151
+ display: block;
152
+ /* Show tooltip on hover */
153
+ }
154
+
155
+ #transcript {
156
+ background-color: #f9f9f9;
157
+ border-radius: 10px;
158
+ padding: 20px;
159
+ margin-top: 30px;
160
+ text-align: left;
161
+ font-family: 'Courier New', monospace;
162
+ white-space: pre-wrap;
163
+ max-height: 200px;
164
+ overflow-y: auto;
165
+ }
166
+
167
+ @media (max-width: 600px) {
168
+ .settings {
169
+ grid-template-columns: 1fr;
170
+ }
171
+ }
172
+ </style>
173
+ </head>
174
+ <body>
175
+ <div class="container">
176
+ <div class="voice-assistant-card">
177
+ <h1 class="title">Voice Assistant</h1>
178
+ <div id="responseTime">Latency: 0ms</div>
179
+ <div class="indicator-wrapper">
180
+ <div id="userIndicator" class="indicator">
181
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
182
+ <path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path>
183
+ <circle cx="12" cy="7" r="4"></circle>
184
+ </svg>
185
+ <span>User: Idle</span>
186
+ </div>
187
+ <div id="aiIndicator" class="indicator">
188
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
189
+ <polygon points="12 2 2 7 12 12 22 7 12 2"></polygon>
190
+ <polyline points="2 17 12 22 22 17"></polyline>
191
+ <polyline points="2 12 12 17 22 12"></polyline>
192
+ </svg>
193
+ <span>AI: Idle</span>
194
+ </div>
195
+ </div>
196
+ <button id="startStopButton">
197
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
198
+ <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"></path>
199
+ <path d="M19 10v2a7 7 0 0 1-14 0v-2"></path>
200
+ <line x1="12" y1="19" x2="12" y2="23"></line>
201
+ <line x1="8" y1="23" x2="16" y2="23"></line>
202
+ </svg> Start Listening </button>
203
+ <div class="settings">
204
+ <div class="setting">
205
+ <label for="voiceSelect">Voice:</label>
206
+ <select id="voiceSelect">
207
+ <option value="Amy">Female</option>
208
+ <option value="Brian">Male</option>
209
+ </select>
210
+ <span class="tooltip">Select the voice type for the assistant.</span>
211
+ </div>
212
+ <div class="setting">
213
+ <label for="modelSelect">Model:</label>
214
+ <select id="modelSelect">
215
+ <option value="8b">Fastest</option>
216
+ <option value="70b">Powerful</option>
217
+ </select>
218
+ <span class="tooltip">Choose the model based on speed or power.</span>
219
+ </div>
220
+ <div class="setting">
221
+ <label for="apiKey">SambaNava API Key (optional):</label>
222
+ <input type="password" id="apiKey" placeholder="Enter your API Key">
223
+ <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>
224
+ </div>
225
+ </div>
226
+ <div id="transcript"></div>
227
+ </div>
228
+ </div>
229
+ <script>
230
+ function loadScript() {
231
+ var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) && !/Edg/.test(navigator.userAgent);
232
+ var isDesktop = window.innerWidth > 768;
233
+ var existingScript = document.querySelector('script[src="script1.js"], script[src="script2.js"]');
234
+ if (existingScript) {
235
+ existingScript.remove();
236
+ }
237
+ var script = document.createElement('script');
238
+ if (isChrome && isDesktop) {
239
+ script.src = 'script1.js';
240
+ } else {
241
+ script.src = 'script2.js';
242
+ }
243
+ script.onerror = function() {
244
+ console.error('Error loading script:', script.src);
245
+ };
246
+ document.head.appendChild(script);
247
+ }
248
+ document.addEventListener('DOMContentLoaded', loadScript);
249
+ </script>
250
+ </body>
251
  </html>