aimanathar commited on
Commit
1c0a3df
·
verified ·
1 Parent(s): 41df3a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -8
app.py CHANGED
@@ -23,7 +23,7 @@ def respond(message, history: list[dict[str, str]]):
23
  response += msg.choices[0].delta.content
24
  yield response
25
 
26
- # 💜 Improved CSS + Footer Hide + Custom Header
27
  custom_css = """
28
  .gradio-container {
29
  background: linear-gradient(to bottom right, #7E498B, #f5f5f5);
@@ -31,21 +31,37 @@ custom_css = """
31
  height: 100vh;
32
  padding: 20px;
33
  }
34
- #custom header
 
35
  .custom-header {
36
  text-align: center;
37
- font-size: 30px; /* font size */
38
  font-weight: 700; /* bold */
39
  color: white; /* text white */
40
- margin-top: 40px; /* top se thoda neeche */
41
- margin-bottom: 20px; /* neeche spacing */
42
  padding: 10px 16px;
43
  border-radius: 12px;
44
  background: linear-gradient(135deg, #7E498B, #9b59b6); /* purple gradient */
45
  box-shadow: 0px 4px 12px rgba(0,0,0,0.15);
46
  }
47
 
 
 
 
 
 
 
 
 
48
 
 
 
 
 
 
 
 
49
 
50
  /* Chat box styling */
51
  .svelte-1ipelgc, .svelte-1f354aw {
@@ -113,10 +129,10 @@ footer, .svelte-1yycg3h, .builder-bar, .wrap.svelte-1ipelgc {
113
  """
114
 
115
  with gr.Blocks(theme=gr.themes.Soft(), css=custom_css) as demo:
116
- # ✅ Custom header at top
117
- gr.HTML("<div class='custom-header'> VirtualTrainR Assistant</div>")
118
 
119
- # Chat interface (default blue title + icons preserved if needed)
120
  gr.ChatInterface(respond, type="messages")
121
 
122
  if __name__ == "__main__":
 
23
  response += msg.choices[0].delta.content
24
  yield response
25
 
26
+ # 💜 Improved CSS + Footer Hide + Responsive Custom Header
27
  custom_css = """
28
  .gradio-container {
29
  background: linear-gradient(to bottom right, #7E498B, #f5f5f5);
 
31
  height: 100vh;
32
  padding: 20px;
33
  }
34
+
35
+ /* Custom header */
36
  .custom-header {
37
  text-align: center;
38
+ font-size: 30px; /* default font size */
39
  font-weight: 700; /* bold */
40
  color: white; /* text white */
41
+ margin-top: 40px; /* top spacing */
42
+ margin-bottom: 20px; /* bottom spacing */
43
  padding: 10px 16px;
44
  border-radius: 12px;
45
  background: linear-gradient(135deg, #7E498B, #9b59b6); /* purple gradient */
46
  box-shadow: 0px 4px 12px rgba(0,0,0,0.15);
47
  }
48
 
49
+ /* Responsive adjustments for smaller screens */
50
+ @media screen and (max-width: 768px) {
51
+ .custom-header {
52
+ font-size: 24px;
53
+ margin-top: 30px;
54
+ padding: 8px 12px;
55
+ }
56
+ }
57
 
58
+ @media screen and (max-width: 480px) {
59
+ .custom-header {
60
+ font-size: 20px;
61
+ margin-top: 20px;
62
+ padding: 6px 10px;
63
+ }
64
+ }
65
 
66
  /* Chat box styling */
67
  .svelte-1ipelgc, .svelte-1f354aw {
 
129
  """
130
 
131
  with gr.Blocks(theme=gr.themes.Soft(), css=custom_css) as demo:
132
+ # ✅ Responsive Custom Header
133
+ gr.HTML("<div class='custom-header'>💬 VirtualTrainR Assistant</div>")
134
 
135
+ # Chat interface
136
  gr.ChatInterface(respond, type="messages")
137
 
138
  if __name__ == "__main__":