JayBene1 commited on
Commit
edfca26
·
verified ·
1 Parent(s): e55ad38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +106 -20
app.py CHANGED
@@ -8,7 +8,7 @@ from urllib.parse import urlparse
8
  # Hardcoded API endpoint - Updated to correct endpoint
9
  API_ENDPOINT = "https://jaybene1-testapicontacts.hf.space/contacts"
10
 
11
- # Professional color scheme inspired by sale leaseback theme
12
  theme = gr.themes.Soft(
13
  primary_hue="blue",
14
  secondary_hue="slate",
@@ -17,10 +17,15 @@ theme = gr.themes.Soft(
17
  spacing_size="md",
18
  radius_size="md"
19
  ).set(
 
20
  body_background_fill="#1a1a1a",
21
  body_background_fill_dark="#1a1a1a",
 
 
22
  body_text_color="#e5e5e5",
23
  body_text_color_dark="#e5e5e5",
 
 
24
  block_background_fill="#2d2d2d",
25
  block_background_fill_dark="#2d2d2d",
26
  block_border_color="#404040",
@@ -29,14 +34,16 @@ theme = gr.themes.Soft(
29
  block_label_text_color_dark="#e5e5e5",
30
  block_title_text_color="#e5e5e5",
31
  block_title_text_color_dark="#e5e5e5",
 
 
32
  input_background_fill="#2d2d2d",
33
  input_background_fill_dark="#2d2d2d",
34
  input_border_color="#555555",
35
  input_border_color_dark="#555555",
36
- input_text_color="#e5e5e5",
37
- input_text_color_dark="#e5e5e5",
38
  input_placeholder_color="#a0a0a0",
39
  input_placeholder_color_dark="#a0a0a0",
 
 
40
  button_primary_background_fill="#1e40af",
41
  button_primary_background_fill_hover="#2563eb",
42
  button_primary_text_color="#ffffff",
@@ -363,10 +370,30 @@ def create_sample_data():
363
 
364
  # Create the Gradio interface
365
  with gr.Blocks(theme=theme, title="Kwekel Companies Contact Search Tool", css="""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
366
  .gradio-container {
367
  max-width: 1200px !important;
368
  margin: 0 auto !important;
 
 
369
  }
 
 
370
  .header {
371
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
372
  color: white;
@@ -381,9 +408,11 @@ with gr.Blocks(theme=theme, title="Kwekel Companies Contact Search Tool", css=""
381
  font-size: 2.5rem;
382
  font-weight: 700;
383
  margin-bottom: 0.5rem;
384
- color: #ffffff;
385
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
386
  }
 
 
387
  .info-box {
388
  background: #2d2d2d;
389
  border: 1px solid #1e40af;
@@ -393,51 +422,108 @@ with gr.Blocks(theme=theme, title="Kwekel Companies Contact Search Tool", css=""
393
  color: #ffffff;
394
  }
395
  .info-box h3 {
396
- color: #ffffff;
397
  margin-top: 0;
398
  }
399
  .info-box p, .info-box ol, .info-box li {
400
- color: #e5e5e5;
401
  }
 
 
402
  .footer {
403
  text-align: center;
404
  margin-top: 2rem;
405
  padding-top: 2rem;
406
  border-top: 1px solid #404040;
407
- color: #cccccc;
408
  }
409
- body {
410
- background-color: #1a1a1a !important;
 
411
  color: #e5e5e5 !important;
412
  }
413
- .dark {
414
- background-color: #1a1a1a !important;
 
 
 
 
 
 
415
  color: #e5e5e5 !important;
 
 
 
 
 
 
 
 
 
 
416
  }
417
- /* Ensure all text is light colored */
418
- .gradio-container * {
 
419
  color: #e5e5e5 !important;
420
  }
421
- /* Override specific elements that need light text */
422
- .gr-textbox input, .gr-textbox textarea {
 
 
 
 
 
423
  color: #e5e5e5 !important;
424
  background-color: #2d2d2d !important;
425
  }
426
- .gr-markdown {
 
 
427
  color: #e5e5e5 !important;
428
  }
429
- .gr-code {
 
430
  color: #e5e5e5 !important;
 
 
 
 
431
  background-color: #2d2d2d !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
432
  }
433
- label {
 
 
 
 
434
  color: #e5e5e5 !important;
435
  }
436
- .gr-form {
 
 
437
  color: #e5e5e5 !important;
438
  }
439
- .gr-block {
 
 
440
  color: #e5e5e5 !important;
 
 
441
  }
442
  """) as demo:
443
 
 
8
  # Hardcoded API endpoint - Updated to correct endpoint
9
  API_ENDPOINT = "https://jaybene1-testapicontacts.hf.space/contacts"
10
 
11
+ # Professional color scheme inspired by sale leaseback theme - Fixed theme configuration
12
  theme = gr.themes.Soft(
13
  primary_hue="blue",
14
  secondary_hue="slate",
 
17
  spacing_size="md",
18
  radius_size="md"
19
  ).set(
20
+ # Background colors
21
  body_background_fill="#1a1a1a",
22
  body_background_fill_dark="#1a1a1a",
23
+
24
+ # Text colors
25
  body_text_color="#e5e5e5",
26
  body_text_color_dark="#e5e5e5",
27
+
28
+ # Block colors
29
  block_background_fill="#2d2d2d",
30
  block_background_fill_dark="#2d2d2d",
31
  block_border_color="#404040",
 
34
  block_label_text_color_dark="#e5e5e5",
35
  block_title_text_color="#e5e5e5",
36
  block_title_text_color_dark="#e5e5e5",
37
+
38
+ # Input colors (using valid property names)
39
  input_background_fill="#2d2d2d",
40
  input_background_fill_dark="#2d2d2d",
41
  input_border_color="#555555",
42
  input_border_color_dark="#555555",
 
 
43
  input_placeholder_color="#a0a0a0",
44
  input_placeholder_color_dark="#a0a0a0",
45
+
46
+ # Button colors
47
  button_primary_background_fill="#1e40af",
48
  button_primary_background_fill_hover="#2563eb",
49
  button_primary_text_color="#ffffff",
 
370
 
371
  # Create the Gradio interface
372
  with gr.Blocks(theme=theme, title="Kwekel Companies Contact Search Tool", css="""
373
+ /* Root and body styles */
374
+ :root {
375
+ --body-text-color: #e5e5e5 !important;
376
+ --neutral-50: #1a1a1a !important;
377
+ --neutral-100: #2d2d2d !important;
378
+ --neutral-200: #404040 !important;
379
+ --neutral-300: #555555 !important;
380
+ --neutral-400: #6b7280 !important;
381
+ --neutral-500: #9ca3af !important;
382
+ --neutral-600: #d1d5db !important;
383
+ --neutral-700: #e5e7eb !important;
384
+ --neutral-800: #f3f4f6 !important;
385
+ --neutral-900: #ffffff !important;
386
+ --neutral-950: #ffffff !important;
387
+ }
388
+
389
  .gradio-container {
390
  max-width: 1200px !important;
391
  margin: 0 auto !important;
392
+ background-color: #1a1a1a !important;
393
+ color: #e5e5e5 !important;
394
  }
395
+
396
+ /* Header styles */
397
  .header {
398
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
399
  color: white;
 
408
  font-size: 2.5rem;
409
  font-weight: 700;
410
  margin-bottom: 0.5rem;
411
+ color: #ffffff !important;
412
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
413
  }
414
+
415
+ /* Info box styles */
416
  .info-box {
417
  background: #2d2d2d;
418
  border: 1px solid #1e40af;
 
422
  color: #ffffff;
423
  }
424
  .info-box h3 {
425
+ color: #ffffff !important;
426
  margin-top: 0;
427
  }
428
  .info-box p, .info-box ol, .info-box li {
429
+ color: #e5e5e5 !important;
430
  }
431
+
432
+ /* Footer styles */
433
  .footer {
434
  text-align: center;
435
  margin-top: 2rem;
436
  padding-top: 2rem;
437
  border-top: 1px solid #404040;
438
+ color: #cccccc !important;
439
  }
440
+
441
+ /* Global text color overrides */
442
+ body, .gradio-container, .gradio-container * {
443
  color: #e5e5e5 !important;
444
  }
445
+
446
+ /* Input field styles */
447
+ .gr-textbox input,
448
+ .gr-textbox textarea,
449
+ input[type="text"],
450
+ input[type="email"],
451
+ input[type="url"],
452
+ textarea {
453
  color: #e5e5e5 !important;
454
+ background-color: #2d2d2d !important;
455
+ border: 1px solid #555555 !important;
456
+ }
457
+
458
+ /* Input placeholder styles */
459
+ .gr-textbox input::placeholder,
460
+ .gr-textbox textarea::placeholder,
461
+ input::placeholder,
462
+ textarea::placeholder {
463
+ color: #a0a0a0 !important;
464
  }
465
+
466
+ /* Label styles */
467
+ label, .gr-label {
468
  color: #e5e5e5 !important;
469
  }
470
+
471
+ /* Markdown and code styles */
472
+ .gr-markdown, .gr-markdown * {
473
+ color: #e5e5e5 !important;
474
+ }
475
+
476
+ .gr-code, .gr-code * {
477
  color: #e5e5e5 !important;
478
  background-color: #2d2d2d !important;
479
  }
480
+
481
+ /* Form and block styles */
482
+ .gr-form, .gr-form * {
483
  color: #e5e5e5 !important;
484
  }
485
+
486
+ .gr-block, .gr-block * {
487
  color: #e5e5e5 !important;
488
+ }
489
+
490
+ /* Panel and container styles */
491
+ .gr-panel {
492
  background-color: #2d2d2d !important;
493
+ border: 1px solid #404040 !important;
494
+ }
495
+
496
+ .gr-container {
497
+ background-color: #1a1a1a !important;
498
+ }
499
+
500
+ /* Button text visibility */
501
+ .gr-button {
502
+ color: #ffffff !important;
503
+ }
504
+
505
+ /* Ensure info text is visible */
506
+ .gr-info {
507
+ color: #a0a0a0 !important;
508
  }
509
+
510
+ /* Additional specific overrides */
511
+ .gr-textbox-label,
512
+ .gr-markdown-label,
513
+ .gr-code-label {
514
  color: #e5e5e5 !important;
515
  }
516
+
517
+ /* Override any remaining dark text */
518
+ p, span, div, h1, h2, h3, h4, h5, h6, li, td, th {
519
  color: #e5e5e5 !important;
520
  }
521
+
522
+ /* Ensure all text inputs have proper contrast */
523
+ input:focus, textarea:focus {
524
  color: #e5e5e5 !important;
525
+ background-color: #2d2d2d !important;
526
+ border-color: #1e40af !important;
527
  }
528
  """) as demo:
529