geeek commited on
Commit
baf7b67
·
verified ·
1 Parent(s): a3ff808

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -2
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
  import os
3
  # Define the CSS once to avoid duplication (rest of CSS remains the same)
4
  CSS_STYLES = """
5
- .gradio-container footer { display: none !important; }
6
  .logo-container{ display: inline-flex; justify-content: center; align-items: center; column-gap: 12px;}
7
  .logo-container .cyphertech { max-width:8rem; width:100%; height: auto; object-fit: contain; }
8
  .logo-container .seperator:after{ font-size: 3.5em; content: "|"; color: #fff; font-weight: 500; font-family: auto; }
@@ -21,7 +21,7 @@ CSS_STYLES = """
21
  width: 100%;
22
  height: 100%;
23
  background: linear-gradient(135deg, #001a2d 0%, #002a4d 100%);
24
- z-index: 31474836470 !important;
25
  display: flex;
26
  justify-content: center;
27
  align-items: center;
@@ -232,6 +232,7 @@ CSS_STYLES = """
232
  background-color: #ddd;
233
  color: #333;
234
  }
 
235
  /* Help button styling */
236
  .help-button-container {
237
  position: fixed;
@@ -239,6 +240,7 @@ CSS_STYLES = """
239
  left: 20px;
240
  z-index: 1000;
241
  }
 
242
  .help-button {
243
  background-color: #0071bb !important;
244
  color: white !important;
@@ -254,11 +256,13 @@ CSS_STYLES = """
254
  justify-content: center !important;
255
  transition: all 0.3s ease;
256
  }
 
257
  .help-button:hover {
258
  background-color: #005a94;
259
  transform: scale(1.05);
260
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
261
  }
 
262
  .footer{ width:100%; margin: 10px 0; background-color: initial; color: #fff; text-align: center; font-size: 1rem; font-style=bold; }
263
  .footer a{ color: #fff !important }
264
  .footer {
@@ -268,10 +272,12 @@ CSS_STYLES = """
268
  border-top: 1px solid #2a2a2a;
269
  color: #a0a0a0;
270
  }
 
271
  .footer a {
272
  color: #a0a0a0 !important;
273
  text-decoration: none;
274
  }
 
275
  .footer a:hover {
276
  color: #ffffff !important;
277
  }
@@ -279,10 +285,13 @@ CSS_STYLES = """
279
  .primary-button { background-color: #0071bb !important; }
280
  button.primary { background-color: #0071bb !important; }
281
  .gradio-button.primary { background-color: #0071bb !important; }
 
 
282
  /* Improved slider styling */
283
  .slider_input_container {
284
  --slider-color: #0071bb !important;
285
  }
 
286
  /* Target all slider thumbs */
287
  input[type=range]::-webkit-slider-thumb {
288
  background: #0071bb !important;
@@ -296,23 +305,28 @@ CSS_STYLES = """
296
  background: #0071bb !important;
297
  border-color: #0071bb !important;
298
  }
 
299
  /* Fix for slider track fill */
300
  .gradio-slider .svelte-1cl284s {
301
  background-color: #0071bb !important;
302
  }
 
303
  /* Target Gradio's slider elements more specifically */
304
  .gradio-slider [data-testid="slider-handle"] {
305
  background-color: #0071bb !important;
306
  }
 
307
  .gradio-slider [data-testid="slider-track-filled"],
308
  .gradio-slider .track-fill,
309
  .gradio-slider .track-progress {
310
  background-color: #0071bb !important;
311
  }
 
312
  /* Target the slider track */
313
  .gradio-slider [data-testid="slider-track"] {
314
  background-color: #ddd !important;
315
  }
 
316
  /* Target any element with slider-related class names */
317
  div[class*="slider"] div[class*="filled"],
318
  div[class*="slider"] div[class*="progress"],
@@ -320,19 +334,24 @@ CSS_STYLES = """
320
  div[class*="slider"] div[class*="track-progress"] {
321
  background-color: #0071bb !important;
322
  }
 
323
  /* Change focus outline color */
324
  *:focus-visible { outline-color: #0071bb !important; }
 
325
  /* Change checkbox and radio button colors */
326
  input[type="checkbox"]:checked, input[type="radio"]:checked {
327
  background-color: #0071bb !important;
328
  border-color: #0071bb !important;
329
  }
 
330
  /* Change progress bar color */
331
  progress::-webkit-progress-value { background-color: #0071bb !important; }
332
  progress::-moz-progress-bar { background-color: #0071bb !important; }
333
  progress { color: #0071bb !important; }
 
334
  /* Change link color */
335
  a { color: #0071bb !important; }
 
336
  /* Change selection color */
337
  ::selection { background-color: #0071bb33 !important; }
338
  @media(max-width: 500px){
@@ -343,18 +362,22 @@ CSS_STYLES = """
343
  #huggingface-space-header{
344
  display: none !important;
345
  }
 
346
  /* Scrollbar styling for welcome dialog */
347
  #welcome-banner-text > div:nth-child(2)::-webkit-scrollbar {
348
  width: 8px;
349
  }
 
350
  #welcome-banner-text > div:nth-child(2)::-webkit-scrollbar-track {
351
  background: rgba(255,255,255,0.1);
352
  border-radius: 4px;
353
  }
 
354
  #welcome-banner-text > div:nth-child(2)::-webkit-scrollbar-thumb {
355
  background: rgba(255,255,255,0.3);
356
  border-radius: 4px;
357
  }
 
358
  #welcome-banner-text > div:nth-child(2)::-webkit-scrollbar-thumb:hover {
359
  background: rgba(255,255,255,0.5);
360
  }
 
2
  import os
3
  # Define the CSS once to avoid duplication (rest of CSS remains the same)
4
  CSS_STYLES = """
5
+ .gradio-container footer { display: none !important; }
6
  .logo-container{ display: inline-flex; justify-content: center; align-items: center; column-gap: 12px;}
7
  .logo-container .cyphertech { max-width:8rem; width:100%; height: auto; object-fit: contain; }
8
  .logo-container .seperator:after{ font-size: 3.5em; content: "|"; color: #fff; font-weight: 500; font-family: auto; }
 
21
  width: 100%;
22
  height: 100%;
23
  background: linear-gradient(135deg, #001a2d 0%, #002a4d 100%);
24
+ z-index: 3147483647;
25
  display: flex;
26
  justify-content: center;
27
  align-items: center;
 
232
  background-color: #ddd;
233
  color: #333;
234
  }
235
+
236
  /* Help button styling */
237
  .help-button-container {
238
  position: fixed;
 
240
  left: 20px;
241
  z-index: 1000;
242
  }
243
+
244
  .help-button {
245
  background-color: #0071bb !important;
246
  color: white !important;
 
256
  justify-content: center !important;
257
  transition: all 0.3s ease;
258
  }
259
+
260
  .help-button:hover {
261
  background-color: #005a94;
262
  transform: scale(1.05);
263
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
264
  }
265
+
266
  .footer{ width:100%; margin: 10px 0; background-color: initial; color: #fff; text-align: center; font-size: 1rem; font-style=bold; }
267
  .footer a{ color: #fff !important }
268
  .footer {
 
272
  border-top: 1px solid #2a2a2a;
273
  color: #a0a0a0;
274
  }
275
+
276
  .footer a {
277
  color: #a0a0a0 !important;
278
  text-decoration: none;
279
  }
280
+
281
  .footer a:hover {
282
  color: #ffffff !important;
283
  }
 
285
  .primary-button { background-color: #0071bb !important; }
286
  button.primary { background-color: #0071bb !important; }
287
  .gradio-button.primary { background-color: #0071bb !important; }
288
+
289
+
290
  /* Improved slider styling */
291
  .slider_input_container {
292
  --slider-color: #0071bb !important;
293
  }
294
+
295
  /* Target all slider thumbs */
296
  input[type=range]::-webkit-slider-thumb {
297
  background: #0071bb !important;
 
305
  background: #0071bb !important;
306
  border-color: #0071bb !important;
307
  }
308
+
309
  /* Fix for slider track fill */
310
  .gradio-slider .svelte-1cl284s {
311
  background-color: #0071bb !important;
312
  }
313
+
314
  /* Target Gradio's slider elements more specifically */
315
  .gradio-slider [data-testid="slider-handle"] {
316
  background-color: #0071bb !important;
317
  }
318
+
319
  .gradio-slider [data-testid="slider-track-filled"],
320
  .gradio-slider .track-fill,
321
  .gradio-slider .track-progress {
322
  background-color: #0071bb !important;
323
  }
324
+
325
  /* Target the slider track */
326
  .gradio-slider [data-testid="slider-track"] {
327
  background-color: #ddd !important;
328
  }
329
+
330
  /* Target any element with slider-related class names */
331
  div[class*="slider"] div[class*="filled"],
332
  div[class*="slider"] div[class*="progress"],
 
334
  div[class*="slider"] div[class*="track-progress"] {
335
  background-color: #0071bb !important;
336
  }
337
+
338
  /* Change focus outline color */
339
  *:focus-visible { outline-color: #0071bb !important; }
340
+
341
  /* Change checkbox and radio button colors */
342
  input[type="checkbox"]:checked, input[type="radio"]:checked {
343
  background-color: #0071bb !important;
344
  border-color: #0071bb !important;
345
  }
346
+
347
  /* Change progress bar color */
348
  progress::-webkit-progress-value { background-color: #0071bb !important; }
349
  progress::-moz-progress-bar { background-color: #0071bb !important; }
350
  progress { color: #0071bb !important; }
351
+
352
  /* Change link color */
353
  a { color: #0071bb !important; }
354
+
355
  /* Change selection color */
356
  ::selection { background-color: #0071bb33 !important; }
357
  @media(max-width: 500px){
 
362
  #huggingface-space-header{
363
  display: none !important;
364
  }
365
+
366
  /* Scrollbar styling for welcome dialog */
367
  #welcome-banner-text > div:nth-child(2)::-webkit-scrollbar {
368
  width: 8px;
369
  }
370
+
371
  #welcome-banner-text > div:nth-child(2)::-webkit-scrollbar-track {
372
  background: rgba(255,255,255,0.1);
373
  border-radius: 4px;
374
  }
375
+
376
  #welcome-banner-text > div:nth-child(2)::-webkit-scrollbar-thumb {
377
  background: rgba(255,255,255,0.3);
378
  border-radius: 4px;
379
  }
380
+
381
  #welcome-banner-text > div:nth-child(2)::-webkit-scrollbar-thumb:hover {
382
  background: rgba(255,255,255,0.5);
383
  }