Update app.py
Browse files
app.py
CHANGED
@@ -55,7 +55,7 @@ def approximate_temp_with_star(star_type, distance_au, albedo=0.3):
|
|
55 |
return round(T_c)
|
56 |
|
57 |
###################################
|
58 |
-
# 3) สูตรแรงโน้มถ่วง (ตามนิวตัน โดยคำนึงถึงความหนาแน่นตามชนิดดาว
|
59 |
###################################
|
60 |
def approximate_gravity(diameter_factor, planet_type_th):
|
61 |
"""
|
@@ -425,146 +425,54 @@ T = \left(\frac{(1 - A) \times L}{16 \pi \sigma \, d^2}\right)^{\frac{1}{4}} - 2
|
|
425 |
###################################
|
426 |
css_code = """
|
427 |
body {
|
428 |
-
|
429 |
-
background-color: transparent !important;
|
430 |
-
color: var(--text-color) !important;
|
431 |
font-family: "Kanit", sans-serif;
|
432 |
}
|
433 |
-
|
434 |
#title {
|
435 |
color: #4A90E2 !important;
|
436 |
-
text-align: center
|
437 |
-
font-size: 2rem
|
438 |
-
margin-top: 20px
|
439 |
-
margin-bottom: 10px
|
440 |
-
font-weight: bold
|
441 |
}
|
442 |
-
|
443 |
.game-desc {
|
444 |
-
margin: 0 auto
|
445 |
-
width: 90
|
446 |
-
|
447 |
-
background-color: transparent !important;
|
448 |
border: 2px dashed #B3DAFF !important;
|
449 |
-
border-radius: 10px
|
450 |
-
padding: 15px
|
451 |
-
|
452 |
-
|
453 |
-
margin-bottom: 20px !important;
|
454 |
}
|
455 |
-
|
456 |
.btn-main {
|
457 |
background-color: #FFE066 !important;
|
458 |
border: 2px solid #FFCA28 !important;
|
459 |
-
font-weight: bold
|
460 |
-
font-size: 1.1rem
|
461 |
-
padding: 10px 30px
|
462 |
-
border-radius: 10px
|
463 |
-
margin-right: 10px
|
|
|
464 |
}
|
465 |
-
|
466 |
#child-summary, #detail-th, #prompt1-en, #prompt2-en, #prompt3-en, #formula-box {
|
467 |
-
|
468 |
-
background-color: transparent !important;
|
469 |
border: 2px solid #FFE082 !important;
|
470 |
-
border-radius: 10px
|
471 |
-
padding: 10px
|
472 |
-
margin-bottom: 20px
|
473 |
-
/*
|
474 |
-
color: var(--text-color, #333) !important;
|
475 |
}
|
476 |
-
|
477 |
.copy-btn {
|
478 |
background-color: #F06292 !important;
|
479 |
border: 2px solid #E91E63 !important;
|
480 |
-
font-weight: bold
|
481 |
-
font-size: 0.8rem
|
482 |
-
padding: 5px 10px
|
483 |
-
border-radius: 5px
|
484 |
-
margin-top: 5px
|
485 |
-
|
486 |
-
|
487 |
-
/* ตัวแปรสีสำหรับธีม */
|
488 |
-
:root {
|
489 |
-
--background-color: transparent;
|
490 |
-
--text-color: #333333;
|
491 |
-
}
|
492 |
-
|
493 |
-
[data-theme="dark"] {
|
494 |
-
--background-color: transparent;
|
495 |
-
--text-color: #FFFFFF;
|
496 |
-
}
|
497 |
-
|
498 |
-
/* เพิ่มการลบสีพื้นหลังจาก Gradio containers */
|
499 |
-
.gradio-container,
|
500 |
-
.gradio-container *,
|
501 |
-
.gradio-blocks,
|
502 |
-
.gradio-blocks *,
|
503 |
-
.gradio-row,
|
504 |
-
.gradio-row *,
|
505 |
-
.gradio-column,
|
506 |
-
.gradio-column *,
|
507 |
-
.gradio-component,
|
508 |
-
.gradio-component *,
|
509 |
-
.gradio-textbox,
|
510 |
-
.gradio-textbox *,
|
511 |
-
.gradio-markdown,
|
512 |
-
.gradio-markdown *,
|
513 |
-
.gradio-dropdown,
|
514 |
-
.gradio-dropdown *,
|
515 |
-
.gradio-slider,
|
516 |
-
.gradio-slider *,
|
517 |
-
.gradio-button,
|
518 |
-
.gradio-button *,
|
519 |
-
.gradio-state,
|
520 |
-
.gradio-state *,
|
521 |
-
.gradio-textbox textarea,
|
522 |
-
.gradio-markdown *,
|
523 |
-
.gradio-dropdown *,
|
524 |
-
.gradio-slider *,
|
525 |
-
.gradio-button *,
|
526 |
-
.gradio-state * {
|
527 |
-
background-color: transparent !important;
|
528 |
-
color: var(--text-color) !important;
|
529 |
-
}
|
530 |
-
|
531 |
-
/* ลบสีพื้นหลังจาก textarea ใน textbox */
|
532 |
-
.gradio-textbox textarea {
|
533 |
-
background-color: transparent !important;
|
534 |
-
color: var(--text-color) !important;
|
535 |
-
}
|
536 |
-
|
537 |
-
/* ลบสีพื้นหลังจาก markdown */
|
538 |
-
.gradio-markdown p, .gradio-markdown h1, .gradio-markdown h2,
|
539 |
-
.gradio-markdown h3, .gradio-markdown h4, .gradio-markdown h5,
|
540 |
-
.gradio-markdown h6, .gradio-markdown ul, .gradio-markdown ol,
|
541 |
-
.gradio-markdown li, .gradio-markdown a, .gradio-markdown strong,
|
542 |
-
.gradio-markdown em, .gradio-markdown blockquote, .gradio-markdown code {
|
543 |
-
background-color: transparent !important;
|
544 |
-
color: var(--text-color) !important;
|
545 |
-
}
|
546 |
-
|
547 |
-
/* ลบสีพื้นหลังจาก dropdown */
|
548 |
-
.gradio-dropdown select {
|
549 |
-
background-color: transparent !important;
|
550 |
-
color: var(--text-color) !important;
|
551 |
-
}
|
552 |
-
|
553 |
-
/* ลบสีพื้นหลังจาก slider */
|
554 |
-
.gradio-slider .slider-track, .gradio-slider .slider-thumb {
|
555 |
-
background-color: transparent !important;
|
556 |
-
}
|
557 |
-
|
558 |
-
/* ลบสีพื้นหลังจาก button */
|
559 |
-
.gradio-button button {
|
560 |
-
background-color: transparent !important;
|
561 |
-
color: var(--text-color) !important;
|
562 |
-
}
|
563 |
-
|
564 |
-
/* ลบสีพื้นหลังจาก state */
|
565 |
-
.gradio-state div {
|
566 |
-
background-color: transparent !important;
|
567 |
-
color: var(--text-color) !important;
|
568 |
}
|
569 |
"""
|
570 |
|
|
|
55 |
return round(T_c)
|
56 |
|
57 |
###################################
|
58 |
+
# 3) สูตรแรงโน้มถ่วง (ตามนิวตัน โดยคำนึงถึงความหนาแน่นตามชนิดดาว
|
59 |
###################################
|
60 |
def approximate_gravity(diameter_factor, planet_type_th):
|
61 |
"""
|
|
|
425 |
###################################
|
426 |
css_code = """
|
427 |
body {
|
428 |
+
background-color: #F9FBFF !important;
|
|
|
|
|
429 |
font-family: "Kanit", sans-serif;
|
430 |
}
|
|
|
431 |
#title {
|
432 |
color: #4A90E2 !important;
|
433 |
+
text-align: center;
|
434 |
+
font-size: 2rem;
|
435 |
+
margin-top: 20px;
|
436 |
+
margin-bottom: 10px;
|
437 |
+
font-weight: bold;
|
438 |
}
|
|
|
439 |
.game-desc {
|
440 |
+
margin: 0 auto;
|
441 |
+
width: 90%;
|
442 |
+
background-color: #ECF6FF !important;
|
|
|
443 |
border: 2px dashed #B3DAFF !important;
|
444 |
+
border-radius: 10px;
|
445 |
+
padding: 15px;
|
446 |
+
color: #333333 !important;
|
447 |
+
margin-bottom: 20px;
|
|
|
448 |
}
|
|
|
449 |
.btn-main {
|
450 |
background-color: #FFE066 !important;
|
451 |
border: 2px solid #FFCA28 !important;
|
452 |
+
font-weight: bold;
|
453 |
+
font-size: 1.1rem;
|
454 |
+
padding: 10px 30px;
|
455 |
+
border-radius: 10px;
|
456 |
+
margin-right: 10px;
|
457 |
+
color: #000000 !important; /* เพิ่มสีข้อความให้เข้ม */
|
458 |
}
|
|
|
459 |
#child-summary, #detail-th, #prompt1-en, #prompt2-en, #prompt3-en, #formula-box {
|
460 |
+
background-color: #FFFDF5 !important;
|
|
|
461 |
border: 2px solid #FFE082 !important;
|
462 |
+
border-radius: 10px;
|
463 |
+
padding: 10px;
|
464 |
+
margin-bottom: 20px;
|
465 |
+
color: #333333 !important; /* เพิ่มสีข้อความให้เข้ม */
|
|
|
466 |
}
|
|
|
467 |
.copy-btn {
|
468 |
background-color: #F06292 !important;
|
469 |
border: 2px solid #E91E63 !important;
|
470 |
+
font-weight: bold;
|
471 |
+
font-size: 0.8rem;
|
472 |
+
padding: 5px 10px;
|
473 |
+
border-radius: 5px;
|
474 |
+
margin-top: 5px;
|
475 |
+
color: #FFFFFF !important; /* สีข้อความของปุ่มคัดลอก */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
}
|
477 |
"""
|
478 |
|