englissi commited on
Commit
3bd37b5
Β·
verified Β·
1 Parent(s): 11cf154

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +75 -9
app.py CHANGED
@@ -83,18 +83,85 @@ init_index_long, init_text_long, init_image_long, init_audio_long = 0, long_vowe
83
 
84
  # πŸ“Œ Gradio UI ꡬ성
85
  with gr.Blocks(title="πŸ“š κ·€μ—¬μš΄ μŠ€ν† λ¦¬ μ•±") as demo:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  with gr.Tabs():
87
  with gr.TabItem("Short Vowel (단λͺ¨μŒ)"):
88
  state_index_short = gr.State(value=init_index_short)
89
  state_text_short = gr.State(value=init_text_short)
90
 
91
- story_text_short = gr.Markdown(value=init_text_short)
92
- story_image_short = gr.Image(value=init_image_short, width=400, height=400)
93
  audio_output_short = gr.Audio(value=init_audio_short, autoplay=True)
94
 
95
  with gr.Row():
96
- next_button_short = gr.Button("πŸ‘‰ λ‹€μŒ 이야기")
97
- play_button_short = gr.Button("πŸ”Š λ‹€μ‹œ λ“£κΈ°")
98
 
99
  next_button_short.click(
100
  fn=next_story,
@@ -112,13 +179,13 @@ with gr.Blocks(title="πŸ“š κ·€μ—¬μš΄ μŠ€ν† λ¦¬ μ•±") as demo:
112
  state_index_long = gr.State(value=init_index_long)
113
  state_text_long = gr.State(value=init_text_long)
114
 
115
- story_text_long = gr.Markdown(value=init_text_long)
116
- story_image_long = gr.Image(value=init_image_long, width=400, height=400)
117
  audio_output_long = gr.Audio(value=init_audio_long, autoplay=False)
118
 
119
  with gr.Row():
120
- next_button_long = gr.Button("πŸ‘‰ λ‹€μŒ 이야기")
121
- play_button_long = gr.Button("πŸ”Š λ‹€μ‹œ λ“£κΈ°")
122
 
123
  next_button_long.click(
124
  fn=next_story,
@@ -132,6 +199,5 @@ with gr.Blocks(title="πŸ“š κ·€μ—¬μš΄ μŠ€ν† λ¦¬ μ•±") as demo:
132
  outputs=[audio_output_long]
133
  )
134
 
135
-
136
  # πŸ“Œ μ•± μ‹€ν–‰
137
  demo.launch()
 
83
 
84
  # πŸ“Œ Gradio UI ꡬ성
85
  with gr.Blocks(title="πŸ“š κ·€μ—¬μš΄ μŠ€ν† λ¦¬ μ•±") as demo:
86
+ gr.HTML("""
87
+ <style>
88
+ body {
89
+ background-color: #FFFAF0; /* λ”°λœ»ν•œ 크림색 λ°°κ²½ */
90
+ font-family: 'Comic Sans MS', cursive, sans-serif;
91
+ }
92
+
93
+ h1 {
94
+ color: #FF6347;
95
+ text-align: center;
96
+ font-size: 3em;
97
+ font-weight: bold;
98
+ margin-top: 20px;
99
+ }
100
+
101
+ p {
102
+ text-align: center;
103
+ font-size: 1.2em;
104
+ color: #6B4226;
105
+ }
106
+
107
+ .story-text {
108
+ font-size: 4em;
109
+ font-weight: bold;
110
+ text-align: center;
111
+ color: #FF4500;
112
+ padding: 20px;
113
+ border-radius: 15px;
114
+ background: #FFF3E0;
115
+ display: inline-block;
116
+ box-shadow: 4px 4px 10px rgba(0,0,0,0.2);
117
+ }
118
+
119
+ .btn-custom {
120
+ font-size: 1.5em;
121
+ font-weight: bold;
122
+ border-radius: 20px;
123
+ padding: 10px 20px;
124
+ margin: 5px;
125
+ border: none;
126
+ cursor: pointer;
127
+ box-shadow: 3px 3px 8px rgba(0,0,0,0.2);
128
+ }
129
+
130
+ .next-btn {
131
+ background-color: #FFD700; /* λ…Έλž€μƒ‰ λ²„νŠΌ */
132
+ }
133
+
134
+ .play-btn {
135
+ background-color: #90EE90; /* μ—°ν•œ μ΄ˆλ‘μƒ‰ λ²„νŠΌ */
136
+ }
137
+
138
+ img {
139
+ border-radius: 15px;
140
+ border: 5px solid #FFFFFF;
141
+ box-shadow: 4px 4px 10px rgba(0,0,0,0.2);
142
+ width: 400px;
143
+ height: 400px;
144
+ display: block;
145
+ margin: auto;
146
+ }
147
+ </style>
148
+ """)
149
+
150
+ gr.HTML("<h1>🎈 μž¬λ―ΈμžˆλŠ” μ˜μ–΄ μŠ€ν† λ¦¬ νƒ€μž„! πŸ“–</h1>")
151
+ gr.HTML("<p>🐱 κ·€μ—¬μš΄ 이야기와 ν•¨κ»˜ μ˜μ–΄λ₯Ό λ°°μ›Œλ³΄μ•„μš”! <br> λ²„νŠΌμ„ 눌러 λ‹€μŒ μ΄μ•ΌκΈ°λ‘œ λ„˜μ–΄κ°€κ³ , μŒμ„±μ„ λ“€μœΌλ©° 따라 μ½μ–΄λ³΄μ„Έμš”! 🎡</p>")
152
+
153
  with gr.Tabs():
154
  with gr.TabItem("Short Vowel (단λͺ¨μŒ)"):
155
  state_index_short = gr.State(value=init_index_short)
156
  state_text_short = gr.State(value=init_text_short)
157
 
158
+ story_text_short = gr.Markdown(value=f"<div class='story-text'>{init_text_short}</div>")
159
+ story_image_short = gr.Image(value=init_image_short)
160
  audio_output_short = gr.Audio(value=init_audio_short, autoplay=True)
161
 
162
  with gr.Row():
163
+ next_button_short = gr.Button("πŸ‘‰ λ‹€μŒ 이야기", elem_classes=["btn-custom", "next-btn"])
164
+ play_button_short = gr.Button("πŸ”Š λ‹€μ‹œ λ“£κΈ°", elem_classes=["btn-custom", "play-btn"])
165
 
166
  next_button_short.click(
167
  fn=next_story,
 
179
  state_index_long = gr.State(value=init_index_long)
180
  state_text_long = gr.State(value=init_text_long)
181
 
182
+ story_text_long = gr.Markdown(value=f"<div class='story-text'>{init_text_long}</div>")
183
+ story_image_long = gr.Image(value=init_image_long)
184
  audio_output_long = gr.Audio(value=init_audio_long, autoplay=False)
185
 
186
  with gr.Row():
187
+ next_button_long = gr.Button("πŸ‘‰ λ‹€μŒ 이야기", elem_classes=["btn-custom", "next-btn"])
188
+ play_button_long = gr.Button("πŸ”Š λ‹€μ‹œ λ“£κΈ°", elem_classes=["btn-custom", "play-btn"])
189
 
190
  next_button_long.click(
191
  fn=next_story,
 
199
  outputs=[audio_output_long]
200
  )
201
 
 
202
  # πŸ“Œ μ•± μ‹€ν–‰
203
  demo.launch()