Update app.py
Browse files
app.py
CHANGED
|
@@ -40,17 +40,30 @@ body {
|
|
| 40 |
background: #1e1e1e;
|
| 41 |
border-radius: 10px;
|
| 42 |
padding: 15px;
|
|
|
|
| 43 |
text-align: center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
}
|
| 45 |
.play-btn {
|
| 46 |
-
background-color:
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
| 50 |
cursor: pointer;
|
|
|
|
| 51 |
}
|
| 52 |
.play-btn:hover {
|
| 53 |
-
color: #ff8a50;
|
|
|
|
| 54 |
}
|
| 55 |
.playing {
|
| 56 |
animation: pulse 1s infinite alternate;
|
|
@@ -59,6 +72,13 @@ body {
|
|
| 59 |
0% { transform: scale(1); }
|
| 60 |
100% { transform: scale(1.1); }
|
| 61 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
"""
|
| 63 |
|
| 64 |
# Create layout
|
|
@@ -76,8 +96,8 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 76 |
audio = gr.Audio(play_audio(voice["file"]), autoplay=False, elem_id=voice["name"], visible=False)
|
| 77 |
# Play Button with FontAwesome Icon
|
| 78 |
btn = gr.Button("▶", elem_classes="play-btn")
|
| 79 |
-
# Voice Info
|
| 80 |
-
info = gr.Markdown(f"
|
| 81 |
|
| 82 |
def start_animation():
|
| 83 |
return gr.update(elem_classes="playing")
|
|
|
|
| 40 |
background: #1e1e1e;
|
| 41 |
border-radius: 10px;
|
| 42 |
padding: 15px;
|
| 43 |
+
margin-bottom: 20px;
|
| 44 |
text-align: center;
|
| 45 |
+
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.4);
|
| 46 |
+
}
|
| 47 |
+
.gr-column {
|
| 48 |
+
display: flex;
|
| 49 |
+
justify-content: flex-start;
|
| 50 |
+
align-items: center;
|
| 51 |
+
margin: 10px;
|
| 52 |
}
|
| 53 |
.play-btn {
|
| 54 |
+
background-color: #FF5722 !important;
|
| 55 |
+
color: white;
|
| 56 |
+
border-radius: 50%;
|
| 57 |
+
width: 60px;
|
| 58 |
+
height: 60px;
|
| 59 |
+
font-size: 30px;
|
| 60 |
+
margin-right: 15px;
|
| 61 |
cursor: pointer;
|
| 62 |
+
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2);
|
| 63 |
}
|
| 64 |
.play-btn:hover {
|
| 65 |
+
background-color: #ff8a50;
|
| 66 |
+
box-shadow: 0px 6px 16px rgba(0, 0, 0, 0.3);
|
| 67 |
}
|
| 68 |
.playing {
|
| 69 |
animation: pulse 1s infinite alternate;
|
|
|
|
| 72 |
0% { transform: scale(1); }
|
| 73 |
100% { transform: scale(1.1); }
|
| 74 |
}
|
| 75 |
+
.voice-info {
|
| 76 |
+
color: #ffffff;
|
| 77 |
+
text-align: left;
|
| 78 |
+
}
|
| 79 |
+
.voice-info b {
|
| 80 |
+
font-weight: bold;
|
| 81 |
+
}
|
| 82 |
"""
|
| 83 |
|
| 84 |
# Create layout
|
|
|
|
| 96 |
audio = gr.Audio(play_audio(voice["file"]), autoplay=False, elem_id=voice["name"], visible=False)
|
| 97 |
# Play Button with FontAwesome Icon
|
| 98 |
btn = gr.Button("▶", elem_classes="play-btn")
|
| 99 |
+
# Voice Info (Name in Bold, Other Info Normal)
|
| 100 |
+
info = gr.Markdown(f"<div class='voice-info'><b>{voice['name']}</b><br>{voice['gender']} | {voice['country']}</div>")
|
| 101 |
|
| 102 |
def start_animation():
|
| 103 |
return gr.update(elem_classes="playing")
|