Spaces:
Running
Running
Update playground.html
Browse files- playground.html +300 -282
playground.html
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
<!DOCTYPE html>
|
2 |
<html lang="en">
|
3 |
|
4 |
<head>
|
@@ -13,321 +13,339 @@
|
|
13 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script>
|
14 |
|
15 |
<style>
|
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 |
-
font-family: 'JetBrains Mono', monospace;
|
118 |
-
font-size: 14px;
|
119 |
-
cursor: pointer;
|
120 |
-
transition: all 0.3s ease;
|
121 |
-
}
|
122 |
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
gap: 5px;
|
136 |
-
}
|
137 |
|
138 |
-
|
139 |
-
|
140 |
-
|
|
|
141 |
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
font-family: 'JetBrains Mono', monospace;
|
160 |
-
}
|
161 |
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
|
|
167 |
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
transition: all 0.3s ease;
|
180 |
-
}
|
181 |
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.2);
|
186 |
-
}
|
187 |
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
justify-content: center;
|
199 |
-
align-items: center;
|
200 |
-
cursor: pointer;
|
201 |
-
transition: all 0.3s ease;
|
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 |
-
right: 0;
|
248 |
-
bottom: 0;
|
249 |
-
background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1));
|
250 |
-
opacity: 0;
|
251 |
-
transition: opacity 0.3s ease;
|
252 |
-
}
|
253 |
|
254 |
-
|
255 |
-
|
256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
|
|
263 |
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
|
|
|
|
|
|
|
|
|
|
270 |
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
border: none;
|
283 |
-
border-radius: 12px;
|
284 |
-
padding: 12px 24px;
|
285 |
-
cursor: pointer;
|
286 |
-
font-family: 'JetBrains Mono', monospace;
|
287 |
-
transition: all 0.3s ease;
|
288 |
-
}
|
289 |
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
transform: translateY(0);
|
299 |
-
}
|
300 |
-
}
|
301 |
-
/* Dark theme customization for Select2 */
|
302 |
-
.select2-container--default .select2-selection--single {
|
303 |
-
background-color: #333; /* Dark background */
|
304 |
-
color: white; /* White text */
|
305 |
-
border: 1px solid #555; /* Dark border */
|
306 |
-
font-size: 14px;
|
307 |
-
}
|
308 |
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
|
|
|
|
314 |
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
overflow-y: auto; /* Add scrollbar */
|
320 |
-
}
|
321 |
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
326 |
|
327 |
-
.select2-container--default .select2-results__option--highlighted {
|
328 |
-
background-color: #555; /* Highlighted option color */
|
329 |
-
color: white; /* White text on hover */
|
330 |
-
}
|
331 |
</style>
|
332 |
</head>
|
333 |
|
@@ -381,7 +399,7 @@
|
|
381 |
<div class="chat-messages" id="chatMessages"></div>
|
382 |
<div class="chat-input">
|
383 |
<input type="text" id="chatInput" placeholder="Type your message...">
|
384 |
-
<button id="sendButton">Send</button>
|
385 |
</div>
|
386 |
</div>
|
387 |
</div>
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
<html lang="en">
|
3 |
|
4 |
<head>
|
|
|
13 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script>
|
14 |
|
15 |
<style>
|
16 |
+
@import url('https://fonts.googleapis.com/css2?family=Encode+Sans:wght@100..900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Protest+Revolution&display=swap');
|
17 |
+
:root {
|
18 |
+
--bg-dark: #0a0a0f;
|
19 |
+
--bg-darker: #040409;
|
20 |
+
--bg-deepest: #020205;
|
21 |
+
--primary-blue: #4a6cf7;
|
22 |
+
--secondary-blue: #6678e3;
|
23 |
+
--accent-color: #7e57c2;
|
24 |
+
--text-light: #e0e0e8;
|
25 |
+
--text-muted: #8a8a9b;
|
26 |
+
--border-color: #1a1a2e;
|
27 |
+
--hover-color: rgba(78, 108, 247, 0.1);
|
28 |
+
--delete-red: #ff4d4d;
|
29 |
+
--header-height: 60px;
|
30 |
+
--input-height: 80px;
|
31 |
+
}
|
32 |
|
33 |
+
* {
|
34 |
+
margin: 0;
|
35 |
+
padding: 0;
|
36 |
+
box-sizing: border-box;
|
37 |
+
scrollbar-width: thin;
|
38 |
+
scrollbar-color: var(--primary-blue) transparent;
|
39 |
+
}
|
40 |
|
41 |
+
*::-webkit-scrollbar {
|
42 |
+
width: 8px;
|
43 |
+
}
|
44 |
|
45 |
+
*::-webkit-scrollbar-track {
|
46 |
+
background: transparent;
|
47 |
+
}
|
48 |
|
49 |
+
*::-webkit-scrollbar-thumb {
|
50 |
+
background-color: var(--primary-blue);
|
51 |
+
border-radius: 20px;
|
52 |
+
}
|
53 |
|
54 |
+
body {
|
55 |
+
font-family: 'Inter', sans-serif;
|
56 |
+
background-color: var(--bg-dark);
|
57 |
+
color: var(--text-light);
|
58 |
+
display: flex;
|
59 |
+
justify-content: center;
|
60 |
+
align-items: center;
|
61 |
+
height: 100vh;
|
62 |
+
overflow: hidden;
|
63 |
+
perspective: 2000px;
|
64 |
+
}
|
65 |
|
66 |
+
.chat-wrapper {
|
67 |
+
position: relative;
|
68 |
+
width: 100%;
|
69 |
+
max-width: 800px;
|
70 |
+
height: 90vh;
|
71 |
+
background-color: var(--bg-darker);
|
72 |
+
border-radius: 24px;
|
73 |
+
overflow: hidden;
|
74 |
+
box-shadow: 0 20px 50px rgba(5, 5, 10, 0.7);
|
75 |
+
display: flex;
|
76 |
+
flex-direction: column;
|
77 |
+
opacity: 1;
|
78 |
+
transform: scale(1);
|
79 |
+
transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
|
80 |
+
border: 1px solid var(--border-color);
|
81 |
+
}
|
82 |
|
83 |
+
.chat-header {
|
84 |
+
background-color: var(--bg-deepest);
|
85 |
+
padding: 15px 20px;
|
86 |
+
display: flex;
|
87 |
+
justify-content: space-between;
|
88 |
+
align-items: center;
|
89 |
+
border-bottom: 1px solid var(--border-color);
|
90 |
+
flex-shrink: 0;
|
91 |
+
height: var(--header-height);
|
92 |
+
}
|
93 |
|
94 |
+
.chat-container {
|
95 |
+
display: none;
|
96 |
+
flex-direction: column;
|
97 |
+
height: calc(100% - var(--header-height));
|
98 |
+
position: relative;
|
99 |
+
}
|
100 |
|
101 |
+
.chat-messages {
|
102 |
+
flex: 1;
|
103 |
+
overflow-y: auto;
|
104 |
+
padding: 20px;
|
105 |
+
display: flex;
|
106 |
+
flex-direction: column;
|
107 |
+
gap: 16px;
|
108 |
+
background-color: var(--bg-dark);
|
109 |
+
font-family: 'JetBrains Mono', monospace;
|
110 |
+
height: calc(100% - var(--input-height));
|
111 |
+
margin-bottom: var(--input-height);
|
112 |
+
}
|
113 |
|
114 |
+
.chat-input {
|
115 |
+
position: absolute;
|
116 |
+
bottom: 0;
|
117 |
+
left: 0;
|
118 |
+
right: 0;
|
119 |
+
background-color: var(--bg-darker);
|
120 |
+
border-top: 1px solid var(--border-color);
|
121 |
+
padding: 16px;
|
122 |
+
height: var(--input-height);
|
123 |
+
display: flex;
|
124 |
+
gap: 12px;
|
125 |
+
z-index: 10;
|
126 |
+
align-items: center;
|
127 |
+
}
|
128 |
|
129 |
+
.chat-input-container {
|
130 |
+
position: relative;
|
131 |
+
flex: 1;
|
132 |
+
display: flex;
|
133 |
+
align-items: center;
|
134 |
+
}
|
|
|
|
|
|
|
|
|
|
|
135 |
|
136 |
+
.chat-input input {
|
137 |
+
width: 100%;
|
138 |
+
padding: 12px 16px;
|
139 |
+
padding-right: 50px; /* Space for send icon */
|
140 |
+
background-color: rgba(30, 30, 50, 0.8);
|
141 |
+
border: 1px solid var(--border-color);
|
142 |
+
border-radius: 12px;
|
143 |
+
color: var(--text-light);
|
144 |
+
font-size: 14px;
|
145 |
+
font-family: 'JetBrains Mono', monospace;
|
146 |
+
outline: none;
|
147 |
+
}
|
|
|
|
|
148 |
|
149 |
+
.chat-input input:focus {
|
150 |
+
border-color: var(--primary-blue);
|
151 |
+
box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.2);
|
152 |
+
}
|
153 |
|
154 |
+
.message {
|
155 |
+
max-width: 80%;
|
156 |
+
width: fit-content;
|
157 |
+
padding: 12px 18px;
|
158 |
+
border-radius: 12px;
|
159 |
+
font-size: 14px;
|
160 |
+
line-height: 1.5;
|
161 |
+
position: relative;
|
162 |
+
animation: fadeIn 0.4s forwards;
|
163 |
+
margin-bottom: 8px;
|
164 |
+
}
|
165 |
|
166 |
+
.message.user {
|
167 |
+
align-self: flex-end;
|
168 |
+
background-color: var(--primary-blue);
|
169 |
+
color: white;
|
170 |
+
}
|
|
|
|
|
171 |
|
172 |
+
.message.bot {
|
173 |
+
align-self: flex-start;
|
174 |
+
background-color: rgba(40, 40, 70, 0.8);
|
175 |
+
color: var(--text-light);
|
176 |
+
border: 1px solid var(--border-color);
|
177 |
+
}
|
178 |
|
179 |
+
.message::before {
|
180 |
+
content: '';
|
181 |
+
position: absolute;
|
182 |
+
top: 0;
|
183 |
+
left: 0;
|
184 |
+
right: 0;
|
185 |
+
bottom: 0;
|
186 |
+
background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1));
|
187 |
+
opacity: 0;
|
188 |
+
transition: opacity 0.3s ease;
|
189 |
+
}
|
|
|
|
|
190 |
|
191 |
+
.message:hover::before {
|
192 |
+
opacity: 1;
|
193 |
+
}
|
|
|
|
|
194 |
|
195 |
+
.initial-input {
|
196 |
+
flex: 1;
|
197 |
+
display: flex;
|
198 |
+
flex-direction: column;
|
199 |
+
justify-content: center;
|
200 |
+
align-items: center;
|
201 |
+
padding: 24px;
|
202 |
+
text-align: center;
|
203 |
+
background: linear-gradient(145deg, var(--bg-dark), var(--bg-darker));
|
204 |
+
}
|
|
|
|
|
|
|
|
|
|
|
205 |
|
206 |
+
.initial-input h2 {
|
207 |
+
font-size: 24px;
|
208 |
+
margin-bottom: 16px;
|
209 |
+
color: var(--text-light);
|
210 |
+
font-weight: 600;
|
211 |
+
font-family: 'JetBrains Mono', monospace;
|
212 |
+
}
|
213 |
|
214 |
+
.input-container {
|
215 |
+
width: 100%;
|
216 |
+
max-width: 400px;
|
217 |
+
position: relative;
|
218 |
+
}
|
219 |
|
220 |
+
.initial-input input {
|
221 |
+
width: 100%;
|
222 |
+
padding: 16px 24px;
|
223 |
+
background-color: rgba(30, 30, 50, 0.8);
|
224 |
+
border: 1px solid var(--border-color);
|
225 |
+
border-radius: 12px;
|
226 |
+
color: var(--text-light);
|
227 |
+
font-size: 16px;
|
228 |
+
font-family: 'JetBrains Mono', monospace;
|
229 |
+
outline: none;
|
230 |
+
transition: all 0.3s ease;
|
231 |
+
}
|
232 |
|
233 |
+
.send-icon {
|
234 |
+
position: absolute;
|
235 |
+
right: 12px;
|
236 |
+
top: 50%;
|
237 |
+
transform: translateY(-50%);
|
238 |
+
background-color: var(--primary-blue);
|
239 |
+
border-radius: 8px;
|
240 |
+
width: 40px;
|
241 |
+
height: 40px;
|
242 |
+
display: flex;
|
243 |
+
justify-content: center;
|
244 |
+
align-items: center;
|
245 |
+
cursor: pointer;
|
246 |
+
transition: all 0.3s ease;
|
247 |
+
}
|
248 |
|
249 |
+
.send-icon:hover {
|
250 |
+
background-color: var(--accent-color);
|
251 |
+
transform: translateY(-50%) scale(1.05);
|
252 |
+
border-radius: 15px;
|
253 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
|
255 |
+
@keyframes fadeIn {
|
256 |
+
from {
|
257 |
+
opacity: 0;
|
258 |
+
transform: translateY(20px);
|
259 |
+
}
|
260 |
+
to {
|
261 |
+
opacity: 1;
|
262 |
+
transform: translateY(0);
|
263 |
+
}
|
264 |
+
}
|
265 |
|
266 |
+
/* Header actions */
|
267 |
+
.header-actions {
|
268 |
+
display: flex;
|
269 |
+
align-items: center;
|
270 |
+
gap: 10px;
|
271 |
+
}
|
272 |
|
273 |
+
.model-select {
|
274 |
+
background-color: black;
|
275 |
+
color: var(--text-light);
|
276 |
+
border: 1px solid var(--border-color);
|
277 |
+
border-radius: 8px;
|
278 |
+
padding: 10px 14px;
|
279 |
+
font-family: 'JetBrains Mono', monospace;
|
280 |
+
font-size: 14px;
|
281 |
+
cursor: pointer;
|
282 |
+
transition: all 0.3s ease;
|
283 |
+
}
|
284 |
|
285 |
+
.clear-chat {
|
286 |
+
background-color: var(--delete-red);
|
287 |
+
color: white;
|
288 |
+
border: none;
|
289 |
+
border-radius: 8px;
|
290 |
+
padding: 10px 14px;
|
291 |
+
font-family: 'JetBrains Mono', monospace;
|
292 |
+
font-size: 14px;
|
293 |
+
cursor: pointer;
|
294 |
+
transition: all 0.3s ease;
|
295 |
+
display: flex;
|
296 |
+
align-items: center;
|
297 |
+
gap: 5px;
|
298 |
+
}
|
299 |
|
300 |
+
.clear-chat:hover {
|
301 |
+
background-color: #ff6666;
|
302 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
|
304 |
+
.watermark {
|
305 |
+
position: absolute;
|
306 |
+
bottom: 10px;
|
307 |
+
right: 15px;
|
308 |
+
color: var(--text-muted);
|
309 |
+
font-size: 10px;
|
310 |
+
opacity: 0.5;
|
311 |
+
transition: opacity 0.3s ease;
|
312 |
+
z-index: 11;
|
313 |
+
}
|
314 |
|
315 |
+
.watermark:hover {
|
316 |
+
opacity: 0.8;
|
317 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
318 |
|
319 |
+
/* Select2 customization */
|
320 |
+
.select2-container--default .select2-selection--single {
|
321 |
+
background-color: #333;
|
322 |
+
color: white;
|
323 |
+
border: 1px solid #555;
|
324 |
+
font-size: 14px;
|
325 |
+
}
|
326 |
|
327 |
+
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
328 |
+
background-color: #333;
|
329 |
+
color: white;
|
330 |
+
}
|
|
|
|
|
331 |
|
332 |
+
.select2-dropdown {
|
333 |
+
background-color: #333;
|
334 |
+
color: white;
|
335 |
+
max-height: 300px;
|
336 |
+
overflow-y: auto;
|
337 |
+
}
|
338 |
+
|
339 |
+
.select2-container--default .select2-results__option {
|
340 |
+
background-color: #333;
|
341 |
+
color: white;
|
342 |
+
}
|
343 |
+
|
344 |
+
.select2-container--default .select2-results__option--highlighted {
|
345 |
+
background-color: #555;
|
346 |
+
color: white;
|
347 |
+
}
|
348 |
|
|
|
|
|
|
|
|
|
349 |
</style>
|
350 |
</head>
|
351 |
|
|
|
399 |
<div class="chat-messages" id="chatMessages"></div>
|
400 |
<div class="chat-input">
|
401 |
<input type="text" id="chatInput" placeholder="Type your message...">
|
402 |
+
<button id="sendButton" style="padding: 10px 10px; background-color: black;color: #e0e0e8; font-family: 'JetBrains Mono'; border: solid #1a1a2e 2px; border-radius: 15px;">Send</button>
|
403 |
</div>
|
404 |
</div>
|
405 |
</div>
|