Spaces:
Running
Running
Update index.html
Browse files- index.html +442 -4
index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title
|
| 7 |
<style>
|
| 8 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
| 9 |
|
|
@@ -381,18 +381,333 @@
|
|
| 381 |
height: 400px;
|
| 382 |
}
|
| 383 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 384 |
</style>
|
| 385 |
</head>
|
| 386 |
<body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 387 |
<div class="floating-elements">
|
| 388 |
<div class="floating-element"></div>
|
| 389 |
<div class="floating-element"></div>
|
| 390 |
<div class="floating-element"></div>
|
| 391 |
</div>
|
| 392 |
|
| 393 |
-
<div class="container">
|
| 394 |
<div class="header">
|
| 395 |
-
<h1 class="main-title"
|
| 396 |
<p class="subtitle">mikao07@2025copyright</p>
|
| 397 |
</div>
|
| 398 |
|
|
@@ -444,6 +759,113 @@
|
|
| 444 |
</div>
|
| 445 |
|
| 446 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 447 |
function showTab(tabId) {
|
| 448 |
// 隱藏所有內容
|
| 449 |
const contents = document.querySelectorAll('.tab-content');
|
|
@@ -473,12 +895,28 @@
|
|
| 473 |
iframe.style.display = 'block';
|
| 474 |
}
|
| 475 |
|
| 476 |
-
//
|
| 477 |
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
| 478 |
const iframes = document.querySelectorAll('iframe');
|
| 479 |
iframes.forEach(iframe => {
|
| 480 |
iframe.style.display = 'none';
|
| 481 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 482 |
});
|
| 483 |
</script>
|
| 484 |
</body>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>LLM+ Web scraping Application</title>
|
| 7 |
<style>
|
| 8 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
| 9 |
|
|
|
|
| 381 |
height: 400px;
|
| 382 |
}
|
| 383 |
}
|
| 384 |
+
|
| 385 |
+
/* 登入頁面樣式 */
|
| 386 |
+
.login-container {
|
| 387 |
+
position: fixed;
|
| 388 |
+
top: 0;
|
| 389 |
+
left: 0;
|
| 390 |
+
width: 100%;
|
| 391 |
+
height: 100%;
|
| 392 |
+
background: radial-gradient(ellipse at center, #667eea 0%, #764ba2 50%, #f093fb 100%);
|
| 393 |
+
display: flex;
|
| 394 |
+
justify-content: center;
|
| 395 |
+
align-items: center;
|
| 396 |
+
z-index: 1000;
|
| 397 |
+
transition: opacity 0.5s ease, visibility 0.5s ease;
|
| 398 |
+
}
|
| 399 |
+
|
| 400 |
+
.login-container.hidden {
|
| 401 |
+
opacity: 0;
|
| 402 |
+
visibility: hidden;
|
| 403 |
+
}
|
| 404 |
+
|
| 405 |
+
.login-box {
|
| 406 |
+
background: rgba(255, 255, 255, 0.95);
|
| 407 |
+
backdrop-filter: blur(20px);
|
| 408 |
+
border-radius: 20px;
|
| 409 |
+
padding: 40px;
|
| 410 |
+
box-shadow:
|
| 411 |
+
0 25px 50px rgba(0,0,0,0.2),
|
| 412 |
+
0 0 0 1px rgba(255,255,255,0.3);
|
| 413 |
+
width: 100%;
|
| 414 |
+
max-width: 420px;
|
| 415 |
+
position: relative;
|
| 416 |
+
overflow: hidden;
|
| 417 |
+
}
|
| 418 |
+
|
| 419 |
+
.login-box::before {
|
| 420 |
+
content: '';
|
| 421 |
+
position: absolute;
|
| 422 |
+
top: 0;
|
| 423 |
+
left: 0;
|
| 424 |
+
right: 0;
|
| 425 |
+
height: 4px;
|
| 426 |
+
background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
.login-header {
|
| 430 |
+
text-align: center;
|
| 431 |
+
margin-bottom: 35px;
|
| 432 |
+
}
|
| 433 |
+
|
| 434 |
+
.login-title {
|
| 435 |
+
font-size: 2.2rem;
|
| 436 |
+
font-weight: 700;
|
| 437 |
+
margin-bottom: 10px;
|
| 438 |
+
background: linear-gradient(135deg, #1e293b 0%, #3b82f6 100%);
|
| 439 |
+
background-clip: text;
|
| 440 |
+
-webkit-background-clip: text;
|
| 441 |
+
-webkit-text-fill-color: transparent;
|
| 442 |
+
}
|
| 443 |
+
|
| 444 |
+
.login-subtitle {
|
| 445 |
+
color: #64748b;
|
| 446 |
+
font-size: 1rem;
|
| 447 |
+
font-weight: 400;
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
.form-group {
|
| 451 |
+
margin-bottom: 25px;
|
| 452 |
+
position: relative;
|
| 453 |
+
}
|
| 454 |
+
|
| 455 |
+
.form-label {
|
| 456 |
+
display: block;
|
| 457 |
+
margin-bottom: 8px;
|
| 458 |
+
color: #374151;
|
| 459 |
+
font-weight: 500;
|
| 460 |
+
font-size: 0.95rem;
|
| 461 |
+
}
|
| 462 |
+
|
| 463 |
+
.form-input {
|
| 464 |
+
width: 100%;
|
| 465 |
+
padding: 15px 20px;
|
| 466 |
+
border: 2px solid #e5e7eb;
|
| 467 |
+
border-radius: 12px;
|
| 468 |
+
font-size: 1rem;
|
| 469 |
+
transition: all 0.3s ease;
|
| 470 |
+
background: rgba(255, 255, 255, 0.8);
|
| 471 |
+
box-sizing: border-box;
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
.form-input:focus {
|
| 475 |
+
outline: none;
|
| 476 |
+
border-color: #3b82f6;
|
| 477 |
+
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
| 478 |
+
background: rgba(255, 255, 255, 1);
|
| 479 |
+
}
|
| 480 |
+
|
| 481 |
+
.captcha-container {
|
| 482 |
+
display: flex;
|
| 483 |
+
gap: 10px;
|
| 484 |
+
align-items: center;
|
| 485 |
+
}
|
| 486 |
+
|
| 487 |
+
.captcha-display {
|
| 488 |
+
background: #f8fafc;
|
| 489 |
+
border: 2px solid #e5e7eb;
|
| 490 |
+
border-radius: 8px;
|
| 491 |
+
padding: 12px 15px;
|
| 492 |
+
font-family: 'Courier New', monospace;
|
| 493 |
+
font-size: 1.2rem;
|
| 494 |
+
font-weight: bold;
|
| 495 |
+
color: #374151;
|
| 496 |
+
letter-spacing: 3px;
|
| 497 |
+
text-align: center;
|
| 498 |
+
user-select: none;
|
| 499 |
+
min-width: 100px;
|
| 500 |
+
position: relative;
|
| 501 |
+
overflow: hidden;
|
| 502 |
+
}
|
| 503 |
+
|
| 504 |
+
.captcha-display::before {
|
| 505 |
+
content: '';
|
| 506 |
+
position: absolute;
|
| 507 |
+
top: 0;
|
| 508 |
+
left: 0;
|
| 509 |
+
right: 0;
|
| 510 |
+
bottom: 0;
|
| 511 |
+
background: repeating-linear-gradient(
|
| 512 |
+
45deg,
|
| 513 |
+
transparent,
|
| 514 |
+
transparent 2px,
|
| 515 |
+
rgba(59, 130, 246, 0.1) 2px,
|
| 516 |
+
rgba(59, 130, 246, 0.1) 4px
|
| 517 |
+
);
|
| 518 |
+
}
|
| 519 |
+
|
| 520 |
+
.captcha-refresh {
|
| 521 |
+
background: #3b82f6;
|
| 522 |
+
color: white;
|
| 523 |
+
border: none;
|
| 524 |
+
border-radius: 8px;
|
| 525 |
+
padding: 12px 15px;
|
| 526 |
+
cursor: pointer;
|
| 527 |
+
font-size: 1.1rem;
|
| 528 |
+
transition: all 0.3s ease;
|
| 529 |
+
display: flex;
|
| 530 |
+
align-items: center;
|
| 531 |
+
justify-content: center;
|
| 532 |
+
}
|
| 533 |
+
|
| 534 |
+
.captcha-refresh:hover {
|
| 535 |
+
background: #2563eb;
|
| 536 |
+
transform: translateY(-1px);
|
| 537 |
+
}
|
| 538 |
+
|
| 539 |
+
.captcha-input {
|
| 540 |
+
flex: 1;
|
| 541 |
+
}
|
| 542 |
+
|
| 543 |
+
.login-button {
|
| 544 |
+
width: 100%;
|
| 545 |
+
background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
|
| 546 |
+
color: white;
|
| 547 |
+
border: none;
|
| 548 |
+
border-radius: 12px;
|
| 549 |
+
padding: 16px;
|
| 550 |
+
font-size: 1.1rem;
|
| 551 |
+
font-weight: 600;
|
| 552 |
+
cursor: pointer;
|
| 553 |
+
transition: all 0.3s ease;
|
| 554 |
+
position: relative;
|
| 555 |
+
overflow: hidden;
|
| 556 |
+
}
|
| 557 |
+
|
| 558 |
+
.login-button::before {
|
| 559 |
+
content: '';
|
| 560 |
+
position: absolute;
|
| 561 |
+
top: 0;
|
| 562 |
+
left: -100%;
|
| 563 |
+
width: 100%;
|
| 564 |
+
height: 100%;
|
| 565 |
+
background: linear-gradient(90deg,
|
| 566 |
+
transparent 0%,
|
| 567 |
+
rgba(255, 255, 255, 0.2) 50%,
|
| 568 |
+
transparent 100%);
|
| 569 |
+
transition: left 0.6s ease;
|
| 570 |
+
}
|
| 571 |
+
|
| 572 |
+
.login-button:hover::before {
|
| 573 |
+
left: 100%;
|
| 574 |
+
}
|
| 575 |
+
|
| 576 |
+
.login-button:hover {
|
| 577 |
+
transform: translateY(-2px);
|
| 578 |
+
box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
|
| 579 |
+
}
|
| 580 |
+
|
| 581 |
+
.login-button:active {
|
| 582 |
+
transform: translateY(0);
|
| 583 |
+
}
|
| 584 |
+
|
| 585 |
+
.error-message {
|
| 586 |
+
background: #fef2f2;
|
| 587 |
+
border: 1px solid #fecaca;
|
| 588 |
+
color: #dc2626;
|
| 589 |
+
padding: 12px 15px;
|
| 590 |
+
border-radius: 8px;
|
| 591 |
+
margin-top: 15px;
|
| 592 |
+
font-size: 0.9rem;
|
| 593 |
+
text-align: center;
|
| 594 |
+
display: none;
|
| 595 |
+
}
|
| 596 |
+
|
| 597 |
+
.success-message {
|
| 598 |
+
background: #f0fdf4;
|
| 599 |
+
border: 1px solid #bbf7d0;
|
| 600 |
+
color: #16a34a;
|
| 601 |
+
padding: 12px 15px;
|
| 602 |
+
border-radius: 8px;
|
| 603 |
+
margin-top: 15px;
|
| 604 |
+
font-size: 0.9rem;
|
| 605 |
+
text-align: center;
|
| 606 |
+
display: none;
|
| 607 |
+
}
|
| 608 |
+
|
| 609 |
+
/* 登出按鈕 */
|
| 610 |
+
.logout-button {
|
| 611 |
+
position: fixed;
|
| 612 |
+
top: 20px;
|
| 613 |
+
right: 20px;
|
| 614 |
+
background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
|
| 615 |
+
color: white;
|
| 616 |
+
border: none;
|
| 617 |
+
border-radius: 12px;
|
| 618 |
+
padding: 12px 20px;
|
| 619 |
+
font-size: 0.95rem;
|
| 620 |
+
font-weight: 600;
|
| 621 |
+
cursor: pointer;
|
| 622 |
+
transition: all 0.3s ease;
|
| 623 |
+
box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
|
| 624 |
+
z-index: 100;
|
| 625 |
+
}
|
| 626 |
+
|
| 627 |
+
.logout-button:hover {
|
| 628 |
+
transform: translateY(-2px);
|
| 629 |
+
box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
|
| 630 |
+
}
|
| 631 |
+
|
| 632 |
+
.logout-button:active {
|
| 633 |
+
transform: translateY(0);
|
| 634 |
+
}
|
| 635 |
+
|
| 636 |
+
/* 響應式設計 */
|
| 637 |
+
@media (max-width: 480px) {
|
| 638 |
+
.login-box {
|
| 639 |
+
margin: 20px;
|
| 640 |
+
padding: 30px 25px;
|
| 641 |
+
}
|
| 642 |
+
|
| 643 |
+
.login-title {
|
| 644 |
+
font-size: 1.8rem;
|
| 645 |
+
}
|
| 646 |
+
|
| 647 |
+
.captcha-container {
|
| 648 |
+
flex-direction: column;
|
| 649 |
+
gap: 15px;
|
| 650 |
+
}
|
| 651 |
+
|
| 652 |
+
.captcha-display {
|
| 653 |
+
width: 100%;
|
| 654 |
+
}
|
| 655 |
+
}
|
| 656 |
</style>
|
| 657 |
</head>
|
| 658 |
<body>
|
| 659 |
+
<!-- 登入頁面 -->
|
| 660 |
+
<div class="login-container" id="loginContainer">
|
| 661 |
+
<div class="login-box">
|
| 662 |
+
<div class="login-header">
|
| 663 |
+
<h1 class="login-title">系統登入</h1>
|
| 664 |
+
<p class="login-subtitle">歡迎使用 LLM+ Web scraping Application</p>
|
| 665 |
+
</div>
|
| 666 |
+
|
| 667 |
+
<form id="loginForm" onsubmit="handleLogin(event)">
|
| 668 |
+
<div class="form-group">
|
| 669 |
+
<label class="form-label" for="username">帳號</label>
|
| 670 |
+
<input type="text" id="username" class="form-input" placeholder="請輸入帳號" required>
|
| 671 |
+
</div>
|
| 672 |
+
|
| 673 |
+
<div class="form-group">
|
| 674 |
+
<label class="form-label" for="password">密碼</label>
|
| 675 |
+
<input type="password" id="password" class="form-input" placeholder="請輸入密碼" required>
|
| 676 |
+
</div>
|
| 677 |
+
|
| 678 |
+
<div class="form-group">
|
| 679 |
+
<label class="form-label" for="captcha">驗證碼</label>
|
| 680 |
+
<div class="captcha-container">
|
| 681 |
+
<div class="captcha-display" id="captchaDisplay"></div>
|
| 682 |
+
<button type="button" class="captcha-refresh" onclick="generateCaptcha()" title="重新生成驗證碼">
|
| 683 |
+
🔄
|
| 684 |
+
</button>
|
| 685 |
+
<input type="text" id="captcha" class="form-input captcha-input" placeholder="請輸入驗證碼" required>
|
| 686 |
+
</div>
|
| 687 |
+
</div>
|
| 688 |
+
|
| 689 |
+
<button type="submit" class="login-button">登入</button>
|
| 690 |
+
|
| 691 |
+
<div class="error-message" id="errorMessage"></div>
|
| 692 |
+
<div class="success-message" id="successMessage"></div>
|
| 693 |
+
</form>
|
| 694 |
+
</div>
|
| 695 |
+
</div>
|
| 696 |
+
|
| 697 |
+
<!-- 登出按鈕 -->
|
| 698 |
+
<button class="logout-button" id="logoutButton" onclick="handleLogout()" style="display: none;">
|
| 699 |
+
登出
|
| 700 |
+
</button>
|
| 701 |
+
|
| 702 |
<div class="floating-elements">
|
| 703 |
<div class="floating-element"></div>
|
| 704 |
<div class="floating-element"></div>
|
| 705 |
<div class="floating-element"></div>
|
| 706 |
</div>
|
| 707 |
|
| 708 |
+
<div class="container" id="mainContainer" style="display: none;">
|
| 709 |
<div class="header">
|
| 710 |
+
<h1 class="main-title">LLM+ Web scraping Application</h1>
|
| 711 |
<p class="subtitle">mikao07@2025copyright</p>
|
| 712 |
</div>
|
| 713 |
|
|
|
|
| 759 |
</div>
|
| 760 |
|
| 761 |
<script>
|
| 762 |
+
// 全局變量
|
| 763 |
+
let currentCaptcha = '';
|
| 764 |
+
const VALID_USERNAME = 'ROOT2025';
|
| 765 |
+
const VALID_PASSWORD = '123456';
|
| 766 |
+
|
| 767 |
+
// 生成驗證碼
|
| 768 |
+
function generateCaptcha() {
|
| 769 |
+
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
| 770 |
+
let result = '';
|
| 771 |
+
for (let i = 0; i < 5; i++) {
|
| 772 |
+
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
| 773 |
+
}
|
| 774 |
+
currentCaptcha = result;
|
| 775 |
+
document.getElementById('captchaDisplay').textContent = result;
|
| 776 |
+
}
|
| 777 |
+
|
| 778 |
+
// 顯示錯誤訊息
|
| 779 |
+
function showError(message) {
|
| 780 |
+
const errorDiv = document.getElementById('errorMessage');
|
| 781 |
+
const successDiv = document.getElementById('successMessage');
|
| 782 |
+
errorDiv.textContent = message;
|
| 783 |
+
errorDiv.style.display = 'block';
|
| 784 |
+
successDiv.style.display = 'none';
|
| 785 |
+
|
| 786 |
+
// 3秒後自動隱藏
|
| 787 |
+
setTimeout(() => {
|
| 788 |
+
errorDiv.style.display = 'none';
|
| 789 |
+
}, 3000);
|
| 790 |
+
}
|
| 791 |
+
|
| 792 |
+
// 顯示成功訊息
|
| 793 |
+
function showSuccess(message) {
|
| 794 |
+
const successDiv = document.getElementById('successMessage');
|
| 795 |
+
const errorDiv = document.getElementById('errorMessage');
|
| 796 |
+
successDiv.textContent = message;
|
| 797 |
+
successDiv.style.display = 'block';
|
| 798 |
+
errorDiv.style.display = 'none';
|
| 799 |
+
}
|
| 800 |
+
|
| 801 |
+
// 處理登入
|
| 802 |
+
function handleLogin(event) {
|
| 803 |
+
event.preventDefault();
|
| 804 |
+
|
| 805 |
+
const username = document.getElementById('username').value.trim();
|
| 806 |
+
const password = document.getElementById('password').value;
|
| 807 |
+
const captcha = document.getElementById('captcha').value.trim().toUpperCase();
|
| 808 |
+
|
| 809 |
+
// 驗證輸入
|
| 810 |
+
if (!username || !password || !captcha) {
|
| 811 |
+
showError('請填寫所有欄位');
|
| 812 |
+
return;
|
| 813 |
+
}
|
| 814 |
+
|
| 815 |
+
// 驗證驗證碼
|
| 816 |
+
if (captcha !== currentCaptcha) {
|
| 817 |
+
showError('驗證碼錯誤,請重新輸入');
|
| 818 |
+
generateCaptcha(); // 重新生成驗證碼
|
| 819 |
+
document.getElementById('captcha').value = '';
|
| 820 |
+
return;
|
| 821 |
+
}
|
| 822 |
+
|
| 823 |
+
// 驗證帳號密碼
|
| 824 |
+
if (username !== VALID_USERNAME || password !== VALID_PASSWORD) {
|
| 825 |
+
showError('帳號或密碼錯誤');
|
| 826 |
+
generateCaptcha(); // 重新生成驗證碼
|
| 827 |
+
document.getElementById('captcha').value = '';
|
| 828 |
+
return;
|
| 829 |
+
}
|
| 830 |
+
|
| 831 |
+
// 登入成功
|
| 832 |
+
showSuccess('登入成功,正在跳轉...');
|
| 833 |
+
|
| 834 |
+
setTimeout(() => {
|
| 835 |
+
// 隱藏登入頁面
|
| 836 |
+
document.getElementById('loginContainer').classList.add('hidden');
|
| 837 |
+
|
| 838 |
+
// 顯示主系統
|
| 839 |
+
setTimeout(() => {
|
| 840 |
+
document.getElementById('loginContainer').style.display = 'none';
|
| 841 |
+
document.getElementById('mainContainer').style.display = 'block';
|
| 842 |
+
document.getElementById('logoutButton').style.display = 'block';
|
| 843 |
+
}, 500);
|
| 844 |
+
}, 1000);
|
| 845 |
+
}
|
| 846 |
+
|
| 847 |
+
// 處理登出
|
| 848 |
+
function handleLogout() {
|
| 849 |
+
if (confirm('確定要登出嗎?')) {
|
| 850 |
+
// 隱藏主系統
|
| 851 |
+
document.getElementById('mainContainer').style.display = 'none';
|
| 852 |
+
document.getElementById('logoutButton').style.display = 'none';
|
| 853 |
+
|
| 854 |
+
// 顯示登入頁面
|
| 855 |
+
document.getElementById('loginContainer').style.display = 'flex';
|
| 856 |
+
document.getElementById('loginContainer').classList.remove('hidden');
|
| 857 |
+
|
| 858 |
+
// 清空表單
|
| 859 |
+
document.getElementById('loginForm').reset();
|
| 860 |
+
generateCaptcha();
|
| 861 |
+
|
| 862 |
+
// 隱藏訊息
|
| 863 |
+
document.getElementById('errorMessage').style.display = 'none';
|
| 864 |
+
document.getElementById('successMessage').style.display = 'none';
|
| 865 |
+
}
|
| 866 |
+
}
|
| 867 |
+
|
| 868 |
+
// 標籤切換功能
|
| 869 |
function showTab(tabId) {
|
| 870 |
// 隱藏所有內容
|
| 871 |
const contents = document.querySelectorAll('.tab-content');
|
|
|
|
| 895 |
iframe.style.display = 'block';
|
| 896 |
}
|
| 897 |
|
| 898 |
+
// 初始化
|
| 899 |
document.addEventListener('DOMContentLoaded', function() {
|
| 900 |
+
// 初始化載入動畫
|
| 901 |
const iframes = document.querySelectorAll('iframe');
|
| 902 |
iframes.forEach(iframe => {
|
| 903 |
iframe.style.display = 'none';
|
| 904 |
});
|
| 905 |
+
|
| 906 |
+
// 生成第一個驗證碼
|
| 907 |
+
generateCaptcha();
|
| 908 |
+
|
| 909 |
+
// 為驗證碼輸入框添加大寫轉換
|
| 910 |
+
document.getElementById('captcha').addEventListener('input', function(e) {
|
| 911 |
+
e.target.value = e.target.value.toUpperCase();
|
| 912 |
+
});
|
| 913 |
+
|
| 914 |
+
// Enter 鍵提交登入表單
|
| 915 |
+
document.getElementById('loginForm').addEventListener('keypress', function(e) {
|
| 916 |
+
if (e.key === 'Enter') {
|
| 917 |
+
handleLogin(e);
|
| 918 |
+
}
|
| 919 |
+
});
|
| 920 |
});
|
| 921 |
</script>
|
| 922 |
</body>
|