Update app.py
Browse files
app.py
CHANGED
@@ -148,35 +148,215 @@ initialize_leaderboard_file()
|
|
148 |
# Function to set default mode
|
149 |
import gradio as gr
|
150 |
|
151 |
-
#
|
|
|
|
|
152 |
css_tech_theme = """
|
153 |
body {
|
|
|
154 |
background-color: #f4f6fa;
|
155 |
color: #333333;
|
156 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
line-height: 1.8;
|
158 |
}
|
159 |
|
160 |
-
.
|
161 |
display: flex;
|
162 |
-
flex-direction: column;
|
163 |
-
align-items: center;
|
164 |
justify-content: center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
text-align: center;
|
166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
padding: 20px;
|
|
|
|
|
|
|
|
|
168 |
}
|
169 |
|
170 |
-
|
171 |
-
|
172 |
-
margin: 15px 0;
|
173 |
text-align: center;
|
|
|
|
|
|
|
|
|
|
|
174 |
}
|
175 |
-
|
176 |
-
|
177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
}
|
179 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
|
181 |
# Create the Gradio Interface
|
182 |
with gr.Blocks(css=css_tech_theme) as demo:
|
|
|
148 |
# Function to set default mode
|
149 |
import gradio as gr
|
150 |
|
151 |
+
# # Custom CSS to match website style
|
152 |
+
# # Define CSS to match a modern, professional design
|
153 |
+
# # Define enhanced CSS for the entire layout
|
154 |
css_tech_theme = """
|
155 |
body {
|
156 |
+
font-family: 'Roboto', sans-serif;
|
157 |
background-color: #f4f6fa;
|
158 |
color: #333333;
|
159 |
+
margin: 0;
|
160 |
+
padding: 0;
|
161 |
+
}
|
162 |
+
|
163 |
+
/* Header Styling */
|
164 |
+
header {
|
165 |
+
text-align: center;
|
166 |
+
padding: 60px 20px;
|
167 |
+
background: linear-gradient(135deg, #6a1b9a, #64b5f6);
|
168 |
+
color: #ffffff;
|
169 |
+
border-radius: 12px;
|
170 |
+
margin-bottom: 30px;
|
171 |
+
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
|
172 |
+
}
|
173 |
+
|
174 |
+
header h1 {
|
175 |
+
font-size: 3.5em;
|
176 |
+
font-weight: bold;
|
177 |
+
margin-bottom: 10px;
|
178 |
+
}
|
179 |
+
|
180 |
+
header h2 {
|
181 |
+
font-size: 2em;
|
182 |
+
margin-bottom: 15px;
|
183 |
+
}
|
184 |
+
|
185 |
+
header p {
|
186 |
+
font-size: 1.2em;
|
187 |
line-height: 1.8;
|
188 |
}
|
189 |
|
190 |
+
.header-buttons {
|
191 |
display: flex;
|
|
|
|
|
192 |
justify-content: center;
|
193 |
+
gap: 15px;
|
194 |
+
margin-top: 20px;
|
195 |
+
}
|
196 |
+
|
197 |
+
.header-buttons a {
|
198 |
+
text-decoration: none;
|
199 |
+
font-size: 1.1em;
|
200 |
+
padding: 15px 30px;
|
201 |
+
border-radius: 30px;
|
202 |
+
font-weight: bold;
|
203 |
+
background: #ffffff;
|
204 |
+
color: #6a1b9a;
|
205 |
+
transition: transform 0.3s, background 0.3s;
|
206 |
+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
207 |
+
}
|
208 |
+
|
209 |
+
.header-buttons a:hover {
|
210 |
+
background: #64b5f6;
|
211 |
+
color: #ffffff;
|
212 |
+
transform: scale(1.05);
|
213 |
+
}
|
214 |
+
|
215 |
+
/* Pre-Tabs Section */
|
216 |
+
.pre-tabs {
|
217 |
text-align: center;
|
218 |
+
padding: 40px 20px;
|
219 |
+
background: linear-gradient(135deg, #ffffff, #f9fafb);
|
220 |
+
border-top: 5px solid #64b5f6;
|
221 |
+
border-bottom: 5px solid #6a1b9a;
|
222 |
+
}
|
223 |
+
|
224 |
+
.pre-tabs h2 {
|
225 |
+
font-size: 2.5em;
|
226 |
+
color: #333333;
|
227 |
+
margin-bottom: 15px;
|
228 |
+
}
|
229 |
+
|
230 |
+
.pre-tabs p {
|
231 |
+
font-size: 1.2em;
|
232 |
+
color: #555555;
|
233 |
+
line-height: 1.8;
|
234 |
+
}
|
235 |
+
|
236 |
+
/* Tabs Section */
|
237 |
+
.tabs {
|
238 |
+
margin: 0 auto;
|
239 |
padding: 20px;
|
240 |
+
background: #ffffff;
|
241 |
+
border-radius: 12px;
|
242 |
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
|
243 |
+
max-width: 1200px;
|
244 |
}
|
245 |
|
246 |
+
/* Post-Tabs Section */
|
247 |
+
.post-tabs {
|
|
|
248 |
text-align: center;
|
249 |
+
padding: 40px 20px;
|
250 |
+
background: linear-gradient(135deg, #64b5f6, #6a1b9a);
|
251 |
+
color: #ffffff;
|
252 |
+
border-radius: 12px;
|
253 |
+
margin-top: 30px;
|
254 |
}
|
255 |
+
|
256 |
+
.post-tabs h2 {
|
257 |
+
font-size: 2.5em;
|
258 |
+
margin-bottom: 15px;
|
259 |
+
}
|
260 |
+
|
261 |
+
.post-tabs p {
|
262 |
+
font-size: 1.2em;
|
263 |
+
line-height: 1.8;
|
264 |
+
margin-bottom: 20px;
|
265 |
+
}
|
266 |
+
|
267 |
+
.post-tabs a {
|
268 |
+
text-decoration: none;
|
269 |
+
font-size: 1.1em;
|
270 |
+
padding: 15px 30px;
|
271 |
+
border-radius: 30px;
|
272 |
+
font-weight: bold;
|
273 |
+
background: #ffffff;
|
274 |
+
color: #6a1b9a;
|
275 |
+
transition: transform 0.3s, background 0.3s;
|
276 |
+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
277 |
+
}
|
278 |
+
|
279 |
+
.post-tabs a:hover {
|
280 |
+
background: #6a1b9a;
|
281 |
+
color: #ffffff;
|
282 |
+
transform: scale(1.05);
|
283 |
+
}
|
284 |
+
|
285 |
+
/* Footer */
|
286 |
+
footer {
|
287 |
+
background: linear-gradient(135deg, #6a1b9a, #8e44ad);
|
288 |
+
color: #ffffff;
|
289 |
+
text-align: center;
|
290 |
+
padding: 40px 20px;
|
291 |
+
margin-top: 30px;
|
292 |
+
border-radius: 12px;
|
293 |
+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
|
294 |
+
}
|
295 |
+
|
296 |
+
footer h2 {
|
297 |
+
font-size: 1.8em;
|
298 |
+
margin-bottom: 15px;
|
299 |
+
}
|
300 |
+
|
301 |
+
footer p {
|
302 |
+
font-size: 1.1em;
|
303 |
+
line-height: 1.6;
|
304 |
+
margin-bottom: 20px;
|
305 |
+
}
|
306 |
+
|
307 |
+
footer .social-links {
|
308 |
+
display: flex;
|
309 |
+
justify-content: center;
|
310 |
+
gap: 15px;
|
311 |
+
margin-top: 20px;
|
312 |
+
}
|
313 |
+
|
314 |
+
footer .social-links a {
|
315 |
+
text-decoration: none;
|
316 |
+
font-size: 1.1em;
|
317 |
+
padding: 10px 20px;
|
318 |
+
border-radius: 8px;
|
319 |
+
font-weight: bold;
|
320 |
+
background: #ffffff;
|
321 |
+
color: #6a1b9a;
|
322 |
+
transition: transform 0.3s, background 0.3s;
|
323 |
+
}
|
324 |
+
|
325 |
+
footer .social-links a:hover {
|
326 |
+
background: #64b5f6;
|
327 |
+
color: #ffffff;
|
328 |
+
transform: scale(1.1);
|
329 |
}
|
330 |
"""
|
331 |
+
# Ensure CSS is correctly defined
|
332 |
+
# css_tech_theme = """
|
333 |
+
# body {
|
334 |
+
# background-color: #f4f6fa;
|
335 |
+
# color: #333333;
|
336 |
+
# font-family: 'Roboto', sans-serif;
|
337 |
+
# line-height: 1.8;
|
338 |
+
# }
|
339 |
+
|
340 |
+
# .center-content {
|
341 |
+
# display: flex;
|
342 |
+
# flex-direction: column;
|
343 |
+
# align-items: center;
|
344 |
+
# justify-content: center;
|
345 |
+
# text-align: center;
|
346 |
+
# margin: 30px 0;
|
347 |
+
# padding: 20px;
|
348 |
+
# }
|
349 |
+
|
350 |
+
# h1, h2 {
|
351 |
+
# color: #5e35b1;
|
352 |
+
# margin: 15px 0;
|
353 |
+
# text-align: center;
|
354 |
+
# }
|
355 |
+
# img {
|
356 |
+
# width: 100px;
|
357 |
+
# height: 100px;
|
358 |
+
# }
|
359 |
+
# """
|
360 |
|
361 |
# Create the Gradio Interface
|
362 |
with gr.Blocks(css=css_tech_theme) as demo:
|