Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -126,7 +126,7 @@ def chat_with_portfolio(message, history):
|
|
| 126 |
return f"Error: {str(e)}"
|
| 127 |
|
| 128 |
|
| 129 |
-
#
|
| 130 |
custom_css = """
|
| 131 |
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap');
|
| 132 |
|
|
@@ -139,6 +139,7 @@ custom_css = """
|
|
| 139 |
background-attachment: fixed !important;
|
| 140 |
}
|
| 141 |
|
|
|
|
| 142 |
.message-wrap {
|
| 143 |
background: rgba(255, 255, 255, 0.15) !important;
|
| 144 |
backdrop-filter: blur(12px) !important;
|
|
@@ -151,6 +152,7 @@ custom_css = """
|
|
| 151 |
color: white !important;
|
| 152 |
}
|
| 153 |
|
|
|
|
| 154 |
.input-wrap textarea,
|
| 155 |
textarea {
|
| 156 |
background: rgba(255, 255, 255, 0.1) !important;
|
|
@@ -164,45 +166,76 @@ textarea::placeholder {
|
|
| 164 |
color: rgba(255, 255, 255, 0.6) !important;
|
| 165 |
}
|
| 166 |
|
|
|
|
| 167 |
button {
|
| 168 |
-
|
|
|
|
| 169 |
max-height: 44px !important;
|
| 170 |
-
|
| 171 |
-
padding: 8px 16px !important;
|
| 172 |
}
|
| 173 |
|
| 174 |
-
|
|
|
|
|
|
|
| 175 |
width: 20px !important;
|
| 176 |
height: 20px !important;
|
|
|
|
|
|
|
| 177 |
max-width: 20px !important;
|
| 178 |
max-height: 20px !important;
|
| 179 |
}
|
| 180 |
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
|
|
|
|
|
|
| 184 |
width: 60px !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
}
|
| 186 |
|
|
|
|
| 187 |
.examples button {
|
| 188 |
background: rgba(255, 255, 255, 0.1) !important;
|
| 189 |
border: 1px solid rgba(255, 255, 255, 0.2) !important;
|
| 190 |
color: white !important;
|
| 191 |
-
max-width: 100% !important;
|
| 192 |
border-radius: 12px !important;
|
|
|
|
|
|
|
|
|
|
| 193 |
}
|
| 194 |
|
| 195 |
.examples button:hover {
|
| 196 |
background: rgba(255, 255, 255, 0.2) !important;
|
| 197 |
}
|
| 198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
footer {
|
| 200 |
display: none !important;
|
| 201 |
}
|
| 202 |
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
|
|
|
|
|
|
| 206 |
}
|
| 207 |
"""
|
| 208 |
|
|
|
|
| 126 |
return f"Error: {str(e)}"
|
| 127 |
|
| 128 |
|
| 129 |
+
# Fixed CSS for Gradio 5.0 - properly sized icons
|
| 130 |
custom_css = """
|
| 131 |
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap');
|
| 132 |
|
|
|
|
| 139 |
background-attachment: fixed !important;
|
| 140 |
}
|
| 141 |
|
| 142 |
+
/* Chat messages */
|
| 143 |
.message-wrap {
|
| 144 |
background: rgba(255, 255, 255, 0.15) !important;
|
| 145 |
backdrop-filter: blur(12px) !important;
|
|
|
|
| 152 |
color: white !important;
|
| 153 |
}
|
| 154 |
|
| 155 |
+
/* Input textarea */
|
| 156 |
.input-wrap textarea,
|
| 157 |
textarea {
|
| 158 |
background: rgba(255, 255, 255, 0.1) !important;
|
|
|
|
| 166 |
color: rgba(255, 255, 255, 0.6) !important;
|
| 167 |
}
|
| 168 |
|
| 169 |
+
/* Fix button and icon sizes for Gradio 5.0 */
|
| 170 |
button {
|
| 171 |
+
height: 44px !important;
|
| 172 |
+
min-height: 44px !important;
|
| 173 |
max-height: 44px !important;
|
| 174 |
+
padding: 8px 12px !important;
|
|
|
|
| 175 |
}
|
| 176 |
|
| 177 |
+
/* Target SVG icons inside buttons */
|
| 178 |
+
button svg,
|
| 179 |
+
button img {
|
| 180 |
width: 20px !important;
|
| 181 |
height: 20px !important;
|
| 182 |
+
min-width: 20px !important;
|
| 183 |
+
min-height: 20px !important;
|
| 184 |
max-width: 20px !important;
|
| 185 |
max-height: 20px !important;
|
| 186 |
}
|
| 187 |
|
| 188 |
+
/* Submit button specific sizing */
|
| 189 |
+
.submit-btn,
|
| 190 |
+
button[type="submit"],
|
| 191 |
+
.chatbot button[aria-label*="Submit"],
|
| 192 |
+
.chatbot button[aria-label*="Send"] {
|
| 193 |
width: 60px !important;
|
| 194 |
+
min-width: 60px !important;
|
| 195 |
+
max-width: 60px !important;
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
/* Action buttons (clear, undo, etc) */
|
| 199 |
+
.chatbot .action-button,
|
| 200 |
+
.chatbot button[aria-label*="Clear"],
|
| 201 |
+
.chatbot button[aria-label*="Undo"],
|
| 202 |
+
.chatbot button[aria-label*="Delete"] {
|
| 203 |
+
width: 44px !important;
|
| 204 |
+
min-width: 44px !important;
|
| 205 |
+
max-width: 44px !important;
|
| 206 |
}
|
| 207 |
|
| 208 |
+
/* Example buttons */
|
| 209 |
.examples button {
|
| 210 |
background: rgba(255, 255, 255, 0.1) !important;
|
| 211 |
border: 1px solid rgba(255, 255, 255, 0.2) !important;
|
| 212 |
color: white !important;
|
|
|
|
| 213 |
border-radius: 12px !important;
|
| 214 |
+
height: auto !important;
|
| 215 |
+
max-height: none !important;
|
| 216 |
+
padding: 12px 16px !important;
|
| 217 |
}
|
| 218 |
|
| 219 |
.examples button:hover {
|
| 220 |
background: rgba(255, 255, 255, 0.2) !important;
|
| 221 |
}
|
| 222 |
|
| 223 |
+
/* Chatbot container */
|
| 224 |
+
.chatbot {
|
| 225 |
+
background: rgba(255, 255, 255, 0.05) !important;
|
| 226 |
+
border-radius: 20px !important;
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
+
/* Hide footer */
|
| 230 |
footer {
|
| 231 |
display: none !important;
|
| 232 |
}
|
| 233 |
|
| 234 |
+
/* Additional icon fix for any nested elements */
|
| 235 |
+
button * svg,
|
| 236 |
+
button * img {
|
| 237 |
+
width: 20px !important;
|
| 238 |
+
height: 20px !important;
|
| 239 |
}
|
| 240 |
"""
|
| 241 |
|