addaweathers commited on
Commit
003d8eb
Β·
verified Β·
1 Parent(s): ed400fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +45 -18
app.py CHANGED
@@ -126,7 +126,7 @@ def chat_with_portfolio(message, history):
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
 
@@ -134,11 +134,29 @@ custom_css = """
134
  font-family: 'Quicksand', sans-serif !important;
135
  }
136
 
137
- .gradio-container {
 
 
 
 
138
  background: linear-gradient(135deg, #a78bfa 0%, #6366f1 50%, #3b82f6 100%) !important;
139
  background-attachment: fixed !important;
140
  }
141
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  /* Chat messages */
143
  .message-wrap {
144
  background: rgba(255, 255, 255, 0.15) !important;
@@ -224,6 +242,14 @@ button[type="submit"],
224
  .chatbot {
225
  background: rgba(255, 255, 255, 0.05) !important;
226
  border-radius: 20px !important;
 
 
 
 
 
 
 
 
227
  }
228
 
229
  /* Hide footer */
@@ -240,22 +266,23 @@ button * img {
240
  """
241
 
242
  with gr.Blocks(theme=gr.themes.Soft(), css=custom_css) as demo:
243
- gr.Markdown(
244
- "<h1 style='text-align: center; color: white; text-shadow: 2px 2px 4px rgba(0,0,0,0.3);'>πŸˆβ€β¬› Chat with Adda-Bot</h1>"
245
- )
246
-
247
- gr.ChatInterface(
248
- fn=chat_with_portfolio,
249
- description="<span style='color: white; font-weight: 600;'>Ask me anything about Adda's portfolio!</span>",
250
- examples=[
251
- "What is Adda's experience with Python?",
252
- "Tell me about her education.",
253
- "What projects has Adda worked on?"
254
- ],
255
- type="messages",
256
- textbox=gr.Textbox(placeholder="Ask about Adda's portfolio...", scale=7),
257
- submit_btn="Send",
258
- )
 
259
 
260
  if __name__ == "__main__":
261
  demo.launch()
 
126
  return f"Error: {str(e)}"
127
 
128
 
129
+ # Fixed CSS for Gradio 5.0 - properly sized icons and full background
130
  custom_css = """
131
  @import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap');
132
 
 
134
  font-family: 'Quicksand', sans-serif !important;
135
  }
136
 
137
+ /* Fix for white space - apply gradient to body and html */
138
+ body, html {
139
+ margin: 0 !important;
140
+ padding: 0 !important;
141
+ height: 100% !important;
142
  background: linear-gradient(135deg, #a78bfa 0%, #6366f1 50%, #3b82f6 100%) !important;
143
  background-attachment: fixed !important;
144
  }
145
 
146
+ .gradio-container {
147
+ background: transparent !important;
148
+ min-height: 100vh !important;
149
+ }
150
+
151
+ .main {
152
+ background: transparent !important;
153
+ }
154
+
155
+ /* Make the app container fill the space */
156
+ .app {
157
+ background: transparent !important;
158
+ }
159
+
160
  /* Chat messages */
161
  .message-wrap {
162
  background: rgba(255, 255, 255, 0.15) !important;
 
242
  .chatbot {
243
  background: rgba(255, 255, 255, 0.05) !important;
244
  border-radius: 20px !important;
245
+ min-height: 400px !important;
246
+ }
247
+
248
+ /* Center and constrain the content */
249
+ .contain {
250
+ max-width: 1200px !important;
251
+ margin: 0 auto !important;
252
+ padding: 20px !important;
253
  }
254
 
255
  /* Hide footer */
 
266
  """
267
 
268
  with gr.Blocks(theme=gr.themes.Soft(), css=custom_css) as demo:
269
+ with gr.Column():
270
+ gr.Markdown(
271
+ "<h1 style='text-align: center; color: white; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); margin-top: 20px;'>πŸˆβ€β¬› Chat with Adda-Bot</h1>"
272
+ )
273
+
274
+ gr.ChatInterface(
275
+ fn=chat_with_portfolio,
276
+ description="<span style='color: white; font-weight: 600;'>Ask me anything about Adda's portfolio!</span>",
277
+ examples=[
278
+ "What is Adda's experience with Python?",
279
+ "Tell me about her education.",
280
+ "What projects has Adda worked on?"
281
+ ],
282
+ type="messages",
283
+ textbox=gr.Textbox(placeholder="Ask about Adda's portfolio...", scale=7),
284
+ submit_btn="Send",
285
+ )
286
 
287
  if __name__ == "__main__":
288
  demo.launch()