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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 386 |
"""
|
| 387 |
|
| 388 |
# Create Gradio interface
|
|
@@ -425,6 +585,10 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft(), title="🎮 BesiegeField
|
|
| 425 |
<li>Click "Generate Machine"</li>
|
| 426 |
<li>Wait for AI to generate (30-120 seconds)</li>
|
| 427 |
<li>Download the generated .bsg file</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 428 |
</ul>
|
| 429 |
</div>
|
| 430 |
""")
|
|
|
|
| 383 |
border: 2px dashed #e0e0e0 !important;
|
| 384 |
border-radius: 8px !important;
|
| 385 |
}
|
| 386 |
+
|
| 387 |
+
/* Mobile responsive styles */
|
| 388 |
+
@media (max-width: 768px) {
|
| 389 |
+
.header-box h1 {
|
| 390 |
+
font-size: 1.8em !important;
|
| 391 |
+
}
|
| 392 |
+
|
| 393 |
+
.header-box p {
|
| 394 |
+
font-size: 0.95em !important;
|
| 395 |
+
}
|
| 396 |
+
|
| 397 |
+
.badge {
|
| 398 |
+
font-size: 0.85em !important;
|
| 399 |
+
padding: 4px 12px !important;
|
| 400 |
+
}
|
| 401 |
+
|
| 402 |
+
.info-box {
|
| 403 |
+
padding: 12px !important;
|
| 404 |
+
font-size: 0.9em !important;
|
| 405 |
+
}
|
| 406 |
+
|
| 407 |
+
.gr-button {
|
| 408 |
+
padding: 12px 20px !important;
|
| 409 |
+
font-size: 14px !important;
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
.footer-box {
|
| 413 |
+
padding: 15px !important;
|
| 414 |
+
font-size: 0.9em !important;
|
| 415 |
+
}
|
| 416 |
+
|
| 417 |
+
/* Mobile link buttons */
|
| 418 |
+
.header-box a {
|
| 419 |
+
padding: 8px 16px !important;
|
| 420 |
+
font-size: 0.85em !important;
|
| 421 |
+
}
|
| 422 |
+
}
|
| 423 |
+
|
| 424 |
+
/* Dark mode support - ensures text is always readable */
|
| 425 |
+
@media (prefers-color-scheme: dark) {
|
| 426 |
+
/* Keep header gradient but ensure text contrast */
|
| 427 |
+
.header-box {
|
| 428 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
|
| 429 |
+
}
|
| 430 |
+
|
| 431 |
+
.header-box h1,
|
| 432 |
+
.header-box p,
|
| 433 |
+
.header-box a,
|
| 434 |
+
.badge {
|
| 435 |
+
color: white !important;
|
| 436 |
+
}
|
| 437 |
+
|
| 438 |
+
/* Adjust info box for dark mode */
|
| 439 |
+
.info-box {
|
| 440 |
+
background: #2d3748 !important;
|
| 441 |
+
border-left-color: #4299e1 !important;
|
| 442 |
+
color: #e2e8f0 !important;
|
| 443 |
+
}
|
| 444 |
+
|
| 445 |
+
.info-box h4 {
|
| 446 |
+
color: #63b3ed !important;
|
| 447 |
+
}
|
| 448 |
+
|
| 449 |
+
.info-box ul {
|
| 450 |
+
color: #e2e8f0 !important;
|
| 451 |
+
}
|
| 452 |
+
|
| 453 |
+
.info-box a {
|
| 454 |
+
color: #90cdf4 !important;
|
| 455 |
+
}
|
| 456 |
+
|
| 457 |
+
/* Footer dark mode */
|
| 458 |
+
.footer-box {
|
| 459 |
+
background: #2d3748 !important;
|
| 460 |
+
color: #e2e8f0 !important;
|
| 461 |
+
}
|
| 462 |
+
|
| 463 |
+
.footer-box p {
|
| 464 |
+
color: #e2e8f0 !important;
|
| 465 |
+
}
|
| 466 |
+
|
| 467 |
+
.footer-box a {
|
| 468 |
+
color: #90cdf4 !important;
|
| 469 |
+
}
|
| 470 |
+
|
| 471 |
+
/* Input fields dark mode */
|
| 472 |
+
.gr-textbox,
|
| 473 |
+
.gr-text-input {
|
| 474 |
+
background: #2d3748 !important;
|
| 475 |
+
color: #e2e8f0 !important;
|
| 476 |
+
border-color: #4a5568 !important;
|
| 477 |
+
}
|
| 478 |
+
|
| 479 |
+
/* Labels dark mode */
|
| 480 |
+
label {
|
| 481 |
+
color: #e2e8f0 !important;
|
| 482 |
+
}
|
| 483 |
+
|
| 484 |
+
/* Markdown output dark mode */
|
| 485 |
+
.gr-markdown {
|
| 486 |
+
background: #2d3748 !important;
|
| 487 |
+
color: #e2e8f0 !important;
|
| 488 |
+
border-color: #4a5568 !important;
|
| 489 |
+
}
|
| 490 |
+
}
|
| 491 |
+
|
| 492 |
+
/* Light mode explicit styles - ensures text is always readable */
|
| 493 |
+
@media (prefers-color-scheme: light) {
|
| 494 |
+
.header-box h1,
|
| 495 |
+
.header-box p,
|
| 496 |
+
.header-box a,
|
| 497 |
+
.badge {
|
| 498 |
+
color: white !important;
|
| 499 |
+
text-shadow: 0 1px 2px rgba(0,0,0,0.1);
|
| 500 |
+
}
|
| 501 |
+
|
| 502 |
+
.info-box {
|
| 503 |
+
background: #e7f3ff !important;
|
| 504 |
+
color: #1a202c !important;
|
| 505 |
+
}
|
| 506 |
+
|
| 507 |
+
.info-box h4 {
|
| 508 |
+
color: #1976D2 !important;
|
| 509 |
+
}
|
| 510 |
+
|
| 511 |
+
.info-box ul {
|
| 512 |
+
color: #333 !important;
|
| 513 |
+
}
|
| 514 |
+
|
| 515 |
+
.info-box a {
|
| 516 |
+
color: #667eea !important;
|
| 517 |
+
}
|
| 518 |
+
|
| 519 |
+
.footer-box {
|
| 520 |
+
background: #f8f9fa !important;
|
| 521 |
+
color: #333 !important;
|
| 522 |
+
}
|
| 523 |
+
|
| 524 |
+
.footer-box a {
|
| 525 |
+
color: #667eea !important;
|
| 526 |
+
}
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
/* High contrast mode for accessibility */
|
| 530 |
+
@media (prefers-contrast: high) {
|
| 531 |
+
.header-box h1,
|
| 532 |
+
.header-box p,
|
| 533 |
+
.badge {
|
| 534 |
+
text-shadow: 0 2px 4px rgba(0,0,0,0.3);
|
| 535 |
+
font-weight: 600 !important;
|
| 536 |
+
}
|
| 537 |
+
|
| 538 |
+
.info-box {
|
| 539 |
+
border-left-width: 6px !important;
|
| 540 |
+
}
|
| 541 |
+
|
| 542 |
+
.gr-button {
|
| 543 |
+
border: 2px solid currentColor !important;
|
| 544 |
+
}
|
| 545 |
+
}
|
| 546 |
"""
|
| 547 |
|
| 548 |
# Create Gradio interface
|
|
|
|
| 585 |
<li>Click "Generate Machine"</li>
|
| 586 |
<li>Wait for AI to generate (30-120 seconds)</li>
|
| 587 |
<li>Download the generated .bsg file</li>
|
| 588 |
+
<li>Put yout .bsg file into GameRoot/Besiege_Data/SavedMachines</li>
|
| 589 |
+
<li>Open the game, open costume scene, load machine</li>
|
| 590 |
+
<li>For detailed guidance, please refer to the 📖 Help Tutorial video</li>
|
| 591 |
+
<li>You can check our <a href="https://github.com/Godheritage/BesiegeField" target="_blank" style="color: #667eea; text-decoration: underline; font-weight: 500;">GitHub repo</a> for more LLMs and agentic workflows</li>
|
| 592 |
</ul>
|
| 593 |
</div>
|
| 594 |
""")
|