Update app.py
Browse files
app.py
CHANGED
@@ -405,30 +405,41 @@ button:hover {
|
|
405 |
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
|
406 |
}
|
407 |
|
408 |
-
/* μκ°λ
|
409 |
-
.timezone-
|
|
|
|
|
410 |
background: linear-gradient(135deg, #ffffff, #f8f9fa);
|
411 |
border-radius: 10px;
|
412 |
-
padding: 15px;
|
413 |
-
margin: 15px 0;
|
414 |
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
|
415 |
-
border: 1px solid rgba(110, 142, 251, 0.2);
|
416 |
-
transition: all 0.3s ease;
|
417 |
}
|
418 |
|
419 |
-
.timezone-
|
420 |
-
|
421 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
422 |
}
|
423 |
|
424 |
-
.timezone-
|
425 |
-
|
426 |
-
padding:
|
427 |
border-radius: 8px;
|
428 |
-
|
429 |
font-size: 14px;
|
430 |
-
color: #
|
431 |
-
|
|
|
|
|
|
|
|
|
432 |
}
|
433 |
|
434 |
.timezone-info {
|
@@ -547,18 +558,6 @@ input:focus, select:focus, textarea:focus {
|
|
547 |
transform: translateY(-1px);
|
548 |
}
|
549 |
|
550 |
-
/* λλ‘λ€μ΄ μ΅μ
μ€νμΌ */
|
551 |
-
select option {
|
552 |
-
padding: 12px;
|
553 |
-
font-size: 14px;
|
554 |
-
background-color: white;
|
555 |
-
color: #2d3748;
|
556 |
-
}
|
557 |
-
|
558 |
-
select option:hover {
|
559 |
-
background-color: #f7fafc;
|
560 |
-
}
|
561 |
-
|
562 |
/* μ€ν¬λ‘€λ° μ€νμΌ */
|
563 |
::-webkit-scrollbar {
|
564 |
width: 8px;
|
@@ -579,17 +578,6 @@ select option:hover {
|
|
579 |
background: linear-gradient(135deg, #a777e3, #6e8efb);
|
580 |
}
|
581 |
|
582 |
-
/* λλ‘λ€μ΄ νμ΄ν μ€νμΌ */
|
583 |
-
select {
|
584 |
-
appearance: none;
|
585 |
-
-webkit-appearance: none;
|
586 |
-
-moz-appearance: none;
|
587 |
-
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
|
588 |
-
background-repeat: no-repeat;
|
589 |
-
background-position: right 1rem center;
|
590 |
-
background-size: 1em;
|
591 |
-
}
|
592 |
-
|
593 |
/* νΈλ² ν¨κ³Ό μ λλ©μ΄μ
*/
|
594 |
@keyframes float {
|
595 |
0% {
|
@@ -604,7 +592,7 @@ select {
|
|
604 |
}
|
605 |
|
606 |
.input-container:hover,
|
607 |
-
.timezone-
|
608 |
.large-output-box:hover,
|
609 |
.newyear-container:hover {
|
610 |
animation: float 2s ease-in-out infinite;
|
@@ -635,21 +623,32 @@ with gr.Blocks(css=css) as demo:
|
|
635 |
label="β° μμ (μ: 1030)",
|
636 |
placeholder="24μκ° νμμΌλ‘ μ
λ ₯νμΈμ (μ: 2230)"
|
637 |
)
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
644 |
)
|
|
|
645 |
gr.Markdown(
|
646 |
"""
|
647 |
<div class="timezone-info">
|
648 |
βΉοΈ <b>μκ°λ μ 보</b>
|
|
|
649 |
<br>β’ μ νν μκ°λλ μλμΌλ‘ μμΈ μκ°μΌλ‘ λ³νλ©λλ€.
|
650 |
-
<br>β’ μμ:
|
651 |
-
<br>β’
|
652 |
-
<br>β’ λͺ¨λ μκ°μ 24μκ° νμμΌλ‘ μ
λ ₯ν΄ μ£ΌμΈμ. (μ: μ€ν 2μ = 1400)
|
653 |
</div>
|
654 |
""",
|
655 |
elem_classes="timezone-info"
|
@@ -701,10 +700,23 @@ with gr.Blocks(css=css) as demo:
|
|
701 |
size="lg"
|
702 |
)
|
703 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
704 |
# μ΄λ²€νΈ μ°κ²°
|
|
|
|
|
|
|
|
|
|
|
|
|
705 |
get_lunar_info_btn.click(
|
706 |
fn=get_lunar_info,
|
707 |
-
inputs=[solYear, solMonth, solDay, solHour,
|
708 |
outputs=[output1, lunIljin_state, analysis_result]
|
709 |
)
|
710 |
|
|
|
405 |
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
|
406 |
}
|
407 |
|
408 |
+
/* μκ°λ μ¬λΌμ΄λ μ€νμΌ */
|
409 |
+
.timezone-slider {
|
410 |
+
margin: 20px 0;
|
411 |
+
padding: 20px;
|
412 |
background: linear-gradient(135deg, #ffffff, #f8f9fa);
|
413 |
border-radius: 10px;
|
|
|
|
|
414 |
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
|
|
|
|
|
415 |
}
|
416 |
|
417 |
+
.timezone-slider .slider {
|
418 |
+
height: 10px !important;
|
419 |
+
background: linear-gradient(90deg, #6e8efb, #a777e3) !important;
|
420 |
+
border-radius: 5px !important;
|
421 |
+
}
|
422 |
+
|
423 |
+
.timezone-slider .thumb {
|
424 |
+
width: 20px !important;
|
425 |
+
height: 20px !important;
|
426 |
+
background: white !important;
|
427 |
+
border: 2px solid #6e8efb !important;
|
428 |
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
|
429 |
}
|
430 |
|
431 |
+
.timezone-cities-display {
|
432 |
+
background: rgba(110, 142, 251, 0.1);
|
433 |
+
padding: 15px;
|
434 |
border-radius: 8px;
|
435 |
+
margin: 10px 0;
|
436 |
font-size: 14px;
|
437 |
+
color: #4a5568;
|
438 |
+
border-left: 4px solid #6e8efb;
|
439 |
+
}
|
440 |
+
|
441 |
+
.timezone-cities {
|
442 |
+
line-height: 1.6;
|
443 |
}
|
444 |
|
445 |
.timezone-info {
|
|
|
558 |
transform: translateY(-1px);
|
559 |
}
|
560 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
561 |
/* μ€ν¬λ‘€λ° μ€νμΌ */
|
562 |
::-webkit-scrollbar {
|
563 |
width: 8px;
|
|
|
578 |
background: linear-gradient(135deg, #a777e3, #6e8efb);
|
579 |
}
|
580 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
581 |
/* νΈλ² ν¨κ³Ό μ λλ©μ΄μ
*/
|
582 |
@keyframes float {
|
583 |
0% {
|
|
|
592 |
}
|
593 |
|
594 |
.input-container:hover,
|
595 |
+
.timezone-slider:hover,
|
596 |
.large-output-box:hover,
|
597 |
.newyear-container:hover {
|
598 |
animation: float 2s ease-in-out infinite;
|
|
|
623 |
label="β° μμ (μ: 1030)",
|
624 |
placeholder="24μκ° νμμΌλ‘ μ
λ ₯νμΈμ (μ: 2230)"
|
625 |
)
|
626 |
+
|
627 |
+
# μκ°λ μ¬λΌμ΄λ
|
628 |
+
timezone_slider = gr.Slider(
|
629 |
+
minimum=-12,
|
630 |
+
maximum=14,
|
631 |
+
value=9,
|
632 |
+
step=0.5,
|
633 |
+
label="π μΆμ μ§μ μκ°λ (UTC)",
|
634 |
+
info="μμΈμ UTC+9 μ
λλ€. μΆμ μ§μμ UTC μκ°λλ₯Ό μ ννμΈμ.",
|
635 |
+
elem_classes="timezone-slider"
|
636 |
+
)
|
637 |
+
|
638 |
+
# μ νλ μκ°λμ λμλ€ νμ
|
639 |
+
timezone_cities_display = gr.HTML(
|
640 |
+
value="<div class='timezone-cities'>νμ¬ μ ν: μμΈ, λμΏ, νμ (UTC+9)</div>",
|
641 |
+
elem_classes="timezone-cities-display"
|
642 |
)
|
643 |
+
|
644 |
gr.Markdown(
|
645 |
"""
|
646 |
<div class="timezone-info">
|
647 |
βΉοΈ <b>μκ°λ μ 보</b>
|
648 |
+
<br>β’ μ¬λΌμ΄λλ₯Ό μμ§μ¬ μΆμ μ§μμ μκ°λλ₯Ό μ ννμΈμ.
|
649 |
<br>β’ μ νν μκ°λλ μλμΌλ‘ μμΈ μκ°μΌλ‘ λ³νλ©λλ€.
|
650 |
+
<br>β’ μμ: UTC-5(λ΄μ) 1μ 1μΌ μ€ν 2μ β μμΈ κΈ°μ€ 1μ 2μΌ μ€μ 4μ
|
651 |
+
<br>β’ μκ°λλ₯Ό λͺ¨λ₯΄μλ©΄ μμ λμ λͺ©λ‘μμ κ°μ₯ κ°κΉμ΄ λμλ₯Ό νμΈνμΈμ.
|
|
|
652 |
</div>
|
653 |
""",
|
654 |
elem_classes="timezone-info"
|
|
|
700 |
size="lg"
|
701 |
)
|
702 |
|
703 |
+
# μκ°λ λ³κ²½ μ λμ λͺ©λ‘ μ
λ°μ΄νΈ ν¨μ
|
704 |
+
def update_timezone_cities(value):
|
705 |
+
cities = [k for k, v in TIMEZONE_CITIES.items() if abs(v - value) < 0.1]
|
706 |
+
if cities:
|
707 |
+
return f"<div class='timezone-cities'>νμ¬ μ νλ μκ°λμ μ£Όμ λμ:<br>{', '.join(cities)}</div>"
|
708 |
+
return "<div class='timezone-cities'>ν΄λΉ μκ°λμ μ£Όμ λμ μ λ³΄κ° μμ΅λλ€.</div>"
|
709 |
+
|
710 |
# μ΄λ²€νΈ μ°κ²°
|
711 |
+
timezone_slider.change(
|
712 |
+
fn=update_timezone_cities,
|
713 |
+
inputs=[timezone_slider],
|
714 |
+
outputs=[timezone_cities_display]
|
715 |
+
)
|
716 |
+
|
717 |
get_lunar_info_btn.click(
|
718 |
fn=get_lunar_info,
|
719 |
+
inputs=[solYear, solMonth, solDay, solHour, timezone_slider],
|
720 |
outputs=[output1, lunIljin_state, analysis_result]
|
721 |
)
|
722 |
|