Zedel17 commited on
Commit
351b5e1
·
1 Parent(s): efcea70

roll back

Browse files
Files changed (1) hide show
  1. app.py +46 -95
app.py CHANGED
@@ -79,137 +79,88 @@ def chat_fn(message, history, persona_name):
79
 
80
  with gr.Blocks() as demo:
81
 
82
- # Apply clean, modern styling
83
  gr.HTML("""
84
  <style>
85
- /* Import modern professional font */
86
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');
87
 
88
- /* Global font application */
89
  * {
90
- font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
91
  }
92
 
93
- /* Main container - light grey background */
94
  .gradio-container {
95
- background-color: #FAFAFA !important;
96
  }
97
 
98
- /* All panels and components - white with subtle border */
99
- .gr-box, .gr-form, .gr-panel, .gr-input, .gr-radio {
100
- background-color: #FFFFFF !important;
101
- border: 1px solid #E5E7EB !important;
102
- border-radius: 8px !important;
103
- }
104
-
105
- /* Typography - dark blue for readability */
106
- h1, h2, h3, h4, h5, h6 {
107
- color: #1E3A8A !important;
108
- font-weight: 600 !important;
109
- }
110
-
111
- p, span, div, label {
112
- color: #1E3A8A !important;
113
  }
114
 
115
- /* Primary button - soft professional blue */
116
  button.primary {
117
- background-color: #3B82F6 !important;
118
- color: #FFFFFF !important;
119
- border: none !important;
120
  font-weight: 500 !important;
121
- padding: 8px 16px !important;
122
- border-radius: 6px !important;
123
- transition: background-color 0.2s !important;
124
  }
125
 
126
  button.primary:hover {
127
- background-color: #2563EB !important;
 
 
128
  }
129
 
130
- /* Secondary buttons - light grey */
131
- button:not(.primary) {
132
- background-color: #F3F4F6 !important;
133
- color: #1F2937 !important;
134
- border: 1px solid #E5E7EB !important;
135
- font-weight: 500 !important;
136
- padding: 8px 16px !important;
137
- border-radius: 6px !important;
138
- transition: background-color 0.2s !important;
139
- }
140
-
141
- button:not(.primary):hover {
142
- background-color: #E5E7EB !important;
143
- }
144
-
145
- /* Chat messages - distinct colors, dark readable text */
146
  .message.user {
147
- background-color: #E5E7EB !important;
148
- color: #1F2937 !important;
149
- padding: 12px !important;
150
- border-radius: 8px !important;
151
- margin: 8px 0 !important;
152
  }
153
 
154
  .message.bot {
155
- background-color: #F1F5F9 !important;
156
- color: #1F2937 !important;
157
- padding: 12px !important;
158
- border-radius: 8px !important;
159
- margin: 8px 0 !important;
160
- }
161
-
162
- .message p {
163
- color: #1F2937 !important;
164
- margin: 0 !important;
165
  }
166
 
167
- /* Input fields - white background, dark text */
168
- input, textarea {
169
- background-color: #FFFFFF !important;
170
- color: #1F2937 !important;
171
- border: 1px solid #D1D5DB !important;
172
- padding: 10px !important;
173
- border-radius: 6px !important;
174
  }
175
 
176
- input::placeholder, textarea::placeholder {
177
- color: #9CA3AF !important;
 
178
  }
179
 
180
- input:focus, textarea:focus {
181
- border-color: #3B82F6 !important;
182
- outline: none !important;
183
- box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1) !important;
184
  }
185
 
186
- /* Chatbot container */
187
- .gr-chatbot {
188
- background-color: #FFFFFF !important;
189
- border: 1px solid #E5E7EB !important;
190
- border-radius: 8px !important;
191
  }
192
 
193
- /* Radio buttons - ensure they're visible and clickable */
194
- .gr-radio label {
195
- cursor: pointer !important;
196
- display: flex !important;
197
- align-items: center !important;
198
- padding: 8px !important;
199
- margin: 4px 0 !important;
200
  }
201
 
202
- input[type="radio"] {
203
- width: 18px !important;
204
- height: 18px !important;
205
- margin-right: 10px !important;
206
- cursor: pointer !important;
207
- accent-color: #3B82F6 !important;
208
  }
209
 
210
- /* Remove any leftover bright colors */
211
- .gr-button, .gr-input, .gr-radio, .gr-checkbox {
212
- box-shadow: none !important;
213
  }
214
  </style>
215
  """)
 
79
 
80
  with gr.Blocks() as demo:
81
 
82
+ # Inject custom CSS
83
  gr.HTML("""
84
  <style>
85
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
 
86
 
 
87
  * {
88
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
89
  }
90
 
 
91
  .gradio-container {
92
+ background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%) !important;
93
  }
94
 
95
+ .gr-box, .gr-form, .gr-panel {
96
+ background-color: #ffffff !important;
97
+ border-radius: 12px !important;
98
+ box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
 
 
 
 
 
 
 
 
 
 
 
99
  }
100
 
 
101
  button.primary {
102
+ background-color: #2563eb !important;
103
+ border-color: #2563eb !important;
 
104
  font-weight: 500 !important;
105
+ transition: all 0.2s ease !important;
 
 
106
  }
107
 
108
  button.primary:hover {
109
+ background-color: #1d4ed8 !important;
110
+ transform: translateY(-1px);
111
+ box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
112
  }
113
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  .message.user {
115
+ background-color: #f1f3f5 !important;
116
+ color: #1a1a1a !important;
117
+ border-left: 3px solid #2563eb !important;
 
 
118
  }
119
 
120
  .message.bot {
121
+ background-color: #eff6ff !important;
122
+ color: #1a1a1a !important;
123
+ border-left: 3px solid #60a5fa !important;
 
 
 
 
 
 
 
124
  }
125
 
126
+ h1 {
127
+ color: #1e293b !important;
128
+ text-align: center;
129
+ font-weight: 700 !important;
130
+ letter-spacing: -0.02em;
 
 
131
  }
132
 
133
+ h2, h3, h4, h5, h6 {
134
+ color: #334155 !important;
135
+ font-weight: 600 !important;
136
  }
137
 
138
+ .gr-markdown {
139
+ text-align: center;
140
+ color: #475569 !important;
 
141
  }
142
 
143
+ .gr-radio {
144
+ background-color: #ffffff !important;
145
+ padding: 20px !important;
146
+ border-radius: 12px !important;
147
+ box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
148
  }
149
 
150
+ label {
151
+ color: #334155 !important;
152
+ font-weight: 600 !important;
 
 
 
 
153
  }
154
 
155
+ .gr-input, .gr-text-input {
156
+ border-radius: 8px !important;
157
+ border: 2px solid #e2e8f0 !important;
158
+ color: #1a1a1a !important;
 
 
159
  }
160
 
161
+ .gr-input:focus, .gr-text-input:focus {
162
+ border-color: #2563eb !important;
163
+ box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
164
  }
165
  </style>
166
  """)