Unizomby commited on
Commit
d24ae42
·
verified ·
1 Parent(s): 0676c43

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -29
app.py CHANGED
@@ -20,64 +20,64 @@ def chatbot_response(message):
20
  response = query_engine.query(message)
21
  return str(response)
22
 
23
- # Custom CSS for purple button styling - Only target main action buttons
24
  custom_css = """
25
- /* Target only main action buttons (Submit/Clear) - not example buttons */
26
- button.primary,
27
- .gradio-button.primary,
28
  button.lg.primary,
29
- button.svelte-cmf5ev.primary {
30
  background: linear-gradient(45deg, #8B5CF6, #A855F7) !important;
31
  border: none !important;
32
  color: white !important;
33
  border-radius: 8px !important;
34
  }
35
 
36
- button.primary:hover,
37
- .gradio-button.primary:hover,
38
  button.lg.primary:hover,
39
- button.svelte-cmf5ev.primary:hover {
40
  background: linear-gradient(45deg, #7C3AED, #9333EA) !important;
41
  transform: translateY(-2px) !important;
42
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3) !important;
43
  transition: all 0.2s ease !important;
44
  }
45
 
46
- /* Secondary buttons (like Clear) - keep them distinguishable */
47
- button.secondary,
48
- .gradio-button.secondary,
49
  button.lg.secondary,
50
- button.svelte-cmf5ev.secondary {
51
  background: #E5E7EB !important;
52
  color: #374151 !important;
53
  border: 1px solid #D1D5DB !important;
54
  border-radius: 8px !important;
55
  }
56
 
57
- button.secondary:hover,
58
- .gradio-button.secondary:hover,
59
  button.lg.secondary:hover,
60
- button.svelte-cmf5ev.secondary:hover {
61
  background: #F3F4F6 !important;
62
  color: #374151 !important;
63
  transform: translateY(-1px) !important;
64
  }
65
 
66
- /* Example buttons - ensure they have proper contrast */
67
- .gallery-item,
 
68
  button.gallery-item,
69
- .examples button,
70
- .examples .gallery-item {
71
  background: white !important;
72
  color: #374151 !important;
73
  border: 1px solid #D1D5DB !important;
74
  border-radius: 8px !important;
75
  }
76
 
77
- .gallery-item:hover,
 
78
  button.gallery-item:hover,
79
- .examples button:hover,
80
- .examples .gallery-item:hover {
81
  background: #F9FAFB !important;
82
  color: #374151 !important;
83
  border-color: #9CA3AF !important;
@@ -85,25 +85,29 @@ button.gallery-item:hover,
85
  }
86
 
87
  /* Force text color in example buttons to be dark */
88
- .gallery-item,
89
- .gallery-item *,
 
 
90
  button.gallery-item,
91
  button.gallery-item *,
92
- .examples button,
93
- .examples button * {
94
  color: #374151 !important;
95
  }
96
 
97
- /* Specific targeting for HF Spaces compatibility */
98
  .gradio-container button.primary,
99
- .gradio-container .primary {
 
100
  background: linear-gradient(45deg, #8B5CF6, #A855F7) !important;
101
  border: none !important;
102
  color: white !important;
103
  }
104
 
105
  .gradio-container button.primary:hover,
106
- .gradio-container .primary:hover {
 
107
  background: linear-gradient(45deg, #7C3AED, #9333EA) !important;
108
  }
109
  """
 
20
  response = query_engine.query(message)
21
  return str(response)
22
 
23
+ # Custom CSS for purple button styling - Target Submit button specifically
24
  custom_css = """
25
+ /* Target Submit button with all its classes */
26
+ button.lg.primary.svelte-cmf5ev,
27
+ button.primary.svelte-cmf5ev,
28
  button.lg.primary,
29
+ button.primary {
30
  background: linear-gradient(45deg, #8B5CF6, #A855F7) !important;
31
  border: none !important;
32
  color: white !important;
33
  border-radius: 8px !important;
34
  }
35
 
36
+ button.lg.primary.svelte-cmf5ev:hover,
37
+ button.primary.svelte-cmf5ev:hover,
38
  button.lg.primary:hover,
39
+ button.primary:hover {
40
  background: linear-gradient(45deg, #7C3AED, #9333EA) !important;
41
  transform: translateY(-2px) !important;
42
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3) !important;
43
  transition: all 0.2s ease !important;
44
  }
45
 
46
+ /* Keep Clear button as secondary (gray) */
47
+ button.lg.secondary.svelte-cmf5ev,
48
+ button.secondary.svelte-cmf5ev,
49
  button.lg.secondary,
50
+ button.secondary {
51
  background: #E5E7EB !important;
52
  color: #374151 !important;
53
  border: 1px solid #D1D5DB !important;
54
  border-radius: 8px !important;
55
  }
56
 
57
+ button.lg.secondary.svelte-cmf5ev:hover,
58
+ button.secondary.svelte-cmf5ev:hover,
59
  button.lg.secondary:hover,
60
+ button.secondary:hover {
61
  background: #F3F4F6 !important;
62
  color: #374151 !important;
63
  transform: translateY(-1px) !important;
64
  }
65
 
66
+ /* Example buttons - ensure they stay readable */
67
+ button.gallery-item.svelte-p5q82i,
68
+ .gallery-item.svelte-p5q82i,
69
  button.gallery-item,
70
+ .gallery-item {
 
71
  background: white !important;
72
  color: #374151 !important;
73
  border: 1px solid #D1D5DB !important;
74
  border-radius: 8px !important;
75
  }
76
 
77
+ button.gallery-item.svelte-p5q82i:hover,
78
+ .gallery-item.svelte-p5q82i:hover,
79
  button.gallery-item:hover,
80
+ .gallery-item:hover {
 
81
  background: #F9FAFB !important;
82
  color: #374151 !important;
83
  border-color: #9CA3AF !important;
 
85
  }
86
 
87
  /* Force text color in example buttons to be dark */
88
+ button.gallery-item.svelte-p5q82i,
89
+ button.gallery-item.svelte-p5q82i *,
90
+ .gallery-item.svelte-p5q82i,
91
+ .gallery-item.svelte-p5q82i *,
92
  button.gallery-item,
93
  button.gallery-item *,
94
+ .gallery-item,
95
+ .gallery-item * {
96
  color: #374151 !important;
97
  }
98
 
99
+ /* Additional selectors for HF Spaces compatibility */
100
  .gradio-container button.primary,
101
+ .gradio-container .primary,
102
+ [data-testid="primary-button"] {
103
  background: linear-gradient(45deg, #8B5CF6, #A855F7) !important;
104
  border: none !important;
105
  color: white !important;
106
  }
107
 
108
  .gradio-container button.primary:hover,
109
+ .gradio-container .primary:hover,
110
+ [data-testid="primary-button"]:hover {
111
  background: linear-gradient(45deg, #7C3AED, #9333EA) !important;
112
  }
113
  """