Spaces:
Sleeping
Sleeping
Mahdi Naser Moghadasi commited on
Commit Β·
53ebb28
1
Parent(s): 0cc1ca4
π§ Fix Albert avatar size (5x larger) and voice button (smaller + working functionality)
Browse files
app.py
CHANGED
|
@@ -1384,12 +1384,12 @@ with gr.Blocks(
|
|
| 1384 |
}
|
| 1385 |
|
| 1386 |
.chatbot .message .avatar {
|
| 1387 |
-
width:
|
| 1388 |
-
height:
|
| 1389 |
border-radius: 50% !important;
|
| 1390 |
-
margin-right:
|
| 1391 |
-
border:
|
| 1392 |
-
box-shadow: 0
|
| 1393 |
transition: all 0.3s ease !important;
|
| 1394 |
}
|
| 1395 |
|
|
@@ -1421,12 +1421,12 @@ with gr.Blocks(
|
|
| 1421 |
background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
|
| 1422 |
color: white !important;
|
| 1423 |
border: none !important;
|
| 1424 |
-
padding: 12px
|
| 1425 |
-
border-radius:
|
| 1426 |
cursor: pointer !important;
|
| 1427 |
-
font-weight:
|
| 1428 |
-
font-size:
|
| 1429 |
-
box-shadow: 0
|
| 1430 |
transition: all 0.3s ease !important;
|
| 1431 |
}
|
| 1432 |
|
|
@@ -1434,6 +1434,20 @@ with gr.Blocks(
|
|
| 1434 |
transform: translateY(-2px) !important;
|
| 1435 |
box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4) !important;
|
| 1436 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1437 |
"""
|
| 1438 |
) as demo:
|
| 1439 |
|
|
@@ -1690,9 +1704,9 @@ with gr.Blocks(
|
|
| 1690 |
voice_html = f"""
|
| 1691 |
<div class="voice-controls">
|
| 1692 |
<button onclick="speakText('{escaped_response}')">
|
| 1693 |
-
π Listen
|
| 1694 |
</button>
|
| 1695 |
-
<span style="color: #666; font-size:
|
| 1696 |
</div>
|
| 1697 |
<script>
|
| 1698 |
function speakText(text) {{
|
|
@@ -1730,9 +1744,9 @@ with gr.Blocks(
|
|
| 1730 |
voice_html = f"""
|
| 1731 |
<div class="voice-controls">
|
| 1732 |
<button onclick="speakText('{escaped_response}')">
|
| 1733 |
-
π Listen
|
| 1734 |
</button>
|
| 1735 |
-
<span style="color: #666; font-size:
|
| 1736 |
</div>
|
| 1737 |
<script>
|
| 1738 |
function speakText(text) {{
|
|
|
|
| 1384 |
}
|
| 1385 |
|
| 1386 |
.chatbot .message .avatar {
|
| 1387 |
+
width: 300px !important;
|
| 1388 |
+
height: 300px !important;
|
| 1389 |
border-radius: 50% !important;
|
| 1390 |
+
margin-right: 20px !important;
|
| 1391 |
+
border: 6px solid #667eea !important;
|
| 1392 |
+
box-shadow: 0 8px 16px rgba(0,0,0,0.3) !important;
|
| 1393 |
transition: all 0.3s ease !important;
|
| 1394 |
}
|
| 1395 |
|
|
|
|
| 1421 |
background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%) !important;
|
| 1422 |
color: white !important;
|
| 1423 |
border: none !important;
|
| 1424 |
+
padding: 6px 12px !important;
|
| 1425 |
+
border-radius: 6px !important;
|
| 1426 |
cursor: pointer !important;
|
| 1427 |
+
font-weight: 500 !important;
|
| 1428 |
+
font-size: 11px !important;
|
| 1429 |
+
box-shadow: 0 2px 6px rgba(76, 175, 80, 0.3) !important;
|
| 1430 |
transition: all 0.3s ease !important;
|
| 1431 |
}
|
| 1432 |
|
|
|
|
| 1434 |
transform: translateY(-2px) !important;
|
| 1435 |
box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4) !important;
|
| 1436 |
}
|
| 1437 |
+
</style>
|
| 1438 |
+
<script>
|
| 1439 |
+
function speakText(text) {
|
| 1440 |
+
if ('speechSynthesis' in window) {
|
| 1441 |
+
const utterance = new SpeechSynthesisUtterance(text);
|
| 1442 |
+
utterance.rate = 0.9;
|
| 1443 |
+
utterance.pitch = 1.1;
|
| 1444 |
+
utterance.volume = 0.8;
|
| 1445 |
+
speechSynthesis.speak(utterance);
|
| 1446 |
+
} else {
|
| 1447 |
+
alert('Speech synthesis not supported in this browser');
|
| 1448 |
+
}
|
| 1449 |
+
}
|
| 1450 |
+
</script>
|
| 1451 |
"""
|
| 1452 |
) as demo:
|
| 1453 |
|
|
|
|
| 1704 |
voice_html = f"""
|
| 1705 |
<div class="voice-controls">
|
| 1706 |
<button onclick="speakText('{escaped_response}')">
|
| 1707 |
+
π Listen
|
| 1708 |
</button>
|
| 1709 |
+
<span style="color: #666; font-size: 10px; margin-left: 8px;">Click to hear Albert!</span>
|
| 1710 |
</div>
|
| 1711 |
<script>
|
| 1712 |
function speakText(text) {{
|
|
|
|
| 1744 |
voice_html = f"""
|
| 1745 |
<div class="voice-controls">
|
| 1746 |
<button onclick="speakText('{escaped_response}')">
|
| 1747 |
+
π Listen
|
| 1748 |
</button>
|
| 1749 |
+
<span style="color: #666; font-size: 10px; margin-left: 8px;">Click to hear Albert!</span>
|
| 1750 |
</div>
|
| 1751 |
<script>
|
| 1752 |
function speakText(text) {{
|