englissi commited on
Commit
111f1b8
Β·
verified Β·
1 Parent(s): 856498f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -21
app.py CHANGED
@@ -33,15 +33,13 @@ def show_prayer_and_music(prayer_selection, music_selection):
33
  music_url = music_urls.get(music_selection, "")
34
 
35
  html_code = f"""
36
- <audio id="background-music" controls autoplay loop>
37
- <source src="{music_url}" type="audio/mpeg">
38
- Your browser does not support the audio element.
39
- </audio>
40
- <style>
41
- body {{
42
- background-color: #f5f5dc; /* μ—°ν•œ 베이지색 */
43
- }}
44
- </style>
45
  """
46
 
47
  return prayer_text, html_code
@@ -71,16 +69,16 @@ prayer_options = [
71
 
72
  music_options = ["μŒμ•… 1", "μŒμ•… 2"]
73
 
74
- prayer_dropdown = gr.Dropdown(choices=prayer_options, label="기도문 선택")
75
- music_dropdown = gr.Dropdown(choices=music_options, label="λ°°κ²½μŒμ•… 선택")
76
- output_text = gr.Textbox(label="기도문")
77
- output_html = gr.HTML(label="λ°°κ²½μŒμ•…")
78
-
79
- interface = gr.Interface(
80
- fn=show_prayer_and_music,
81
- inputs=[prayer_dropdown, music_dropdown],
82
- outputs=[output_text, output_html],
83
- live=True
84
- )
85
-
86
  interface.launch()
 
33
  music_url = music_urls.get(music_selection, "")
34
 
35
  html_code = f"""
36
+ <div style="text-align: center; padding: 20px; background-color: #FFF8E7; border-radius: 15px; box-shadow: 2px 2px 10px rgba(0,0,0,0.1);">
37
+ <h3 style="color: #6B4226; font-family: 'Arial', sans-serif;">ν¬κ·Όν•œ 기도와 μŒμ•…</h3>
38
+ <audio id="background-music" controls autoplay loop style="width: 100%; max-width: 400px; margin-top: 10px;">
39
+ <source src="{music_url}" type="audio/mpeg">
40
+ Your browser does not support the audio element.
41
+ </audio>
42
+ </div>
 
 
43
  """
44
 
45
  return prayer_text, html_code
 
69
 
70
  music_options = ["μŒμ•… 1", "μŒμ•… 2"]
71
 
72
+ with gr.Blocks(css="body { background-color: #FAF3E0; font-family: 'Nanum Myeongjo', serif; }") as interface:
73
+ gr.Markdown("### πŸ™ ν¬κ·Όν•œ 기도와 μŒμ•… 🎢")
74
+
75
+ with gr.Row():
76
+ prayer_dropdown = gr.Dropdown(choices=prayer_options, label="기도문 선택")
77
+ music_dropdown = gr.Dropdown(choices=music_options, label="λ°°κ²½μŒμ•… 선택")
78
+
79
+ output_text = gr.Textbox(label="기도문", interactive=False, lines=8)
80
+ output_html = gr.HTML(label="λ°°κ²½μŒμ•…")
81
+
82
+ gr.Button("기도 μ‹œμž‘").click(show_prayer_and_music, inputs=[prayer_dropdown, music_dropdown], outputs=[output_text, output_html])
83
+
84
  interface.launch()