PromptMeister commited on
Commit
664f2bb
·
verified ·
1 Parent(s): 0b3b616

Update app.py

Browse files

working on menu items to be visible as css is too dark

Files changed (1) hide show
  1. app.py +175 -7
app.py CHANGED
@@ -49,6 +49,11 @@ ai_snipper_css = """
49
  min-height: 100vh !important;
50
  }
51
 
 
 
 
 
 
52
  /* Header styling */
53
  .gradio-container h1 {
54
  background: var(--gradient-primary) !important;
@@ -62,7 +67,7 @@ ai_snipper_css = """
62
  text-shadow: 0 0 20px rgba(6, 182, 212, 0.3) !important;
63
  }
64
 
65
- .gradio-container h2, .gradio-container h3 {
66
  color: var(--text-primary) !important;
67
  font-weight: 600 !important;
68
  }
@@ -74,6 +79,7 @@ ai_snipper_css = """
74
  border-radius: 16px !important;
75
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1) !important;
76
  backdrop-filter: blur(10px) !important;
 
77
  }
78
 
79
  /* Group styling */
@@ -82,9 +88,10 @@ ai_snipper_css = """
82
  border: 1px solid var(--border-primary) !important;
83
  border-radius: 12px !important;
84
  padding: 1.5rem !important;
 
85
  }
86
 
87
- /* Text inputs */
88
  .gr-textbox textarea, .gr-textbox input {
89
  background: var(--bg-secondary) !important;
90
  border: 1px solid var(--border-primary) !important;
@@ -98,19 +105,32 @@ ai_snipper_css = """
98
  border-color: var(--border-accent) !important;
99
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1) !important;
100
  outline: none !important;
 
101
  }
102
 
103
  .gr-textbox textarea::placeholder, .gr-textbox input::placeholder {
104
  color: var(--text-muted) !important;
 
105
  }
106
 
107
- /* Labels */
108
- .gr-textbox label, .gr-slider label, .gr-radio label, .gr-checkbox label {
109
  color: var(--text-secondary) !important;
110
  font-weight: 500 !important;
111
  margin-bottom: 0.5rem !important;
112
  }
113
 
 
 
 
 
 
 
 
 
 
 
 
114
  /* Buttons */
115
  .gr-button {
116
  background: var(--gradient-button) !important;
@@ -128,11 +148,12 @@ ai_snipper_css = """
128
  transform: translateY(-2px) !important;
129
  box-shadow: 0 10px 20px rgba(6, 182, 212, 0.3) !important;
130
  filter: brightness(1.1) !important;
 
131
  }
132
 
133
  .gr-button.secondary {
134
  background: var(--bg-card) !important;
135
- color: var(--text-secondary) !important;
136
  border: 1px solid var(--border-primary) !important;
137
  }
138
 
@@ -142,7 +163,7 @@ ai_snipper_css = """
142
  color: var(--text-primary) !important;
143
  }
144
 
145
- /* Tabs */
146
  .gr-tab-nav {
147
  background: var(--gradient-card) !important;
148
  border-radius: 12px !important;
@@ -166,27 +187,174 @@ ai_snipper_css = """
166
  box-shadow: 0 2px 4px rgba(6, 182, 212, 0.3) !important;
167
  }
168
 
169
- /* Other elements */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  .gr-audio, .gr-file-upload {
171
  background: var(--gradient-card) !important;
172
  border: 1px solid var(--border-primary) !important;
173
  border-radius: 12px !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  }
175
 
176
  .gr-slider input[type="range"]::-webkit-slider-thumb {
177
  background: var(--gradient-button) !important;
178
  border: none !important;
179
  border-radius: 50% !important;
 
180
  }
181
 
 
182
  .gr-radio input[type="radio"], .gr-checkbox input[type="checkbox"] {
183
  accent-color: var(--ai-cyan) !important;
184
  }
185
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  /* Footer hiding */
187
  footer {
188
  visibility: hidden !important;
189
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  """
191
 
192
  # Global variables to store models
 
49
  min-height: 100vh !important;
50
  }
51
 
52
+ /* Force text visibility */
53
+ .gradio-container * {
54
+ color: inherit !important;
55
+ }
56
+
57
  /* Header styling */
58
  .gradio-container h1 {
59
  background: var(--gradient-primary) !important;
 
67
  text-shadow: 0 0 20px rgba(6, 182, 212, 0.3) !important;
68
  }
69
 
70
+ .gradio-container h2, .gradio-container h3, .gradio-container h4, .gradio-container h5, .gradio-container h6 {
71
  color: var(--text-primary) !important;
72
  font-weight: 600 !important;
73
  }
 
79
  border-radius: 16px !important;
80
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1) !important;
81
  backdrop-filter: blur(10px) !important;
82
+ color: var(--text-primary) !important;
83
  }
84
 
85
  /* Group styling */
 
88
  border: 1px solid var(--border-primary) !important;
89
  border-radius: 12px !important;
90
  padding: 1.5rem !important;
91
+ color: var(--text-primary) !important;
92
  }
93
 
94
+ /* Text inputs - FIXED */
95
  .gr-textbox textarea, .gr-textbox input {
96
  background: var(--bg-secondary) !important;
97
  border: 1px solid var(--border-primary) !important;
 
105
  border-color: var(--border-accent) !important;
106
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1) !important;
107
  outline: none !important;
108
+ color: var(--text-primary) !important;
109
  }
110
 
111
  .gr-textbox textarea::placeholder, .gr-textbox input::placeholder {
112
  color: var(--text-muted) !important;
113
+ opacity: 0.8 !important;
114
  }
115
 
116
+ /* Labels - FIXED */
117
+ .gr-textbox label, .gr-slider label, .gr-radio label, .gr-checkbox label, label {
118
  color: var(--text-secondary) !important;
119
  font-weight: 500 !important;
120
  margin-bottom: 0.5rem !important;
121
  }
122
 
123
+ /* All text elements */
124
+ p, span, div:not(.gr-button), .gr-markdown {
125
+ color: var(--text-secondary) !important;
126
+ }
127
+
128
+ /* Strong contrast for important text */
129
+ .gr-textbox label, .gr-form label {
130
+ color: var(--text-primary) !important;
131
+ font-weight: 600 !important;
132
+ }
133
+
134
  /* Buttons */
135
  .gr-button {
136
  background: var(--gradient-button) !important;
 
148
  transform: translateY(-2px) !important;
149
  box-shadow: 0 10px 20px rgba(6, 182, 212, 0.3) !important;
150
  filter: brightness(1.1) !important;
151
+ color: var(--text-primary) !important;
152
  }
153
 
154
  .gr-button.secondary {
155
  background: var(--bg-card) !important;
156
+ color: var(--text-primary) !important;
157
  border: 1px solid var(--border-primary) !important;
158
  }
159
 
 
163
  color: var(--text-primary) !important;
164
  }
165
 
166
+ /* Tabs - FIXED */
167
  .gr-tab-nav {
168
  background: var(--gradient-card) !important;
169
  border-radius: 12px !important;
 
187
  box-shadow: 0 2px 4px rgba(6, 182, 212, 0.3) !important;
188
  }
189
 
190
+ .gr-tab-nav button:hover:not(.selected) {
191
+ background: var(--bg-card-hover) !important;
192
+ color: var(--text-primary) !important;
193
+ }
194
+
195
+ /* Tab content */
196
+ .gr-tabitem {
197
+ background: var(--gradient-card) !important;
198
+ border: 1px solid var(--border-primary) !important;
199
+ border-radius: 12px !important;
200
+ padding: 1.5rem !important;
201
+ margin-top: 1rem !important;
202
+ color: var(--text-primary) !important;
203
+ }
204
+
205
+ /* Audio and file upload */
206
  .gr-audio, .gr-file-upload {
207
  background: var(--gradient-card) !important;
208
  border: 1px solid var(--border-primary) !important;
209
  border-radius: 12px !important;
210
+ color: var(--text-secondary) !important;
211
+ }
212
+
213
+ .gr-file-upload {
214
+ border: 2px dashed var(--border-accent) !important;
215
+ }
216
+
217
+ /* Sliders */
218
+ .gr-slider input[type="range"] {
219
+ background: var(--bg-secondary) !important;
220
+ }
221
+
222
+ .gr-slider input[type="range"]::-webkit-slider-track {
223
+ background: var(--bg-secondary) !important;
224
+ border-radius: 6px !important;
225
  }
226
 
227
  .gr-slider input[type="range"]::-webkit-slider-thumb {
228
  background: var(--gradient-button) !important;
229
  border: none !important;
230
  border-radius: 50% !important;
231
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
232
  }
233
 
234
+ /* Radio buttons and checkboxes */
235
  .gr-radio input[type="radio"], .gr-checkbox input[type="checkbox"] {
236
  accent-color: var(--ai-cyan) !important;
237
  }
238
 
239
+ .gr-radio .wrap, .gr-checkbox .wrap {
240
+ color: var(--text-secondary) !important;
241
+ }
242
+
243
+ /* Accordion */
244
+ .gr-accordion {
245
+ background: var(--gradient-card) !important;
246
+ border: 1px solid var(--border-primary) !important;
247
+ border-radius: 12px !important;
248
+ }
249
+
250
+ .gr-accordion summary {
251
+ background: var(--bg-card) !important;
252
+ color: var(--text-primary) !important;
253
+ padding: 1rem !important;
254
+ border-radius: 12px !important;
255
+ cursor: pointer !important;
256
+ font-weight: 600 !important;
257
+ }
258
+
259
+ .gr-accordion[open] summary {
260
+ border-bottom: 1px solid var(--border-primary) !important;
261
+ border-radius: 12px 12px 0 0 !important;
262
+ }
263
+
264
+ /* JSON and HTML output */
265
+ .gr-json, .gr-html {
266
+ background: var(--gradient-card) !important;
267
+ border: 1px solid var(--border-primary) !important;
268
+ border-radius: 12px !important;
269
+ color: var(--text-primary) !important;
270
+ padding: 1rem !important;
271
+ }
272
+
273
+ /* Plot containers */
274
+ .gr-plot {
275
+ background: var(--gradient-card) !important;
276
+ border: 1px solid var(--border-primary) !important;
277
+ border-radius: 12px !important;
278
+ padding: 1rem !important;
279
+ }
280
+
281
+ /* Progress bars */
282
+ .gr-progress {
283
+ background: var(--bg-secondary) !important;
284
+ border-radius: 6px !important;
285
+ }
286
+
287
+ .gr-progress-bar {
288
+ background: var(--gradient-button) !important;
289
+ border-radius: 6px !important;
290
+ }
291
+
292
+ /* Markdown content */
293
+ .gr-markdown, .gr-markdown * {
294
+ color: var(--text-secondary) !important;
295
+ }
296
+
297
+ .gr-markdown h1, .gr-markdown h2, .gr-markdown h3, .gr-markdown h4, .gr-markdown h5, .gr-markdown h6 {
298
+ color: var(--text-primary) !important;
299
+ font-weight: 600 !important;
300
+ }
301
+
302
  /* Footer hiding */
303
  footer {
304
  visibility: hidden !important;
305
  }
306
+
307
+ /* Scrollbars */
308
+ ::-webkit-scrollbar {
309
+ width: 8px;
310
+ height: 8px;
311
+ }
312
+
313
+ ::-webkit-scrollbar-track {
314
+ background: var(--bg-secondary);
315
+ border-radius: 4px;
316
+ }
317
+
318
+ ::-webkit-scrollbar-thumb {
319
+ background: var(--gradient-button);
320
+ border-radius: 4px;
321
+ }
322
+
323
+ ::-webkit-scrollbar-thumb:hover {
324
+ background: var(--ai-cyan);
325
+ }
326
+
327
+ /* Specific fixes for form elements */
328
+ .gr-form .gr-box, .gr-form .gr-group {
329
+ color: var(--text-primary) !important;
330
+ }
331
+
332
+ /* Ensure all children inherit proper colors */
333
+ .gr-form *, .gr-group *, .gr-box * {
334
+ color: inherit !important;
335
+ }
336
+
337
+ /* Additional text visibility fixes */
338
+ .block.svelte-1t38q2d {
339
+ color: var(--text-primary) !important;
340
+ }
341
+
342
+ /* Mobile responsiveness */
343
+ @media (max-width: 768px) {
344
+ .gradio-container h1 {
345
+ font-size: 2rem !important;
346
+ }
347
+
348
+ .gr-button {
349
+ width: 100% !important;
350
+ justify-content: center !important;
351
+ }
352
+
353
+ .gr-row {
354
+ flex-direction: column !important;
355
+ }
356
+ }
357
+ """
358
  """
359
 
360
  # Global variables to store models