Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -92,7 +92,7 @@
|
|
| 92 |
import gradio as gr
|
| 93 |
|
| 94 |
|
| 95 |
-
|
| 96 |
#chatbot .user {
|
| 97 |
background: linear-gradient(to bottom right, #93c5fd, #60a5fa);
|
| 98 |
color: white;
|
|
@@ -125,6 +125,60 @@ css = r"""
|
|
| 125 |
}
|
| 126 |
|
| 127 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
def respond(message, history):
|
| 129 |
return f"BubbleBot says: {message}"
|
| 130 |
|
|
|
|
| 92 |
import gradio as gr
|
| 93 |
|
| 94 |
|
| 95 |
+
css1 = r"""
|
| 96 |
#chatbot .user {
|
| 97 |
background: linear-gradient(to bottom right, #93c5fd, #60a5fa);
|
| 98 |
color: white;
|
|
|
|
| 125 |
}
|
| 126 |
|
| 127 |
"""
|
| 128 |
+
|
| 129 |
+
css = """
|
| 130 |
+
#chatbot {
|
| 131 |
+
background-color: #f7f9fc;
|
| 132 |
+
border-radius: 10px;
|
| 133 |
+
padding: 15px;
|
| 134 |
+
overflow-y: auto;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
#chatbot .message {
|
| 138 |
+
display: flex;
|
| 139 |
+
margin: 10px 0;
|
| 140 |
+
}
|
| 141 |
+
|
| 142 |
+
#chatbot .message.user {
|
| 143 |
+
justify-content: flex-end;
|
| 144 |
+
}
|
| 145 |
+
|
| 146 |
+
#chatbot .message.bot {
|
| 147 |
+
justify-content: flex-start;
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
/* User bubble */
|
| 151 |
+
#chatbot .message.user .bubble {
|
| 152 |
+
background: linear-gradient(135deg, #4CAF50, #81C784);
|
| 153 |
+
color: white;
|
| 154 |
+
border-radius: 16px 16px 0 16px;
|
| 155 |
+
padding: 10px 15px;
|
| 156 |
+
max-width: 70%;
|
| 157 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.15);
|
| 158 |
+
}
|
| 159 |
+
|
| 160 |
+
/* Bot bubble */
|
| 161 |
+
#chatbot .message.bot .bubble {
|
| 162 |
+
background: linear-gradient(135deg, #2196F3, #64B5F6);
|
| 163 |
+
color: white;
|
| 164 |
+
border-radius: 16px 16px 16px 0;
|
| 165 |
+
padding: 10px 15px;
|
| 166 |
+
max-width: 70%;
|
| 167 |
+
box-shadow: 0 2px 5px rgba(0,0,0,0.15);
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
/* Optional: add smooth fade-in animation */
|
| 171 |
+
@keyframes bubblePop {
|
| 172 |
+
from { transform: scale(0.95); opacity: 0; }
|
| 173 |
+
to { transform: scale(1); opacity: 1; }
|
| 174 |
+
}
|
| 175 |
+
|
| 176 |
+
#chatbot .bubble {
|
| 177 |
+
animation: bubblePop 0.2s ease-out;
|
| 178 |
+
}
|
| 179 |
+
"""
|
| 180 |
+
|
| 181 |
+
|
| 182 |
def respond(message, history):
|
| 183 |
return f"BubbleBot says: {message}"
|
| 184 |
|