Spaces:
Running
Running
r when i'm pressing it's not sending. and i paste pasted the API - Follow Up Deployment
Browse files- index.html +620 -1073
index.html
CHANGED
|
@@ -1,1096 +1,643 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 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 |
-
background: rgba(0,255,239,0.5);
|
| 210 |
-
border-radius: 10px;
|
| 211 |
-
}
|
| 212 |
|
| 213 |
-
|
| 214 |
-
margin-bottom: 1rem;
|
| 215 |
-
padding: 0.5rem 1rem;
|
| 216 |
-
border-radius: 20px;
|
| 217 |
-
max-width: 80%;
|
| 218 |
-
word-wrap: break-word;
|
| 219 |
-
}
|
| 220 |
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
margin-left: auto;
|
| 224 |
-
border-bottom-right-radius: 5px;
|
| 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 |
-
|
| 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 |
-
|
| 283 |
-
|
| 284 |
-
}
|
| 285 |
-
.cyber-power-line {
|
| 286 |
-
position: absolute;
|
| 287 |
-
width: calc(var(--core-size) * 1.14159 + 4rem);
|
| 288 |
-
height: 2px;
|
| 289 |
-
background: linear-gradient(
|
| 290 |
-
135deg,
|
| 291 |
-
hsl(280, 80%, 40%),
|
| 292 |
-
hsl(320, 70%, 50%),
|
| 293 |
-
hsl(340, 85%, 45%)
|
| 294 |
-
);
|
| 295 |
-
top: 50%;
|
| 296 |
-
left: calc(-1 * (var(--core-size) + 2rem));
|
| 297 |
-
transform: translateY(-220%);
|
| 298 |
-
opacity: 0;
|
| 299 |
-
pointer-events: none;
|
| 300 |
-
}
|
| 301 |
-
.cyber-power-ring {
|
| 302 |
-
position: absolute;
|
| 303 |
-
inset: -2px;
|
| 304 |
-
outline: 3px solid transparent;
|
| 305 |
-
border-radius: 12px;
|
| 306 |
-
opacity: 0;
|
| 307 |
-
transform: scale(1);
|
| 308 |
-
pointer-events: none;
|
| 309 |
-
box-shadow: 0 0 6px transparent;
|
| 310 |
-
background: linear-gradient(
|
| 311 |
-
to right,
|
| 312 |
-
rgba(99, 49, 49, 0.2) 0%,
|
| 313 |
-
rgba(31, 28, 212, 0.2) 15%,
|
| 314 |
-
rgba(64, 6, 112, 0.2) 30%,
|
| 315 |
-
rgba(131, 33, 161, 0.2) 45%,
|
| 316 |
-
rgba(132, 14, 179, 0.2) 60%,
|
| 317 |
-
rgba(255, 0, 242, 0.2) 100%
|
| 318 |
-
);
|
| 319 |
-
background-size: 200% 100%;
|
| 320 |
-
}
|
| 321 |
-
.cyber-input:checked ~ .cyber-label .cyber-core {
|
| 322 |
-
background: #242444;
|
| 323 |
-
box-shadow:
|
| 324 |
-
inset 0 4px 24px rgba(255, 255, 255, 0.2),
|
| 325 |
-
inset 0 -4px 12px rgba(0, 0, 0, 0.6),
|
| 326 |
-
0 0 8px rgba(79, 78, 78, 0.6);
|
| 327 |
-
}
|
| 328 |
-
.cyber-input:checked ~ .cyber-label .cyber-toggle-circle {
|
| 329 |
-
transform: translateX(calc(var(--core-size) / 2));
|
| 330 |
-
}
|
| 331 |
-
.cyber-input:checked + .cyber-label .cyber-power-line {
|
| 332 |
-
animation: power-line-in 0.6s ease forwards;
|
| 333 |
-
}
|
| 334 |
-
.cyber-input:checked + .cyber-label .cyber-power-ring {
|
| 335 |
-
animation:
|
| 336 |
-
power-ring-appear 0.6s ease 0.3s forwards,
|
| 337 |
-
ring-glow 2.5s linear infinite 0.9s;
|
| 338 |
-
}
|
| 339 |
-
.cyber-input:checked + .cyber-label .cyber-power-ring .ring-particle {
|
| 340 |
-
animation: ring-particle-fly 1s ease-out infinite var(--delay);
|
| 341 |
-
}
|
| 342 |
-
.cyber-input:not(:checked) + .cyber-label .cyber-power-ring {
|
| 343 |
-
animation: power-ring-break 0.8s ease forwards;
|
| 344 |
-
}
|
| 345 |
-
.cyber-power-ring .ring-particle {
|
| 346 |
-
position: absolute;
|
| 347 |
-
width: 4px;
|
| 348 |
-
height: 4px;
|
| 349 |
-
background: #ffffff;
|
| 350 |
-
border-radius: 50%;
|
| 351 |
-
opacity: 0;
|
| 352 |
-
left: var(--x);
|
| 353 |
-
top: var(--y);
|
| 354 |
-
}
|
| 355 |
-
@keyframes power-line-in {
|
| 356 |
-
0% {
|
| 357 |
-
opacity: 1;
|
| 358 |
-
transform: translateY(-50%) translateX(-100%);
|
| 359 |
-
}
|
| 360 |
-
50% {
|
| 361 |
-
opacity: 1;
|
| 362 |
-
transform: translateY(-50%) translateX(0);
|
| 363 |
-
}
|
| 364 |
-
100% {
|
| 365 |
-
opacity: 0;
|
| 366 |
-
transform: translateY(-50%) translateX(100%);
|
| 367 |
-
}
|
| 368 |
-
}
|
| 369 |
-
@keyframes power-ring-appear {
|
| 370 |
-
0% {
|
| 371 |
-
opacity: 0;
|
| 372 |
-
transform: scale(0.8);
|
| 373 |
-
}
|
| 374 |
-
50% {
|
| 375 |
-
opacity: 1;
|
| 376 |
-
transform: scale(1.1);
|
| 377 |
-
}
|
| 378 |
-
100% {
|
| 379 |
-
opacity: 1;
|
| 380 |
-
transform: scale(1);
|
| 381 |
-
}
|
| 382 |
-
}
|
| 383 |
-
@keyframes ring-glow {
|
| 384 |
-
0% {
|
| 385 |
-
background-position: 0% 0;
|
| 386 |
-
box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
|
| 387 |
-
}
|
| 388 |
-
50% {
|
| 389 |
-
background-position: 100% 0;
|
| 390 |
-
box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
|
| 391 |
-
}
|
| 392 |
-
100% {
|
| 393 |
-
background-position: 200% 0;
|
| 394 |
-
box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
|
| 395 |
-
}
|
| 396 |
-
}
|
| 397 |
-
@keyframes power-ring-break {
|
| 398 |
-
0% {
|
| 399 |
-
opacity: 1;
|
| 400 |
-
clip-path: inset(0 0 0 0);
|
| 401 |
-
}
|
| 402 |
-
25% {
|
| 403 |
-
clip-path: inset(0 25% 0 25%);
|
| 404 |
-
}
|
| 405 |
-
50% {
|
| 406 |
-
clip-path: inset(25% 25% 25% 25%);
|
| 407 |
-
}
|
| 408 |
-
75% {
|
| 409 |
-
clip-path: inset(40% 40% 40% 40%);
|
| 410 |
-
}
|
| 411 |
-
100% {
|
| 412 |
-
opacity: 0;
|
| 413 |
-
clip-path: inset(50% 50% 50% 50%);
|
| 414 |
-
}
|
| 415 |
-
}
|
| 416 |
-
@keyframes ring-particle-fly {
|
| 417 |
-
0% {
|
| 418 |
-
opacity: 1;
|
| 419 |
-
transform: translate(0, 0);
|
| 420 |
-
}
|
| 421 |
-
100% {
|
| 422 |
-
opacity: 0;
|
| 423 |
-
transform: translate(var(--px), var(--py));
|
| 424 |
-
}
|
| 425 |
-
}
|
| 426 |
-
.cyber-particles {
|
| 427 |
-
position: absolute;
|
| 428 |
-
inset: 0;
|
| 429 |
-
}
|
| 430 |
-
.particle {
|
| 431 |
-
position: absolute;
|
| 432 |
-
width: 4px;
|
| 433 |
-
height: 4px;
|
| 434 |
-
background: hsl(var(--hue), 100%, 70%);
|
| 435 |
-
border-radius: 50%;
|
| 436 |
-
opacity: 0;
|
| 437 |
-
left: 50%;
|
| 438 |
-
top: 50%;
|
| 439 |
-
transform: translate(-50%, -50%);
|
| 440 |
-
}
|
| 441 |
-
.cyber-input:checked ~ .cyber-label .particle {
|
| 442 |
-
animation: particle-fly 0.8s ease-out forwards;
|
| 443 |
-
}
|
| 444 |
-
@keyframes particle-fly {
|
| 445 |
-
0% {
|
| 446 |
-
opacity: 1;
|
| 447 |
-
transform: translate(-50%, -50%);
|
| 448 |
-
}
|
| 449 |
-
100% {
|
| 450 |
-
opacity: 0;
|
| 451 |
-
transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)));
|
| 452 |
-
}
|
| 453 |
-
}
|
| 454 |
-
.particle:nth-child(1) {
|
| 455 |
-
--dx: 20px;
|
| 456 |
-
--dy: -20px;
|
| 457 |
-
}
|
| 458 |
-
.particle:nth-child(2) {
|
| 459 |
-
--dx: -15px;
|
| 460 |
-
--dy: 25px;
|
| 461 |
-
}
|
| 462 |
-
.particle:nth-child(3) {
|
| 463 |
-
--dx: 25px;
|
| 464 |
-
--dy: 15px;
|
| 465 |
-
}
|
| 466 |
-
.particle:nth-child(4) {
|
| 467 |
-
--dx: -20px;
|
| 468 |
-
--dy: -15px;
|
| 469 |
-
}
|
| 470 |
-
.particle:nth-child(5) {
|
| 471 |
-
--dx: 0px;
|
| 472 |
-
--dy: -30px;
|
| 473 |
-
}
|
| 474 |
-
.cyber-label:hover .cyber-core {
|
| 475 |
-
transform: scale(1.05);
|
| 476 |
-
filter: brightness(1.2);
|
| 477 |
-
box-shadow:
|
| 478 |
-
inset 0 4px 24px rgba(255, 255, 255, 0.3),
|
| 479 |
-
inset 0 -4px 12px rgba(0, 0, 0, 0.5);
|
| 480 |
-
}
|
| 481 |
-
.cyber-input:active ~ .cyber-label .cyber-core {
|
| 482 |
-
transform: scale(0.95);
|
| 483 |
-
}
|
| 484 |
-
.cyber-input:focus-visible ~ .cyber-label .cyber-core {
|
| 485 |
-
outline: 2px solid hsl(var(--hue), 100%, 50%);
|
| 486 |
-
outline-offset: 4px;
|
| 487 |
-
}
|
| 488 |
-
.cyber-glare {
|
| 489 |
-
position: absolute;
|
| 490 |
-
width: 50%;
|
| 491 |
-
height: 100%;
|
| 492 |
-
background: linear-gradient(
|
| 493 |
-
90deg,
|
| 494 |
-
rgba(255, 255, 255, 0.1) 0%,
|
| 495 |
-
transparent 100%
|
| 496 |
-
);
|
| 497 |
-
transform: skewX(-20deg);
|
| 498 |
-
filter: blur(2px);
|
| 499 |
-
}
|
| 500 |
-
.cyber-toggle::before {
|
| 501 |
-
content: "";
|
| 502 |
-
position: absolute;
|
| 503 |
-
inset: 0;
|
| 504 |
-
background-image:
|
| 505 |
-
linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
|
| 506 |
-
linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
|
| 507 |
-
background-size: 20px 20px;
|
| 508 |
-
mix-blend-mode: overlay;
|
| 509 |
-
}
|
| 510 |
-
/* ===== END CYBER-TOGGLE ===== */
|
| 511 |
-
|
| 512 |
-
.glass-card-colored {
|
| 513 |
-
width: 240px;
|
| 514 |
-
height: 360px;
|
| 515 |
-
background: rgba(235, 142, 253, 0.15);
|
| 516 |
-
backdrop-filter: blur(15px);
|
| 517 |
-
-webkit-backdrop-filter: blur(15px);
|
| 518 |
-
border-radius: 22px;
|
| 519 |
-
border: 1px solid rgba(255, 255, 255, 0.34);
|
| 520 |
-
box-shadow:
|
| 521 |
-
0 8px 32px rgba(0, 0, 0, 0.1),
|
| 522 |
-
inset 0 1px 0 rgba(255, 255, 255, 0.5),
|
| 523 |
-
inset 0 -1px 0 rgba(255, 255, 255, 0.1),
|
| 524 |
-
inset 0 0 22px 11px rgba(255, 255, 255, 0.1);
|
| 525 |
-
position: relative;
|
| 526 |
-
overflow: hidden;
|
| 527 |
-
}
|
| 528 |
-
|
| 529 |
-
.glass-card-colored::before {
|
| 530 |
-
content: '';
|
| 531 |
-
position: absolute;
|
| 532 |
-
top: 0;
|
| 533 |
-
left: 0;
|
| 534 |
-
right: 0;
|
| 535 |
-
height: 1px;
|
| 536 |
-
background: linear-gradient(
|
| 537 |
-
90deg,
|
| 538 |
-
transparent,
|
| 539 |
-
rgba(255, 255, 255, 0.8),
|
| 540 |
-
transparent
|
| 541 |
-
);
|
| 542 |
-
}
|
| 543 |
-
|
| 544 |
-
.glass-card-colored::after {
|
| 545 |
-
content: '';
|
| 546 |
-
position: absolute;
|
| 547 |
-
top: 0;
|
| 548 |
-
left: 0;
|
| 549 |
-
width: 1px;
|
| 550 |
-
height: 100%;
|
| 551 |
-
background: linear-gradient(
|
| 552 |
-
180deg,
|
| 553 |
-
rgba(255, 255, 255, 0.8),
|
| 554 |
-
transparent,
|
| 555 |
-
rgba(255, 255, 255, 0.3)
|
| 556 |
-
);
|
| 557 |
-
}
|
| 558 |
-
</style>
|
| 559 |
-
</head>
|
| 560 |
-
<body id="appBody" class="min-h-screen flex items-center justify-center p-4 transition-colors duration-300 bg-slate-100 dark:bg-gray-900">
|
| 561 |
-
<!-- tiny palette button inside chat-input row -->
|
| 562 |
-
<button id="paletteBtn"
|
| 563 |
-
title="Choose gradient"
|
| 564 |
-
class="bg-cyan-500 text-white text-xs px-1.5 py-0.5 rounded absolute bottom-4 right-16 z-10">
|
| 565 |
-
🎨
|
| 566 |
-
</button>
|
| 567 |
-
|
| 568 |
-
<!-- Dark / Light Mode Toggle -->
|
| 569 |
-
<div class="fixed top-4 right-4 z-50 flex flex-col items-center space-y-2">
|
| 570 |
-
<div class="cyber-toggle">
|
| 571 |
-
<input id="toggle" class="cyber-input" type="checkbox" />
|
| 572 |
-
<label for="toggle" class="cyber-label">
|
| 573 |
-
<div class="cyber-core">
|
| 574 |
-
<div class="cyber-toggle-circle"></div>
|
| 575 |
-
</div>
|
| 576 |
-
<div class="cyber-power-line"></div>
|
| 577 |
-
<div class="cyber-power-ring">
|
| 578 |
-
<div style="--x: 10%; --y: 20%; --px: 15px; --py: -10px; --delay: 0.1s;" class="ring-particle"></div>
|
| 579 |
-
<div style="--x: 70%; --y: 30%; --px: -10px; --py: 15px; --delay: 0.3s;" class="ring-particle"></div>
|
| 580 |
-
<div style="--x: 40%; --y: 80%; --px: 20px; --py: 10px; --delay: 0.5s;" class="ring-particle"></div>
|
| 581 |
-
<div style="--x: 90%; --y: 60%; --px: -15px; --py: -15px; --delay: 0.7s;" class="ring-particle"></div>
|
| 582 |
-
</div>
|
| 583 |
-
<div class="cyber-particles">
|
| 584 |
-
<div class="particle"></div>
|
| 585 |
-
<div class="particle"></div>
|
| 586 |
-
<div class="particle"></div>
|
| 587 |
-
<div class="particle"></div>
|
| 588 |
-
<div class="particle"></div>
|
| 589 |
-
</div>
|
| 590 |
-
</label>
|
| 591 |
-
</div>
|
| 592 |
-
<!-- Settings button -->
|
| 593 |
-
<button id="settingsBtn" title="Settings" class="w-6 h-6 text-cyan-400 hover:text-cyan-300 transition-colors">
|
| 594 |
-
<svg xmlns="http://www.w3.org/2000/svg" class="w-full h-full" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5">
|
| 595 |
-
<path stroke-linecap="round" stroke-linejoin="round" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
|
| 596 |
-
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
| 597 |
-
</svg>
|
| 598 |
</button>
|
| 599 |
-
</div>
|
| 600 |
-
<div class="container mx-auto">
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
<!-- Chat Interface Area -->
|
| 604 |
-
<div class="max-w-2xl mx-auto mb-8">
|
| 605 |
-
<div class="chat-container w-full h-[500px] rounded-[20px] shadow-[10px_10px_15px_rgba(0,0,0,0.5)] relative overflow-hidden transition-colors duration-300 bg-gradient-to-br from-blue-200 via-cyan-100 to-teal-100 dark:from-blue-900 dark:via-cyan-800 dark:to-teal-900">
|
| 606 |
-
<!-- Chat Header -->
|
| 607 |
-
<div class="chat-header p-4 border-b border-cyan-400/30">
|
| 608 |
-
<div class="flex items-center justify-between">
|
| 609 |
-
<div class="flex items-center">
|
| 610 |
-
<div class="w-3 h-3 bg-green-400 rounded-full mr-2 animate-pulse"></div>
|
| 611 |
-
<span class="text-white font-semibold">Eva</span>
|
| 612 |
-
</div>
|
| 613 |
-
<div class="text-cyan-400">
|
| 614 |
-
<i class="fas fa-microphone"></i>
|
| 615 |
-
</div>
|
| 616 |
-
</div>
|
| 617 |
-
</div>
|
| 618 |
-
|
| 619 |
-
<!-- Chat Messages -->
|
| 620 |
-
<div class="chat-messages h-80 p-4 overflow-y-auto" id="chatMessages">
|
| 621 |
-
<div class="text-center text-gray-300 py-8">
|
| 622 |
-
<i class="fas fa-comments text-4xl mb-4 opacity-50"></i>
|
| 623 |
-
<p>Start speaking or type a message...</p>
|
| 624 |
-
</div>
|
| 625 |
-
</div>
|
| 626 |
-
|
| 627 |
-
<!-- Input Area -->
|
| 628 |
-
<div class="chat-input p-4 border-t border-cyan-400/30">
|
| 629 |
-
<div class="flex items-center space-x-2">
|
| 630 |
-
<input type="text"
|
| 631 |
-
id="userInput"
|
| 632 |
-
placeholder="Type your message or click to speak..."
|
| 633 |
-
class="flex-1 bg-black/20 border border-cyan-400/30 rounded-lg px-4 py-2 text-white placeholder-gray-400 focus:outline-none focus:border-cyan-400">
|
| 634 |
-
<button id="voiceBtn" class="bg-cyan-500 hover:bg-cyan-600 text-white p-2 rounded-lg transition duration-300">
|
| 635 |
-
<i class="fas fa-microphone"></i>
|
| 636 |
-
</button>
|
| 637 |
-
<button id="sendBtn" class="bg-blue-500 hover:bg-blue-600 text-white p-2 rounded-lg transition duration-300">
|
| 638 |
-
<i class="fas fa-paper-plane"></i>
|
| 639 |
-
</button>
|
| 640 |
-
</div>
|
| 641 |
-
</div>
|
| 642 |
-
|
| 643 |
-
<!-- Voice Visualizer -->
|
| 644 |
-
<div id="voiceVisualizer" class="absolute bottom-20 left-0 right-0 hidden">
|
| 645 |
-
<div class="flex justify-center items-end space-x-1 h-16">
|
| 646 |
-
<div class="w-1 bg-cyan-400 rounded" style="height: 20%; animation: voice 0.5s ease-in-out infinite;"></div>
|
| 647 |
-
<div class="w-1 bg-cyan-400 rounded" style="height: 40%; animation: voice 0.5s ease-in-out infinite 0.1s;"></div>
|
| 648 |
-
<div class="w-1 bg-cyan-400 rounded" style="height: 60%; animation: voice 0.5s ease-in-out infinite 0.2s;"></div>
|
| 649 |
-
<div class="w-1 bg-cyan-400 rounded" style="height: 80%; animation: voice 0.5s ease-in-out infinite 0.3s;"></div>
|
| 650 |
-
<div class="w-1 bg-cyan-400 rounded" style="height: 100%; animation: voice 0.5s ease-in-out infinite 0.4s;"></div>
|
| 651 |
-
</div>
|
| 652 |
-
</div>
|
| 653 |
-
|
| 654 |
-
<!-- Microphone Icon in Center -->
|
| 655 |
-
<div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2">
|
| 656 |
-
<div class="text-center">
|
| 657 |
-
<div class="w-16 h-16 bg-cyan-500/20 rounded-full flex items-center justify-center mb-2">
|
| 658 |
-
<i class="fas fa-microphone text-2xl text-cyan-400"></i>
|
| 659 |
-
</div>
|
| 660 |
-
</div>
|
| 661 |
-
</div>
|
| 662 |
-
</div>
|
| 663 |
-
</div>
|
| 664 |
-
|
| 665 |
-
<!-- Removed cards and stats section -->
|
| 666 |
-
</div>
|
| 667 |
-
|
| 668 |
-
<!-- Card Modal (unchanged) -->
|
| 669 |
-
<div id="modal" class="modal fixed inset-0 hidden items-center justify-center z-50">
|
| 670 |
-
<div class="modal-content rounded-lg p-8 max-w-md mx-4 text-center">
|
| 671 |
-
<h2 class="text-2xl font-bold text-white mb-4">Card Unlocked!</h2>
|
| 672 |
-
<p class="text-gray-300 mb-6">You discovered the secret of card <span id="cardNumber" class="text-cyan-400 font-bold"></span>!</p>
|
| 673 |
-
<button id="closeModal" class="bg-cyan-500 hover:bg-cyan-600 text-white font-bold py-2 px-6 rounded-lg transition duration-300">
|
| 674 |
-
Awesome!
|
| 675 |
-
</button>
|
| 676 |
-
</div>
|
| 677 |
-
</div>
|
| 678 |
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
<div class="bg-slate-800/90 border border-cyan-400/30 rounded-xl p-6 w-[320px] space-y-4">
|
| 683 |
-
<h3 class="text-cyan-300 text-lg font-semibold mb-2">Theme Settings</h3>
|
| 684 |
-
|
| 685 |
-
<!-- Gradient selector -->
|
| 686 |
-
<div>
|
| 687 |
-
<label class="text-sm text-gray-300 block mb-1">Gradient</label>
|
| 688 |
-
<div id="gradientPalette" class="grid grid-cols-5 gap-1">
|
| 689 |
-
<!-- palettes filled by JS -->
|
| 690 |
-
</div>
|
| 691 |
-
</div>
|
| 692 |
-
|
| 693 |
-
<button id="closeSettings"
|
| 694 |
-
class="w-full mt-2 bg-cyan-500 hover:bg-cyan-600 text-white rounded py-1 text-sm">
|
| 695 |
-
Close
|
| 696 |
-
</button>
|
| 697 |
-
</div>
|
| 698 |
-
</div>
|
| 699 |
|
| 700 |
-
|
| 701 |
-
|
| 702 |
-
class="hidden absolute bg-gray-900/90 backdrop-blur-md border border-cyan-400/30 rounded-lg p-2 z-20 text-xs w-48">
|
| 703 |
-
<h4 class="text-cyan-300 mb-1">Glass Gradients</h4>
|
| 704 |
-
<div id="glassGradients" class="grid grid-cols-2 gap-1">
|
| 705 |
-
<!-- filled by JS -->
|
| 706 |
</div>
|
| 707 |
-
</div>
|
| 708 |
|
| 709 |
-
|
| 710 |
-
|
| 711 |
-
|
| 712 |
-
|
|
|
|
| 713 |
|
| 714 |
-
<script src="https://cdn.jsdelivr.net/npm/interactjs/dist/interact.min.js"></script>
|
| 715 |
<script>
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
|
| 719 |
-
edges: { left: true, right: true, bottom: true, top: true },
|
| 720 |
-
listeners: {
|
| 721 |
-
move(event) {
|
| 722 |
-
const { target } = event;
|
| 723 |
-
// Only update width/height, do NOT translate
|
| 724 |
-
target.style.width = `${event.rect.width}px`;
|
| 725 |
-
target.style.height = `${event.rect.height}px`;
|
| 726 |
-
}
|
| 727 |
-
}
|
| 728 |
-
});
|
| 729 |
-
|
| 730 |
-
interact('.chat-header')
|
| 731 |
-
.draggable({
|
| 732 |
-
inertia: true,
|
| 733 |
-
listeners: {
|
| 734 |
-
move(event) {
|
| 735 |
-
const container = document.querySelector('.chat-container');
|
| 736 |
-
let x = (parseFloat(container.getAttribute('data-x')) || 0) + event.dx;
|
| 737 |
-
let y = (parseFloat(container.getAttribute('data-y')) || 0) + event.dy;
|
| 738 |
-
container.style.transform = `translate(${x}px, ${y}px)`;
|
| 739 |
-
container.setAttribute('data-x', x);
|
| 740 |
-
container.setAttribute('data-y', y);
|
| 741 |
-
}
|
| 742 |
-
}
|
| 743 |
-
});
|
| 744 |
-
|
| 745 |
-
// Dark/light mode toggle
|
| 746 |
-
const toggle = document.getElementById('toggle');
|
| 747 |
-
const appBody = document.getElementById('appBody');
|
| 748 |
-
|
| 749 |
-
// init
|
| 750 |
-
if (localStorage.theme === 'dark') {
|
| 751 |
-
appBody.classList.add('dark');
|
| 752 |
-
toggle.checked = true;
|
| 753 |
-
}
|
| 754 |
-
|
| 755 |
-
toggle.addEventListener('change', () => {
|
| 756 |
-
if (toggle.checked) {
|
| 757 |
-
appBody.classList.add('dark');
|
| 758 |
-
localStorage.theme = 'dark';
|
| 759 |
-
} else {
|
| 760 |
-
appBody.classList.remove('dark');
|
| 761 |
-
localStorage.theme = 'light';
|
| 762 |
-
}
|
| 763 |
-
});
|
| 764 |
-
|
| 765 |
-
const modal = document.getElementById('modal');
|
| 766 |
-
const cardNumberSpan = document.getElementById('cardNumber');
|
| 767 |
-
const closeModalBtn = document.getElementById('closeModal');
|
| 768 |
-
|
| 769 |
-
// --- Settings panel ---
|
| 770 |
-
const settingsBtn = document.getElementById('settingsBtn');
|
| 771 |
-
const settingsModal = document.getElementById('settingsModal');
|
| 772 |
-
const closeSettings = document.getElementById('closeSettings');
|
| 773 |
-
const eyePicker = document.getElementById('eyeColorPicker');
|
| 774 |
-
const textPicker = document.getElementById('textColorPicker');
|
| 775 |
-
const gradPalette = document.getElementById('gradientPalette');
|
| 776 |
-
const chatContainer = document.querySelector('.chat-container');
|
| 777 |
-
|
| 778 |
-
settingsBtn.addEventListener('click', () => settingsModal.classList.remove('hidden'));
|
| 779 |
-
closeSettings.addEventListener('click', () => settingsModal.classList.add('hidden'));
|
| 780 |
-
settingsModal.addEventListener('click', (e) => {
|
| 781 |
-
if (e.target === settingsModal) settingsModal.classList.add('hidden');
|
| 782 |
-
});
|
| 783 |
-
|
| 784 |
-
// -- mini glass-morph controls
|
| 785 |
-
const glassBtn = document.getElementById('glassSettingsBtn');
|
| 786 |
-
const glassMod = document.getElementById('glassSettingsModal');
|
| 787 |
-
const glassColor = document.getElementById('glassColor');
|
| 788 |
-
const glassBlur = document.getElementById('glassBlur');
|
| 789 |
-
const glassBorder = document.getElementById('glassBorder');
|
| 790 |
-
const glassShadow = document.getElementById('glassShadow');
|
| 791 |
-
|
| 792 |
-
const paletteBtn = document.getElementById('paletteBtn');
|
| 793 |
-
const palettePopup = document.getElementById('palettePopup');
|
| 794 |
-
const glassGradients = document.getElementById('glassGradients');
|
| 795 |
-
|
| 796 |
-
paletteBtn.addEventListener('click', () => palettePopup.classList.toggle('hidden'));
|
| 797 |
-
|
| 798 |
-
// build 10 gradient swatches
|
| 799 |
-
const lightGlass = [
|
| 800 |
-
'linear-gradient(135deg,#ffeaa7,#fab1a0)',
|
| 801 |
-
'linear-gradient(135deg,#a29bfe,#6c5ce7)',
|
| 802 |
-
'linear-gradient(135deg,#74b9ff,#0984e3)',
|
| 803 |
-
'linear-gradient(135deg,#fd79a8,#e84393)',
|
| 804 |
-
'linear-gradient(135deg,#55efc4,#00b894)'
|
| 805 |
-
];
|
| 806 |
-
const darkGlass = [
|
| 807 |
-
'linear-gradient(135deg,#2d3436,#636e72)',
|
| 808 |
-
'linear-gradient(135deg,#192a56,#273c75)',
|
| 809 |
-
'linear-gradient(135deg,#192a56,#40739e)',
|
| 810 |
-
'linear-gradient(135deg,#2f3640,#353b48)',
|
| 811 |
-
'linear-gradient(135deg,#273c75,#192a56)'
|
| 812 |
-
];
|
| 813 |
-
|
| 814 |
-
[...lightGlass, ...darkGlass].forEach(grad => {
|
| 815 |
-
const sw = document.createElement('button');
|
| 816 |
-
sw.className = 'w-full h-6 rounded border border-cyan-400/30 hover:scale-110 transition-transform';
|
| 817 |
-
sw.style.background = grad;
|
| 818 |
-
sw.addEventListener('click', () => {
|
| 819 |
-
chatContainer.style.background = grad;
|
| 820 |
-
palettePopup.classList.add('hidden');
|
| 821 |
-
});
|
| 822 |
-
glassGradients.appendChild(sw);
|
| 823 |
-
});
|
| 824 |
-
|
| 825 |
-
function updateGlass() {
|
| 826 |
-
const color = glassColor.value;
|
| 827 |
-
const blur = glassBlur.value;
|
| 828 |
-
const bord = glassBorder.value
|
| 829 |
-
const shad = glassShadow.value
|
| 830 |
-
const container = document.querySelector('.chat-container');
|
| 831 |
-
container.style.background = color + Math.round(bord*255).toString(16).padStart(2,'0');
|
| 832 |
-
container.style.backdropFilter = `blur(${blur}px)`;
|
| 833 |
-
container.style.webkitBackdropFilter= `blur(${blur}px)`;
|
| 834 |
-
container.style.borderColor = `rgba(255,255,255,${bord})`;
|
| 835 |
-
container.style.boxShadow = `0 8px 32px rgba(0,0,0,${shad})`;
|
| 836 |
-
}
|
| 837 |
-
[glassColor, glassBlur, glassBorder, glassShadow].forEach(el => el.addEventListener('input', updateGlass));
|
| 838 |
-
updateGlass(); // init
|
| 839 |
-
|
| 840 |
-
// 20 gradients (10 light, 10 dark)
|
| 841 |
-
const lightGradients = [
|
| 842 |
-
'linear-gradient(135deg,#ffeaa7 0%,#fab1a0 50%,#fd79a8 100%)',
|
| 843 |
-
'linear-gradient(135deg,#a29bfe 0%,#6c5ce7 50%,#00cec9 100%)',
|
| 844 |
-
'linear-gradient(135deg,#74b9ff 0%,#0984e3 50%,#00cec9 100%)',
|
| 845 |
-
'linear-gradient(135deg,#fd79a8 0%,#e84393 50%,#a29bfe 100%)',
|
| 846 |
-
'linear-gradient(135deg,#00b894 0%,#00cec9 50%,#6c5ce7 100%)',
|
| 847 |
-
'linear-gradient(135deg,#fdcb6e 0%,#e17055 50%,#d63031 100%)',
|
| 848 |
-
'linear-gradient(135deg,#81ecec 0%,#74b9ff 50%,#a29bfe 100%)',
|
| 849 |
-
'linear-gradient(135deg,#55efc4 0%,#00b894 50%,#00cec9 100%)',
|
| 850 |
-
'linear-gradient(135deg,#fd79a8 0%,#fdcb6e 50%,#e17055 100%)',
|
| 851 |
-
'linear-gradient(135deg,#e17055 0%,#fab1a0 50%,#ffeaa7 100%)'
|
| 852 |
-
];
|
| 853 |
-
const darkGradients = [
|
| 854 |
-
'linear-gradient(135deg,#2d3436 0%,#636e72 50%,#2d3436 100%)',
|
| 855 |
-
'linear-gradient(135deg,#192a56 0%,#273c75 50%,#487eb0 100%)',
|
| 856 |
-
'linear-gradient(135deg,#2d3436 0%,#636e72 50%,#b2bec3 100%)',
|
| 857 |
-
'linear-gradient(135deg,#192a56 0%,#40739e 50%,#0097e6 100%)',
|
| 858 |
-
'linear-gradient(135deg,#192a56 0%,#192a56 50%,#273c75 100%)',
|
| 859 |
-
'linear-gradient(135deg,#2f3640 0%,#353b48 50%,#192a56 100%)',
|
| 860 |
-
'linear-gradient(135deg,#192a56 0%,#40739e 50%,#192a56 100%)',
|
| 861 |
-
'linear-gradient(135deg,#2d3436 0%,#636e72 50%,#192a56 100%)',
|
| 862 |
-
'linear-gradient(135deg,#273c75 0%,#40739e 50%,#192a56 100%)',
|
| 863 |
-
'linear-gradient(135deg,#192a56 0%,#273c75 50%,#2d3436 100%)'
|
| 864 |
-
];
|
| 865 |
-
|
| 866 |
-
// Build palette
|
| 867 |
-
[...lightGradients, ...darkGradients].forEach((g, i) => {
|
| 868 |
-
const swatch = document.createElement('button');
|
| 869 |
-
swatch.className = 'w-8 h-8 rounded border border-cyan-400/30 hover:scale-125 transition-transform';
|
| 870 |
-
swatch.style.background = g;
|
| 871 |
-
swatch.addEventListener('click', () => applyGradient(g));
|
| 872 |
-
gradPalette.appendChild(swatch);
|
| 873 |
-
});
|
| 874 |
-
|
| 875 |
-
// Apply saved gradient on load
|
| 876 |
-
const savedGrad = localStorage.getItem('bgGradient');
|
| 877 |
-
if (savedGrad) applyGradient(savedGrad);
|
| 878 |
-
|
| 879 |
-
function applyGradient(grad) {
|
| 880 |
-
appBody.style.background = grad;
|
| 881 |
-
appBody.style.backgroundAttachment = 'fixed';
|
| 882 |
-
localStorage.setItem('bgGradient', grad);
|
| 883 |
-
}
|
| 884 |
-
|
| 885 |
-
// Animated background particles
|
| 886 |
-
const canvas = document.getElementById('particles');
|
| 887 |
-
const ctx = canvas.getContext('2d');
|
| 888 |
-
let particles = [];
|
| 889 |
-
let animationId;
|
| 890 |
-
|
| 891 |
-
function resizeCanvas() {
|
| 892 |
-
canvas.width = window.innerWidth / 2;
|
| 893 |
-
canvas.height = window.innerHeight / 2;
|
| 894 |
-
}
|
| 895 |
-
|
| 896 |
-
class Particle {
|
| 897 |
-
constructor() {
|
| 898 |
-
this.x = Math.random() * canvas.width;
|
| 899 |
-
this.y = Math.random() * canvas.height;
|
| 900 |
-
this.size = Math.random() * 4 + 2;
|
| 901 |
-
this.speedX = Math.random() * 0.5 - 0.25;
|
| 902 |
-
this.speedY = Math.random() * 0.5 - 0.25;
|
| 903 |
-
this.opacity = Math.random() * 0.5 + 0.1;
|
| 904 |
-
this.blur = 0; // sharp
|
| 905 |
-
this.hue = Math.random() * 360;
|
| 906 |
-
}
|
| 907 |
-
|
| 908 |
-
update() {
|
| 909 |
-
this.x += this.speedX;
|
| 910 |
-
this.y += this.speedY;
|
| 911 |
-
|
| 912 |
-
if (this.x < 0 || this.x > canvas.width) this.speedX *= -1;
|
| 913 |
-
if (this.y < 0 || this.y > canvas.height) this.speedY *= -1;
|
| 914 |
-
|
| 915 |
-
this.hue = (this.hue + 0.5) % 360;
|
| 916 |
-
this.opacity = 0.4 + 0.3 * Math.sin(Date.now() * 0.002 + this.x * 0.01);
|
| 917 |
-
}
|
| 918 |
-
|
| 919 |
-
draw() {
|
| 920 |
-
ctx.save();
|
| 921 |
-
ctx.globalAlpha = this.opacity;
|
| 922 |
-
ctx.fillStyle = `hsl(${this.hue},100%,70%)`;
|
| 923 |
-
ctx.beginPath();
|
| 924 |
-
ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
|
| 925 |
-
ctx.fill();
|
| 926 |
-
ctx.restore();
|
| 927 |
-
}
|
| 928 |
-
}
|
| 929 |
-
|
| 930 |
-
class Star {
|
| 931 |
-
constructor() {
|
| 932 |
-
this.x = Math.random() * canvas.width;
|
| 933 |
-
this.y = Math.random() * canvas.height;
|
| 934 |
-
this.size = 1 + Math.random() * 2;
|
| 935 |
-
this.speedX = Math.random() * 0.3 - 0.15;
|
| 936 |
-
this.speedY = Math.random() * 0.3 - 0.15;
|
| 937 |
-
this.hue = Math.random() * 360;
|
| 938 |
-
this.twinkle = 0;
|
| 939 |
-
}
|
| 940 |
-
|
| 941 |
-
update() {
|
| 942 |
-
this.x += this.speedX;
|
| 943 |
-
this.y += this.speedY;
|
| 944 |
-
|
| 945 |
-
if (this.x < 0 || this.x > canvas.width) this.speedX *= -1;
|
| 946 |
-
if (this.y < 0 || this.y > canvas.height) this.speedY *= -1;
|
| 947 |
-
|
| 948 |
-
this.hue = (this.hue + 0.3) % 360;
|
| 949 |
-
this.twinkle = 0.3 + 0.7 * Math.abs(Math.sin(Date.now() * 0.004 + this.x * 0.01));
|
| 950 |
-
}
|
| 951 |
-
|
| 952 |
-
draw() {
|
| 953 |
-
ctx.save();
|
| 954 |
-
ctx.globalAlpha = this.twinkle;
|
| 955 |
-
ctx.shadowColor = `hsl(${this.hue},100%,80%)`;
|
| 956 |
-
ctx.shadowBlur = 12;
|
| 957 |
-
ctx.fillStyle = `hsl(${this.hue},100%,80%)`;
|
| 958 |
-
ctx.beginPath();
|
| 959 |
-
ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
|
| 960 |
-
ctx.fill();
|
| 961 |
-
ctx.restore();
|
| 962 |
-
}
|
| 963 |
-
}
|
| 964 |
-
|
| 965 |
-
function initParticles() {
|
| 966 |
-
particles = [];
|
| 967 |
-
const sharpCount = Math.min(40, Math.floor((canvas.width * canvas.height) / 25000));
|
| 968 |
-
const starCount = Math.min(30, Math.floor((canvas.width * canvas.height) / 30000));
|
| 969 |
|
| 970 |
-
|
| 971 |
-
|
| 972 |
-
|
| 973 |
|
| 974 |
-
|
| 975 |
-
|
| 976 |
-
|
| 977 |
-
|
| 978 |
-
particle.update();
|
| 979 |
-
particle.draw();
|
| 980 |
-
});
|
| 981 |
-
|
| 982 |
-
animationId = requestAnimationFrame(animateParticles);
|
| 983 |
-
}
|
| 984 |
|
| 985 |
-
|
| 986 |
-
|
| 987 |
-
|
| 988 |
-
animateParticles();
|
| 989 |
-
}
|
| 990 |
-
|
| 991 |
-
// Initialize particles on load
|
| 992 |
-
window.addEventListener('resize', () => {
|
| 993 |
-
resizeCanvas();
|
| 994 |
-
initParticles();
|
| 995 |
-
});
|
| 996 |
-
|
| 997 |
-
startParticleAnimation();
|
| 998 |
-
|
| 999 |
-
// Eye / Text color pickers
|
| 1000 |
-
// Chat functionality
|
| 1001 |
-
const chatMessages = document.getElementById('chatMessages');
|
| 1002 |
-
const userInput = document.getElementById('userInput');
|
| 1003 |
-
const sendBtn = document.getElementById('sendBtn');
|
| 1004 |
-
const voiceBtn = document.getElementById('voiceBtn');
|
| 1005 |
-
const voiceVisualizer = document.getElementById('voiceVisualizer');
|
| 1006 |
-
|
| 1007 |
-
// Voice recognition setup
|
| 1008 |
-
let recognition = null;
|
| 1009 |
-
if ('webkitSpeechRecognition' in window || 'SpeechRecognition' in window) {
|
| 1010 |
-
const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
|
| 1011 |
-
recognition = new SpeechRecognition();
|
| 1012 |
-
recognition.continuous = false;
|
| 1013 |
-
recognition.interimResults = false;
|
| 1014 |
-
recognition.lang = 'en-US';
|
| 1015 |
-
}
|
| 1016 |
-
|
| 1017 |
-
// Chat event listeners
|
| 1018 |
-
sendBtn.addEventListener('click', sendMessage);
|
| 1019 |
-
userInput.addEventListener('keypress', (e) => {
|
| 1020 |
-
if (e.key === 'Enter') sendMessage();
|
| 1021 |
-
});
|
| 1022 |
-
voiceBtn.addEventListener('click', toggleVoiceRecognition);
|
| 1023 |
-
|
| 1024 |
-
function addMessage(message, sender) {
|
| 1025 |
-
const messageDiv = document.createElement('div');
|
| 1026 |
-
messageDiv.className = `message ${sender}`;
|
| 1027 |
-
messageDiv.textContent = message;
|
| 1028 |
-
chatMessages.appendChild(messageDiv);
|
| 1029 |
-
chatMessages.scrollTop = chatMessages.scrollHeight;
|
| 1030 |
-
}
|
| 1031 |
-
|
| 1032 |
-
function sendMessage() {
|
| 1033 |
-
const message = userInput.value.trim();
|
| 1034 |
-
if (!message) return;
|
| 1035 |
-
|
| 1036 |
-
addMessage(message, 'user');
|
| 1037 |
-
userInput.value = '';
|
| 1038 |
-
|
| 1039 |
-
// Simulate AI response (replace with actual API call)
|
| 1040 |
-
setTimeout(() => {
|
| 1041 |
-
const responses = [
|
| 1042 |
-
"I'm processing your request...",
|
| 1043 |
-
"Let me think about that...",
|
| 1044 |
-
"Interesting question!",
|
| 1045 |
-
"Here's what I found..."
|
| 1046 |
-
];
|
| 1047 |
-
const response = responses[Math.floor(Math.random() * responses.length)];
|
| 1048 |
-
addMessage(response, 'assistant');
|
| 1049 |
-
}, 1000);
|
| 1050 |
-
}
|
| 1051 |
|
| 1052 |
-
|
| 1053 |
-
|
| 1054 |
-
|
| 1055 |
-
|
| 1056 |
-
}
|
| 1057 |
-
|
| 1058 |
-
if (voiceBtn.classList.contains('listening')) {
|
| 1059 |
-
recognition.stop();
|
| 1060 |
-
stopListening();
|
| 1061 |
-
} else {
|
| 1062 |
-
recognition.start();
|
| 1063 |
-
voiceBtn.classList.add('listening');
|
| 1064 |
-
voiceBtn.innerHTML = '<i class="fas fa-stop"></i>';
|
| 1065 |
-
voiceVisualizer.classList.remove('hidden');
|
| 1066 |
-
}
|
| 1067 |
-
}
|
| 1068 |
-
|
| 1069 |
-
function stopListening() {
|
| 1070 |
-
voiceBtn.classList.remove('listening');
|
| 1071 |
-
voiceBtn.innerHTML = '<i class="fas fa-microphone"></i>';
|
| 1072 |
-
voiceVisualizer.classList.add('hidden');
|
| 1073 |
}
|
|
|
|
|
|
|
| 1074 |
|
| 1075 |
-
|
| 1076 |
-
|
| 1077 |
-
|
| 1078 |
-
|
| 1079 |
-
|
| 1080 |
-
|
| 1081 |
-
|
| 1082 |
-
|
| 1083 |
-
recognition.onend = () => {
|
| 1084 |
-
stopListening();
|
| 1085 |
-
};
|
| 1086 |
-
|
| 1087 |
-
recognition.onerror = (event) => {
|
| 1088 |
-
console.error('Speech recognition error:', event.error);
|
| 1089 |
-
stopListening();
|
| 1090 |
-
};
|
| 1091 |
-
}
|
| 1092 |
|
| 1093 |
-
|
| 1094 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1095 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=basheer1414/aiui" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 1096 |
</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">
|
| 6 |
+
<title>Particle Corn-Field Animation</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<style>
|
| 9 |
+
/* Full-screen canvas sits behind everything */
|
| 10 |
+
#particleCanvas {
|
| 11 |
+
position: fixed;
|
| 12 |
+
inset: 0;
|
| 13 |
+
z-index: -1;
|
| 14 |
+
background: linear-gradient(135deg, #0f172a, #312e81, #581c87);
|
| 15 |
+
}
|
| 16 |
+
/* From Uiverse.io by krokettenkoal */
|
| 17 |
+
:root {
|
| 18 |
+
--bg-col: #010101;
|
| 19 |
+
--space-col: #2d093a;
|
| 20 |
+
--galaxy-col: #460a42;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
.card {
|
| 24 |
+
--bg-col: #010101;
|
| 25 |
+
--space-col: #2d093a;
|
| 26 |
+
--galaxy-col: #460a42;
|
| 27 |
+
--space-gradient: radial-gradient(ellipse at top, var(--bg-col), transparent),
|
| 28 |
+
radial-gradient(ellipse at bottom, var(--galaxy-col) 10%, transparent 60%),
|
| 29 |
+
radial-gradient(ellipse at bottom right, var(--space-col), transparent);
|
| 30 |
+
--space-gradient-alt: radial-gradient(ellipse at top left, var(--space-col), transparent),
|
| 31 |
+
radial-gradient(ellipse at bottom, var(--galaxy-col) 10%, transparent 60%),
|
| 32 |
+
radial-gradient(ellipse at bottom right, var(--bg-col), transparent);
|
| 33 |
+
--stars: radial-gradient(circle at 52% 54%, rgba(255, 255, 255, 0.582) 3px, transparent 4px),
|
| 34 |
+
radial-gradient(circle at 22% 24%, rgba(255, 255, 255, 0.582) 2px, transparent 3px),
|
| 35 |
+
radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.582) 3px, transparent 8px),
|
| 36 |
+
radial-gradient(circle at 18% 21%, rgba(255, 255, 255, 0.582) 4px, transparent 5px),
|
| 37 |
+
radial-gradient(circle at 36% 9%, rgba(255, 255, 255, 0.582) 3px, transparent 5px),
|
| 38 |
+
radial-gradient(circle at 28% 31%, rgba(255, 255, 255, 0.39) 2px, transparent 3px),
|
| 39 |
+
radial-gradient(circle at 62% 61%, rgba(255, 255, 255, 0.532) 3px, transparent 4px),
|
| 40 |
+
radial-gradient(circle at 57% 66%, rgba(255, 255, 255, 0.842) 6px, transparent 8px),
|
| 41 |
+
radial-gradient(circle at 65% 71%, rgba(255, 255, 255, 0.534) 1px, transparent 3px),
|
| 42 |
+
radial-gradient(circle at 67% 68%, rgba(255, 255, 255, 0.651) 3px, transparent 3px),
|
| 43 |
+
radial-gradient(circle at 43% 44%, rgba(255, 255, 255, 0.74) 2px, transparent 6px),
|
| 44 |
+
radial-gradient(circle at 40% 39%, rgba(183, 243, 255, 0.842) 4px, transparent 10px),
|
| 45 |
+
radial-gradient(circle at 41% 40%, rgba(255, 255, 255, 0.699) 5px, transparent 6px),
|
| 46 |
+
radial-gradient(circle at 38% 38%, rgba(255, 255, 255, 0.349) 2px, transparent 4px),
|
| 47 |
+
radial-gradient(circle at 39% 42%, rgba(255, 255, 255, 0.747) 5px, transparent 7px),
|
| 48 |
+
radial-gradient(circle at 80% 31%, rgba(255, 255, 255, 0.781) 4px, transparent 6px),
|
| 49 |
+
radial-gradient(circle at 25% 64%, rgba(255, 255, 255, 0.425) 3px, transparent 4px),
|
| 50 |
+
radial-gradient(circle at 41% 49%, rgba(255, 255, 255, 0.678) 3px, transparent 6px),
|
| 51 |
+
radial-gradient(circle at 50% 37%, rgba(255, 255, 255, 0.336) 1px, transparent 3px),
|
| 52 |
+
radial-gradient(circle at 4% 37%, rgba(255, 255, 255, 0.336) 1px, transparent 3px),
|
| 53 |
+
radial-gradient(circle at 8% 60%, rgba(255, 255, 255, 0.336) 1px, transparent 4px),
|
| 54 |
+
radial-gradient(circle at 12% 54%, rgba(255, 255, 255, 0.336) 1px, transparent 5px),
|
| 55 |
+
radial-gradient(circle at 6% 59%, rgba(255, 255, 255, 0.336) 2px, transparent 10px),
|
| 56 |
+
radial-gradient(circle at 9% 57%, rgba(255, 255, 255, 0.336) 1px, transparent 2px),
|
| 57 |
+
radial-gradient(circle at 14% 61%, rgba(255, 255, 255, 0.336) 2px, transparent 6px);
|
| 58 |
+
min-width: 30rem;
|
| 59 |
+
padding: 2rem 4rem;
|
| 60 |
+
border-radius: 2rem;
|
| 61 |
+
background-color: #010101;
|
| 62 |
+
background-image: var(--space-gradient), var(--stars);
|
| 63 |
+
background-size: 175% 200%;
|
| 64 |
+
background-repeat: no-repeat;
|
| 65 |
+
box-shadow: 5px 7px 20px var(--bg-col);
|
| 66 |
+
overflow: clip;
|
| 67 |
+
animation: space-drift 180s ease-in-out infinite;
|
| 68 |
+
position: fixed;
|
| 69 |
+
top: 50%;
|
| 70 |
+
left: 50%;
|
| 71 |
+
transform: translate(-50%, -50%);
|
| 72 |
+
z-index: 10;
|
| 73 |
+
cursor: grab;
|
| 74 |
+
user-select: none;
|
| 75 |
+
min-height: 300px;
|
| 76 |
+
min-width: 400px;
|
| 77 |
+
}
|
| 78 |
+
|
| 79 |
+
.heading {
|
| 80 |
+
font-size: 0.9rem;
|
| 81 |
+
text-align: center;
|
| 82 |
+
color: rgb(189, 188, 141);
|
| 83 |
+
}
|
| 84 |
+
|
| 85 |
+
.heading span {
|
| 86 |
+
font-size: 2.2rem;
|
| 87 |
+
font-weight: bold;
|
| 88 |
+
display: block;
|
| 89 |
+
font-style: italic;
|
| 90 |
+
margin-top: 0.25rem;
|
| 91 |
+
background-clip: text;
|
| 92 |
+
-webkit-background-clip: text;
|
| 93 |
+
-moz-background-clip: text;
|
| 94 |
+
-webkit-text-fill-color: transparent;
|
| 95 |
+
text-shadow: 15px 10px 55px plum;
|
| 96 |
+
text-transform: uppercase;
|
| 97 |
+
letter-spacing: 1rem;
|
| 98 |
+
z-index: 99;
|
| 99 |
+
animation: heading-stretch 0.7s forwards ease-out;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
.heading span::before,
|
| 103 |
+
.heading span::after {
|
| 104 |
+
content: '—';
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
.content {
|
| 108 |
+
display: grid;
|
| 109 |
+
place-items: center;
|
| 110 |
+
padding: 2rem;
|
| 111 |
+
z-index: 1;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
.item {
|
| 115 |
+
--item-duration: 8s;
|
| 116 |
+
--idx: 0;
|
| 117 |
+
display: flex;
|
| 118 |
+
grid-area: 1 / 1;
|
| 119 |
+
flex-flow: column nowrap;
|
| 120 |
+
justify-content: center;
|
| 121 |
+
align-items: center;
|
| 122 |
+
gap: 0.5rem;
|
| 123 |
+
font-size: 1.1rem;
|
| 124 |
+
text-transform: lowercase;
|
| 125 |
+
font-style: italic;
|
| 126 |
+
opacity: 0;
|
| 127 |
+
animation: item-fade var(--item-duration) infinite ease-in-out;
|
| 128 |
+
animation-delay: calc(var(--idx) * var(--item-duration) / 3);
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
.item svg {
|
| 132 |
+
width: 3rem;
|
| 133 |
+
height: 3rem;
|
| 134 |
+
}
|
| 135 |
+
|
| 136 |
+
.item--create {
|
| 137 |
+
--idx: 0;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
.item--post {
|
| 141 |
+
--idx: 1;
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
.item--inspire {
|
| 145 |
+
--idx: 2;
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
/* Animation keyframes for card */
|
| 151 |
+
@keyframes space-drift {
|
| 152 |
+
0% { background-position: 0% 50%; }
|
| 153 |
+
33% { background-position: 80% 0%; }
|
| 154 |
+
67% { background-position: 80% 100%; }
|
| 155 |
+
100% { background-position: 0% 50%; }
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
@keyframes heading-stretch {
|
| 159 |
+
from {
|
| 160 |
+
opacity: 0.8;
|
| 161 |
+
transform: scale(0.8);
|
| 162 |
+
letter-spacing: normal;
|
| 163 |
+
filter: blur(50px);
|
| 164 |
+
text-shadow: none;
|
| 165 |
+
}
|
| 166 |
+
to {
|
| 167 |
+
opacity: unset;
|
| 168 |
+
transform: unset;
|
| 169 |
+
letter-spacing: 1rem;
|
| 170 |
+
filter: unset;
|
| 171 |
+
}
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
@keyframes item-fade {
|
| 175 |
+
0%, 20% {
|
| 176 |
+
opacity: 0;
|
| 177 |
+
transform: translateX(10px);
|
| 178 |
+
filter: blur(5px);
|
| 179 |
+
}
|
| 180 |
+
40%, 60% {
|
| 181 |
+
opacity: 1;
|
| 182 |
+
transform: unset;
|
| 183 |
+
filter: unset;
|
| 184 |
+
}
|
| 185 |
+
70%, 100% {
|
| 186 |
+
opacity: 0;
|
| 187 |
+
transform: translateX(-10px);
|
| 188 |
+
filter: blur(5px);
|
| 189 |
+
}
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
|
| 193 |
+
|
| 194 |
+
:root {
|
| 195 |
+
--bg-col: #010101;
|
| 196 |
+
--space-col: #2d093a;
|
| 197 |
+
--galaxy-col: #460a42;
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
/* Tiny Settings Panel */
|
| 201 |
+
#settingsPanel {
|
| 202 |
+
position: fixed;
|
| 203 |
+
top: 50%;
|
| 204 |
+
left: 50%;
|
| 205 |
+
transform: translate(-50%, -50%);
|
| 206 |
+
z-index: 20;
|
| 207 |
+
width: 240px;
|
| 208 |
+
background: rgba(15,15,15,0.95);
|
| 209 |
+
border-radius: 0.5rem;
|
| 210 |
+
padding: 0.75rem;
|
| 211 |
+
display: none;
|
| 212 |
+
flex-direction: column;
|
| 213 |
+
gap: 0.5rem;
|
| 214 |
+
font-size: 0.6rem;
|
| 215 |
+
color: #fff;
|
| 216 |
+
backdrop-filter: blur(4px);
|
| 217 |
+
}
|
| 218 |
+
#settingsPanel label {
|
| 219 |
+
display: flex;
|
| 220 |
+
flex-direction: column;
|
| 221 |
+
gap: 0.25rem;
|
| 222 |
+
}
|
| 223 |
+
#settingsPanel input[type="range"],
|
| 224 |
+
#settingsPanel input[type="number"] {
|
| 225 |
+
width: 100%;
|
| 226 |
+
height: 0.5rem;
|
| 227 |
+
font-size: 0.6rem;
|
| 228 |
+
padding: 0.1rem;
|
| 229 |
+
}
|
| 230 |
+
/* Modern colour pellets */
|
| 231 |
+
.colourPellet {
|
| 232 |
+
width: 0.8rem;
|
| 233 |
+
height: 0.8rem;
|
| 234 |
+
border-radius: 50%;
|
| 235 |
+
border: none;
|
| 236 |
+
cursor: pointer;
|
| 237 |
+
display: inline-block;
|
| 238 |
+
margin-right: 0.15rem;
|
| 239 |
+
}
|
| 240 |
+
</style>
|
| 241 |
+
</head>
|
| 242 |
|
| 243 |
+
<body class="relative min-h-screen text-white flex flex-col items-center justify-center font-sans">
|
|
|
|
|
|
|
|
|
|
| 244 |
|
| 245 |
+
<canvas id="particleCanvas"></canvas>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 246 |
|
| 247 |
+
<!-- From Uiverse.io by krokettenkoal -->
|
| 248 |
+
<div id="draggableCard" class="card relative flex flex-col min-w-0 w-full max-w-xl mx-auto !min-h-[28rem] !rounded-xl !p-0">
|
|
|
|
|
|
|
|
|
|
| 249 |
|
| 250 |
+
<!-- Header -->
|
| 251 |
+
<header class="flex items-center justify-between px-4 py-2 border-b border-white/20">
|
| 252 |
+
<div class="flex items-center gap-2">
|
| 253 |
+
<button id="newChatBtn" title="New Chat" class="p-1.5 rounded-full hover:bg-white/10 transition">
|
| 254 |
+
<svg class="w-5 h-5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M12 4v16m8-8H4"/></svg>
|
| 255 |
+
</button>
|
| 256 |
+
<button id="historyBtn" title="History" class="p-1.5 rounded-full hover:bg-white/10 transition">
|
| 257 |
+
<svg class="w-5 h-5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M12 8v4l3 3m7-7a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
|
| 258 |
+
</button>
|
| 259 |
+
</div>
|
| 260 |
+
|
| 261 |
+
<div class="flex items-center gap-2">
|
| 262 |
+
<select id="modelSelect" class="bg-slate-900/80 text-sm border border-white/20 rounded px-2 py-1 outline-none">
|
| 263 |
+
<option value="gpt-4o-mini">GPT-4o-mini</option>
|
| 264 |
+
<option value="gpt-4o">GPT-4o</option>
|
| 265 |
+
<option value="gpt-4-turbo">GPT-4-turbo</option>
|
| 266 |
+
<option value="claude-3-5-sonnet">Claude-3.5-Sonnet</option>
|
| 267 |
+
<option value="claude-3-5-haiku">Claude-3.5-Haiku</option>
|
| 268 |
+
<option value="claude-3-opus">Claude-3-Opus</option>
|
| 269 |
+
<option value="gemini-1.5-pro">Gemini-1.5-Pro</option>
|
| 270 |
+
<option value="gemini-1.5-flash">Gemini-1.5-Flash</option>
|
| 271 |
+
<option value="gemini-2-flash">Gemini-2-Flash</option>
|
| 272 |
+
<option value="llama-3.1-8b">Llama-3.1-8B</option>
|
| 273 |
+
<option value="llama-3.1-70b">Llama-3.1-70B</option>
|
| 274 |
+
<option value="llama-3.3-70b">Llama-3.3-70B</option>
|
| 275 |
+
<option value="mistral-large">Mistral-Large</option>
|
| 276 |
+
<option value="mistral-nemo">Mistral-Nemo</option>
|
| 277 |
+
<option value="command-r-plus">Cohere-Command-R+</option>
|
| 278 |
+
<option value="command-r">Cohere-Command-R</option>
|
| 279 |
+
<option value="gpt-3.5-turbo">GPT-3.5-Turbo</option>
|
| 280 |
+
<option value="claude-3-haiku">Claude-3-Haiku</option>
|
| 281 |
+
<option value="gemini-1.0-pro">Gemini-1.0-Pro</option>
|
| 282 |
+
<option value="llama-3-8b">Llama-3-8B</option>
|
| 283 |
+
<option value="mistral-7b">Mistral-7B</option>
|
| 284 |
+
<option value="command-light">Cohere-Command-Light</option>
|
| 285 |
+
</select>
|
| 286 |
+
|
| 287 |
+
<button id="settingsButton" class="p-1.5 rounded-full hover:bg-white/10 transition">
|
| 288 |
+
<svg class="w-5 h-5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M12 1v6m0 6v6m9-9h-6m-6 0H3m15.364-6.364l-4.242 4.242m-4.242 4.242l-4.242 4.242m12.728 0l-4.242-4.242m-4.242-4.242l-4.242-4.242"/></svg>
|
| 289 |
+
</button>
|
| 290 |
+
<button id="lockButton" class="p-1.5 rounded-full hover:bg-white/10 transition">
|
| 291 |
+
<svg id="lockIcon" class="w-5 h-5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><circle cx="12" cy="16" r="1"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg>
|
| 292 |
+
<svg id="unlockIcon" class="w-5 h-5 hidden" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><circle cx="12" cy="16" r="1"/><path d="M7 11V7a5 5 0 019.9-1"/></svg>
|
| 293 |
+
</button>
|
| 294 |
+
</div>
|
| 295 |
+
</header>
|
| 296 |
+
|
| 297 |
+
<!-- Message list -->
|
| 298 |
+
<main id="chatWindow" class="flex-1 flex flex-col gap-3 p-3 overflow-y-auto text-sm">
|
| 299 |
+
<!-- messages appear here -->
|
| 300 |
+
</main>
|
| 301 |
+
|
| 302 |
+
<!-- Input row -->
|
| 303 |
+
<footer class="border-t border-white/20 p-3">
|
| 304 |
+
<div class="flex items-center gap-2">
|
| 305 |
+
<button id="micBtn" class="p-2 rounded-full hover:bg-white/10 transition shrink-0">
|
| 306 |
+
<svg class="w-5 h-5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M12 1a3 3 0 00-3 3v8a3 3 0 006 0V4a3 3 0 00-3-3z"/><path d="M19 10v2a7 7 0 01-14 0v-2"/><line x1="12" y1="19" x2="12" y2="23"/><line x1="8" y1="23" x2="16" y2="23"/></svg>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 308 |
|
| 309 |
+
<button id="attachBtn" class="p-2 rounded-full hover:bg-white/10 transition shrink-0">
|
| 310 |
+
<svg class="w-5 h-5" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"/></svg>
|
| 311 |
+
</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 312 |
|
| 313 |
+
<div class="flex-1 relative">
|
| 314 |
+
<input id="chatInput" type="text" placeholder="Type your message…" class="w-full bg-transparent border border-white/20 rounded-xl px-3 py-2 outline-none focus:border-white/40 transition"/>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 315 |
</div>
|
|
|
|
| 316 |
|
| 317 |
+
<button id="sendBtn" class="p-2 rounded-full hover:bg-white/10 transition shrink-0">
|
| 318 |
+
<svg class="w-5 h-5 rotate-90" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/></svg>
|
| 319 |
+
</button>
|
| 320 |
+
</div>
|
| 321 |
+
</footer>
|
| 322 |
|
|
|
|
| 323 |
<script>
|
| 324 |
+
const chatInput = document.getElementById('chatInput');
|
| 325 |
+
const sendBtn = document.getElementById('sendBtn');
|
| 326 |
+
const chatWindow = document.getElementById('chatWindow');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 327 |
|
| 328 |
+
sendBtn.addEventListener('click', () => {
|
| 329 |
+
const text = chatInput.value.trim();
|
| 330 |
+
if (!text) return;
|
| 331 |
|
| 332 |
+
const msgDiv = document.createElement('div');
|
| 333 |
+
msgDiv.className = 'self-end bg-sky-600/80 rounded-lg px-3 py-2 max-w-xs break-words';
|
| 334 |
+
msgDiv.textContent = text;
|
| 335 |
+
chatWindow.appendChild(msgDiv);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 336 |
|
| 337 |
+
chatInput.value = '';
|
| 338 |
+
chatWindow.scrollTop = chatWindow.scrollHeight;
|
| 339 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 340 |
|
| 341 |
+
chatInput.addEventListener('keydown', (e) => {
|
| 342 |
+
if (e.key === 'Enter' && !e.shiftKey) {
|
| 343 |
+
e.preventDefault();
|
| 344 |
+
sendBtn.click();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 345 |
}
|
| 346 |
+
});
|
| 347 |
+
</script>
|
| 348 |
|
| 349 |
+
<!-- History panel -->
|
| 350 |
+
<div id="historyPanel" class="hidden absolute top-12 left-3 w-64 max-h-60 border border-white/20 rounded-lg shadow-2xl z-20 overflow-y-auto text-sm">
|
| 351 |
+
<ul class="divide-y divide-white/10">
|
| 352 |
+
<li class="px-3 py-2 hover:bg-white/5 cursor-pointer">Chat 1 – Yesterday</li>
|
| 353 |
+
<li class="px-3 py-2 hover:bg-white/5 cursor-pointer">Chat 2 – 3 days ago</li>
|
| 354 |
+
</ul>
|
| 355 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 356 |
|
| 357 |
+
<div id="resizeHandle" class="absolute bottom-0 right-0 w-6 h-6 cursor-se-resize">
|
| 358 |
+
<svg class="w-full h-full text-white opacity-40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
| 359 |
+
<polyline points="9 15 15 9 15 15 9 9"></polyline>
|
| 360 |
+
</svg>
|
| 361 |
+
</div>
|
| 362 |
+
</div>
|
| 363 |
+
|
| 364 |
+
<!-- API Key Modal -->
|
| 365 |
+
<div id="apiModal" class="fixed inset-0 bg-black/50 z-30 flex items-center justify-center hidden">
|
| 366 |
+
<div class="bg-slate-800 rounded-lg p-6 w-80 text-white">
|
| 367 |
+
<h2 class="text-base font-semibold mb-2">Enter API Key</h2>
|
| 368 |
+
<p id="apiModelName" class="text-sm text-slate-300 mb-3"></p>
|
| 369 |
+
<input id="apiKeyInput" type="password" placeholder="Paste your API key here…"
|
| 370 |
+
class="w-full bg-slate-700 border border-slate-600 rounded px-3 py-2 mb-3 text-sm outline-none focus:border-sky-500">
|
| 371 |
+
<div class="flex justify-end gap-2">
|
| 372 |
+
<button id="apiCancel" class="px-3 py-1 text-sm rounded bg-slate-600 hover:bg-slate-500">Cancel</button>
|
| 373 |
+
<button id="apiSave" class="px-3 py-1 text-sm rounded bg-sky-600 hover:bg-sky-500">Save</button>
|
| 374 |
+
</div>
|
| 375 |
+
<p id="apiSavedMsg" class="hidden text-xs text-green-400 mt-2">✓ API saved successfully</p>
|
| 376 |
+
</div>
|
| 377 |
+
</div>
|
| 378 |
+
|
| 379 |
+
<!-- Tiny Settings Panel -->
|
| 380 |
+
<div id="settingsPanel">
|
| 381 |
+
<label>
|
| 382 |
+
Opacity
|
| 383 |
+
<input type="range" id="opacitySlider" min="0" max="1" step="0.05" value="1">
|
| 384 |
+
</label>
|
| 385 |
+
<label>
|
| 386 |
+
Shadow Blur
|
| 387 |
+
<input type="range" id="shadowSlider" min="0" max="50" step="1" value="0">
|
| 388 |
+
</label>
|
| 389 |
+
<label>
|
| 390 |
+
Corner Curve
|
| 391 |
+
<input type="range" id="cornerSlider" min="0" max="50" step="1" value="24">
|
| 392 |
+
</label>
|
| 393 |
+
<label>
|
| 394 |
+
Colour Gradient
|
| 395 |
+
<div id="colourPalette">
|
| 396 |
+
<button class="colourPellet" style="background:#ff0055"></button>
|
| 397 |
+
<button class="colourPellet" style="background:#ff6b35"></button>
|
| 398 |
+
<button class="colourPellet" style="background:#ffcf40"></button>
|
| 399 |
+
<button class="colourPellet" style="background:#44d62c"></button>
|
| 400 |
+
<button class="colourPellet" style="background:#00bfff"></button>
|
| 401 |
+
<button class="colourPellet" style="background:#0047ab"></button>
|
| 402 |
+
<button class="colourPellet" style="background:#9d00ff"></button>
|
| 403 |
+
<button class="colourPellet" style="background:#ff00ff"></button>
|
| 404 |
+
<button class="colourPellet" style="background:#fd79a8"></button>
|
| 405 |
+
<button class="colourPellet" style="background:#a29bfe"></button>
|
| 406 |
+
</div>
|
| 407 |
+
</label>
|
| 408 |
+
</div>
|
| 409 |
+
|
| 410 |
+
<script>
|
| 411 |
+
/* ---------- DRAGGABLE & RESIZABLE CARD ---------- */
|
| 412 |
+
const card = document.getElementById('draggableCard');
|
| 413 |
+
const resizeHandle = document.getElementById('resizeHandle');
|
| 414 |
+
|
| 415 |
+
// Dragging variables
|
| 416 |
+
let isDragging = false;
|
| 417 |
+
let isResizing = false;
|
| 418 |
+
let currentX, currentY, initialX, initialY;
|
| 419 |
+
let xOffset = 0, yOffset = 0;
|
| 420 |
+
|
| 421 |
+
// Resizing variables
|
| 422 |
+
let startWidth, startHeight, startX, startY;
|
| 423 |
+
|
| 424 |
+
const lockButton = document.getElementById('lockButton');
|
| 425 |
+
const lockIcon = document.getElementById('lockIcon');
|
| 426 |
+
const unlockIcon = document.getElementById('unlockIcon');
|
| 427 |
+
let isLocked = false;
|
| 428 |
+
|
| 429 |
+
card.addEventListener('mousedown', dragStart);
|
| 430 |
+
resizeHandle.addEventListener('mousedown', resizeStart);
|
| 431 |
+
document.addEventListener('mousemove', dragMove);
|
| 432 |
+
document.addEventListener('mouseup', dragEnd);
|
| 433 |
+
|
| 434 |
+
lockButton.addEventListener('click', () => {
|
| 435 |
+
isLocked = !isLocked;
|
| 436 |
+
if (isLocked) {
|
| 437 |
+
lockIcon.classList.add('hidden');
|
| 438 |
+
unlockIcon.classList.remove('hidden');
|
| 439 |
+
card.style.cursor = 'default';
|
| 440 |
+
resizeHandle.style.display = 'none';
|
| 441 |
+
} else {
|
| 442 |
+
lockIcon.classList.remove('hidden');
|
| 443 |
+
unlockIcon.classList.add('hidden');
|
| 444 |
+
card.style.cursor = 'grab';
|
| 445 |
+
resizeHandle.style.display = 'block';
|
| 446 |
+
}
|
| 447 |
+
});
|
| 448 |
+
|
| 449 |
+
function dragStart(e) {
|
| 450 |
+
if (isLocked || e.target.tagName === 'BUTTON') return;
|
| 451 |
+
|
| 452 |
+
initialX = e.clientX - xOffset;
|
| 453 |
+
initialY = e.clientY - yOffset;
|
| 454 |
+
|
| 455 |
+
if (e.target === card || card.contains(e.target)) {
|
| 456 |
+
isDragging = true;
|
| 457 |
+
}
|
| 458 |
+
}
|
| 459 |
+
|
| 460 |
+
function resizeStart(e) {
|
| 461 |
+
if (isLocked) return;
|
| 462 |
+
e.stopPropagation();
|
| 463 |
+
isResizing = true;
|
| 464 |
+
startX = e.clientX;
|
| 465 |
+
startY = e.clientY;
|
| 466 |
+
startWidth = parseInt(getComputedStyle(card).width, 10);
|
| 467 |
+
startHeight = parseInt(getComputedStyle(card).height, 10);
|
| 468 |
+
}
|
| 469 |
+
|
| 470 |
+
function dragMove(e) {
|
| 471 |
+
if (!isLocked && isDragging) {
|
| 472 |
+
e.preventDefault();
|
| 473 |
+
currentX = e.clientX - initialX;
|
| 474 |
+
currentY = e.clientY - initialY;
|
| 475 |
+
|
| 476 |
+
xOffset = currentX;
|
| 477 |
+
yOffset = currentY;
|
| 478 |
+
|
| 479 |
+
card.style.transform = `translate(calc(-50% + ${currentX}px), calc(-50% + ${currentY}px))`;
|
| 480 |
+
} else if (!isLocked && isResizing) {
|
| 481 |
+
e.preventDefault();
|
| 482 |
+
const newWidth = startWidth + (e.clientX - startX);
|
| 483 |
+
const newHeight = startHeight + (e.clientY - startY);
|
| 484 |
+
card.style.width = `${Math.max(300, newWidth)}px`;
|
| 485 |
+
card.style.height = `${Math.max(250, newHeight)}px`;
|
| 486 |
+
}
|
| 487 |
+
}
|
| 488 |
+
|
| 489 |
+
function dragEnd(e) {
|
| 490 |
+
initialX = currentX;
|
| 491 |
+
initialY = currentY;
|
| 492 |
+
isDragging = false;
|
| 493 |
+
isResizing = false;
|
| 494 |
+
}
|
| 495 |
+
|
| 496 |
+
/* ---------- TINY SETTINGS ---------- */
|
| 497 |
+
const settingsButton = document.getElementById('settingsButton');
|
| 498 |
+
const settingsPanel = document.getElementById('settingsPanel');
|
| 499 |
+
settingsButton.addEventListener('click', () => {
|
| 500 |
+
settingsPanel.style.display = settingsPanel.style.display === 'flex' ? 'none' : 'flex';
|
| 501 |
+
});
|
| 502 |
+
|
| 503 |
+
/* ---------- API-KEY MODAL LOGIC ---------- */
|
| 504 |
+
const modelSelect = document.getElementById('modelSelect');
|
| 505 |
+
const apiModal = document.getElementById('apiModal');
|
| 506 |
+
const apiModelName= document.getElementById('apiModelName');
|
| 507 |
+
const apiKeyInput = document.getElementById('apiKeyInput');
|
| 508 |
+
const apiSaveBtn = document.getElementById('apiSave');
|
| 509 |
+
const apiCancelBtn= document.getElementById('apiCancel');
|
| 510 |
+
const apiSavedMsg = document.getElementById('apiSavedMsg');
|
| 511 |
+
|
| 512 |
+
modelSelect.addEventListener('change', () => {
|
| 513 |
+
apiModelName.textContent = `Model: ${modelSelect.value}`;
|
| 514 |
+
apiKeyInput.value = '';
|
| 515 |
+
apiSavedMsg.classList.add('hidden');
|
| 516 |
+
apiModal.classList.remove('hidden');
|
| 517 |
+
});
|
| 518 |
+
|
| 519 |
+
apiSaveBtn.addEventListener('click', () => {
|
| 520 |
+
localStorage.setItem(`api-${modelSelect.value}`, apiKeyInput.value.trim());
|
| 521 |
+
apiSavedMsg.classList.remove('hidden');
|
| 522 |
+
setTimeout(() => apiModal.classList.add('hidden'), 800);
|
| 523 |
+
});
|
| 524 |
+
|
| 525 |
+
apiCancelBtn.addEventListener('click', () => apiModal.classList.add('hidden'));
|
| 526 |
+
|
| 527 |
+
/* ---------- CONFIG ---------- */
|
| 528 |
+
const CONFIG = {
|
| 529 |
+
particleCount: 120,
|
| 530 |
+
particleRadius: () => Math.random() * 2.5 + 1, // 1–3.5
|
| 531 |
+
speed: () => Math.random() * 0.4 + 0.1, // 0.1–0.5
|
| 532 |
+
hueShiftSpeed: 0.8,
|
| 533 |
+
};
|
| 534 |
+
|
| 535 |
+
/* ---------- CANVAS ---------- */
|
| 536 |
+
const canvas = document.getElementById('particleCanvas');
|
| 537 |
+
const ctx = canvas.getContext('2d');
|
| 538 |
+
let width, height, particles = [];
|
| 539 |
+
let hue = 200; // Start on a blue tone instead of yellow
|
| 540 |
+
|
| 541 |
+
/* ---------- RESIZE HANDLER ---------- */
|
| 542 |
+
function resize() {
|
| 543 |
+
width = canvas.width = window.innerWidth;
|
| 544 |
+
height = canvas.height = window.innerHeight;
|
| 545 |
+
if (particles.length === 0) initParticles();
|
| 546 |
+
}
|
| 547 |
+
|
| 548 |
+
/* ---------- PARTICLE ---------- */
|
| 549 |
+
class Particle {
|
| 550 |
+
constructor() {
|
| 551 |
+
this.reset();
|
| 552 |
+
this.hue = Math.random() * 360;
|
| 553 |
+
this.saturation = 75 + Math.random() * 25;
|
| 554 |
+
this.lightness = 50 + Math.random() * 30;
|
| 555 |
+
this.shiny = Math.random() > 0.7;
|
| 556 |
+
this.blurred = Math.random() > 0.8;
|
| 557 |
+
}
|
| 558 |
+
reset() {
|
| 559 |
+
this.x = Math.random() * width;
|
| 560 |
+
this.y = Math.random() * height;
|
| 561 |
+
this.radius = CONFIG.particleRadius();
|
| 562 |
+
this.speed = CONFIG.speed();
|
| 563 |
+
this.angle = Math.random() * Math.PI * 2;
|
| 564 |
+
}
|
| 565 |
+
update() {
|
| 566 |
+
this.x += Math.cos(this.angle) * this.speed;
|
| 567 |
+
this.y += Math.sin(this.angle) * this.speed;
|
| 568 |
+
|
| 569 |
+
// Wrap around edges
|
| 570 |
+
if (this.x < -this.radius) this.x = width + this.radius;
|
| 571 |
+
if (this.x > width + this.radius) this.x = -this.radius;
|
| 572 |
+
if (this.y < -this.radius) this.y = height + this.radius;
|
| 573 |
+
if (this.y > height + this.radius) this.y = -this.radius;
|
| 574 |
+
}
|
| 575 |
+
draw() {
|
| 576 |
+
ctx.save();
|
| 577 |
+
if (this.blurred) {
|
| 578 |
+
ctx.filter = 'blur(2px)';
|
| 579 |
+
}
|
| 580 |
+
if (this.shiny) {
|
| 581 |
+
ctx.shadowBlur = 10;
|
| 582 |
+
ctx.shadowColor = `hsl(${this.hue}, ${this.saturation}%, ${this.lightness + 20}%)`;
|
| 583 |
+
}
|
| 584 |
+
ctx.beginPath();
|
| 585 |
+
ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2);
|
| 586 |
+
ctx.fillStyle = `hsl(${this.hue}, ${this.saturation}%, ${this.lightness}%)`;
|
| 587 |
+
ctx.fill();
|
| 588 |
+
ctx.restore();
|
| 589 |
+
}
|
| 590 |
+
}
|
| 591 |
+
|
| 592 |
+
/* ---------- INITIALIZE PARTICLES ---------- */
|
| 593 |
+
function initParticles() {
|
| 594 |
+
particles = [];
|
| 595 |
+
for (let i = 0; i < CONFIG.particleCount; i++) {
|
| 596 |
+
particles.push(new Particle());
|
| 597 |
+
}
|
| 598 |
+
}
|
| 599 |
+
|
| 600 |
+
/* ---------- ANIMATION LOOP ---------- */
|
| 601 |
+
function animate() {
|
| 602 |
+
ctx.clearRect(0, 0, width, height);
|
| 603 |
+
particles.forEach(p => {
|
| 604 |
+
p.update();
|
| 605 |
+
p.draw();
|
| 606 |
+
});
|
| 607 |
+
requestAnimationFrame(animate);
|
| 608 |
+
}
|
| 609 |
+
|
| 610 |
+
/* ---------- EVENT LISTENERS ---------- */
|
| 611 |
+
window.addEventListener('resize', resize);
|
| 612 |
+
|
| 613 |
+
/* ---------- START ---------- */
|
| 614 |
+
resize();
|
| 615 |
+
animate();
|
| 616 |
+
|
| 617 |
+
/* ---------- Settings Controls ---------- */
|
| 618 |
+
const opacitySlider = document.getElementById('opacitySlider');
|
| 619 |
+
const shadowSlider = document.getElementById('shadowSlider');
|
| 620 |
+
const cornerSlider = document.getElementById('cornerSlider');
|
| 621 |
+
const colourPalette = document.getElementById('colourPalette');
|
| 622 |
+
|
| 623 |
+
opacitySlider.addEventListener('input', () => {
|
| 624 |
+
card.style.opacity = opacitySlider.value;
|
| 625 |
+
});
|
| 626 |
+
|
| 627 |
+
shadowSlider.addEventListener('input', () => {
|
| 628 |
+
card.style.boxShadow = `0 0 ${shadowSlider.value}px rgba(255,255,255,0.3)`;
|
| 629 |
+
});
|
| 630 |
+
|
| 631 |
+
cornerSlider.addEventListener('input', () => {
|
| 632 |
+
card.style.borderRadius = cornerSlider.value + 'px';
|
| 633 |
+
});
|
| 634 |
+
|
| 635 |
+
colourPalette.addEventListener('click', (e) => {
|
| 636 |
+
if (e.target.classList.contains('colourPellet')) {
|
| 637 |
+
const colour = e.target.style.background;
|
| 638 |
+
card.style.background = `linear-gradient(135deg, ${colour}, rgba(0,0,0,0.8))`;
|
| 639 |
+
}
|
| 640 |
+
});
|
| 641 |
+
</script>
|
| 642 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=basheer1414/aiui" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 643 |
</html>
|