GuglielmoTor commited on
Commit
1d767c3
·
verified ·
1 Parent(s): 52e5c4d

Create config.py

Browse files
Files changed (1) hide show
  1. ui/config.py +269 -0
ui/config.py ADDED
@@ -0,0 +1,269 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ # Custom CSS for enhanced UI
3
+ custom_css = """
4
+ /* Global App Styling */
5
+ .gradio-container {
6
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
7
+ min-height: 100vh;
8
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
9
+ }
10
+
11
+ /* Main content area */
12
+ .main > .wrap {
13
+ background: rgba(255, 255, 255, 0.05) !important;
14
+ backdrop-filter: blur(20px) !important;
15
+ border: 1px solid rgba(255, 255, 255, 0.1) !important;
16
+ border-radius: 20px !important;
17
+ box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
18
+ margin: 20px !important;
19
+ padding: 30px !important;
20
+ }
21
+
22
+ /* Title Styling */
23
+ .main-title {
24
+ background: linear-gradient(135deg, #667eea, #764ba2, #f093fb) !important;
25
+ -webkit-background-clip: text !important;
26
+ -webkit-text-fill-color: transparent !important;
27
+ background-clip: text !important;
28
+ font-size: 3rem !important;
29
+ font-weight: 800 !important;
30
+ text-align: center !important;
31
+ margin: 0 0 30px 0 !important;
32
+ text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
33
+ letter-spacing: -0.02em !important;
34
+ }
35
+
36
+ /* Subtitle styling */
37
+ .main-subtitle {
38
+ color: rgba(255, 255, 255, 0.8) !important;
39
+ text-align: center !important;
40
+ font-size: 1.2rem !important;
41
+ font-weight: 400 !important;
42
+ margin-bottom: 40px !important;
43
+ opacity: 0.9 !important;
44
+ }
45
+
46
+ /* Tab container styling */
47
+ .tab-nav > .tab-nav-item {
48
+ background: rgba(255, 255, 255, 0.1) !important;
49
+ border: 1px solid rgba(255, 255, 255, 0.2) !important;
50
+ border-radius: 15px !important;
51
+ margin-right: 8px !important;
52
+ padding: 12px 24px !important;
53
+ color: rgba(255, 255, 255, 0.8) !important;
54
+ font-weight: 600 !important;
55
+ transition: all 0.3s ease !important;
56
+ backdrop-filter: blur(10px) !important;
57
+ font-size: 1rem !important;
58
+ }
59
+
60
+ .tab-nav > .tab-nav-item:hover {
61
+ background: rgba(255, 255, 255, 0.2) !important;
62
+ transform: translateY(-2px) !important;
63
+ box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
64
+ }
65
+
66
+ .tab-nav > .tab-nav-item.selected {
67
+ background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.2)) !important;
68
+ color: white !important;
69
+ border-color: rgba(255, 255, 255, 0.4) !important;
70
+ box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
71
+ transform: translateY(-2px) !important;
72
+ }
73
+
74
+ /* Tab content area */
75
+ .tabitem {
76
+ background: rgba(255, 255, 255, 0.02) !important;
77
+ border-radius: 20px !important;
78
+ padding: 30px !important;
79
+ margin-top: 20px !important;
80
+ border: 1px solid rgba(255, 255, 255, 0.1) !important;
81
+ backdrop-filter: blur(10px) !important;
82
+ }
83
+
84
+ /* Form elements styling */
85
+ .gradio-textbox, .gradio-dropdown, .gradio-slider {
86
+ background: rgba(255, 255, 255, 0.1) !important;
87
+ border: 1px solid rgba(255, 255, 255, 0.2) !important;
88
+ border-radius: 12px !important;
89
+ color: white !important;
90
+ backdrop-filter: blur(10px) !important;
91
+ }
92
+
93
+ .gradio-textbox input, .gradio-dropdown select {
94
+ background: transparent !important;
95
+ color: white !important;
96
+ border: none !important;
97
+ }
98
+
99
+ .gradio-textbox input::placeholder {
100
+ color: rgba(255, 255, 255, 0.5) !important;
101
+ }
102
+
103
+ /* Button styling */
104
+ button {
105
+ background: linear-gradient(135deg, #667eea, #764ba2) !important;
106
+ border: none !important;
107
+ border-radius: 12px !important;
108
+ color: white !important;
109
+ font-weight: 600 !important;
110
+ padding: 12px 24px !important;
111
+ transition: all 0.3s ease !important;
112
+ box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
113
+ }
114
+
115
+ button:hover {
116
+ transform: translateY(-2px) !important;
117
+ box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4) !important;
118
+ }
119
+
120
+ /* Status box styling */
121
+ .gradio-textbox.status-box {
122
+ background: rgba(255, 107, 107, 0.1) !important;
123
+ border-color: rgba(255, 107, 107, 0.3) !important;
124
+ }
125
+
126
+ /* Plot containers */
127
+ .plot-container {
128
+ background: rgba(255, 255, 255, 0.05) !important;
129
+ border-radius: 15px !important;
130
+ padding: 20px !important;
131
+ margin: 15px 0 !important;
132
+ border: 1px solid rgba(255, 255, 255, 0.1) !important;
133
+ backdrop-filter: blur(10px) !important;
134
+ }
135
+
136
+ /* Card-like components */
137
+ .info-card {
138
+ background: rgba(255, 255, 255, 0.08) !important;
139
+ border-radius: 16px !important;
140
+ padding: 24px !important;
141
+ margin: 16px 0 !important;
142
+ border: 1px solid rgba(255, 255, 255, 0.12) !important;
143
+ backdrop-filter: blur(15px) !important;
144
+ box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1) !important;
145
+ }
146
+
147
+ /* Markdown content styling */
148
+ .prose {
149
+ color: rgba(255, 255, 255, 0.9) !important;
150
+ }
151
+
152
+ .prose h1, .prose h2, .prose h3 {
153
+ color: white !important;
154
+ font-weight: 700 !important;
155
+ }
156
+
157
+ .prose p {
158
+ color: rgba(255, 255, 255, 0.8) !important;
159
+ line-height: 1.6 !important;
160
+ }
161
+
162
+ /* Loading states */
163
+ .loading {
164
+ background: linear-gradient(90deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.1) 100%) !important;
165
+ background-size: 200% 100% !important;
166
+ animation: loading 1.5s infinite !important;
167
+ }
168
+
169
+ @keyframes loading {
170
+ 0% { background-position: 200% 0; }
171
+ 100% { background-position: -200% 0; }
172
+ }
173
+
174
+ /* Responsive design */
175
+ @media (max-width: 768px) {
176
+ .main-title {
177
+ font-size: 2rem !important;
178
+ }
179
+
180
+ .tab-nav > .tab-nav-item {
181
+ padding: 8px 16px !important;
182
+ font-size: 0.9rem !important;
183
+ }
184
+
185
+ .main > .wrap {
186
+ margin: 10px !important;
187
+ padding: 20px !important;
188
+ }
189
+ }
190
+
191
+ /* Floating action elements */
192
+ .floating-element {
193
+ position: relative !important;
194
+ z-index: 10 !important;
195
+ }
196
+
197
+ .floating-element::before {
198
+ content: '' !important;
199
+ position: absolute !important;
200
+ top: -2px !important;
201
+ left: -2px !important;
202
+ right: -2px !important;
203
+ bottom: -2px !important;
204
+ background: linear-gradient(45deg, #667eea, #764ba2, #f093fb) !important;
205
+ border-radius: inherit !important;
206
+ z-index: -1 !important;
207
+ opacity: 0 !important;
208
+ transition: opacity 0.3s ease !important;
209
+ }
210
+
211
+ .floating-element:hover::before {
212
+ opacity: 1 !important;
213
+ }
214
+
215
+ /* Enhanced home tab cards */
216
+ .home-card {
217
+ background: rgba(255, 255, 255, 0.1) !important;
218
+ border: 1px solid rgba(255, 255, 255, 0.2) !important;
219
+ border-radius: 20px !important;
220
+ padding: 30px !important;
221
+ margin: 15px !important;
222
+ backdrop-filter: blur(15px) !important;
223
+ transition: all 0.3s ease !important;
224
+ cursor: pointer !important;
225
+ }
226
+
227
+ .home-card:hover {
228
+ transform: translateY(-5px) !important;
229
+ box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2) !important;
230
+ background: rgba(255, 255, 255, 0.15) !important;
231
+ }
232
+
233
+ .home-card-icon {
234
+ font-size: 3rem !important;
235
+ margin-bottom: 20px !important;
236
+ display: block !important;
237
+ text-align: center !important;
238
+ }
239
+
240
+ .home-card-title {
241
+ font-size: 1.5rem !important;
242
+ font-weight: 700 !important;
243
+ color: white !important;
244
+ margin-bottom: 10px !important;
245
+ text-align: center !important;
246
+ }
247
+
248
+ .home-card-description {
249
+ color: rgba(255, 255, 255, 0.7) !important;
250
+ text-align: center !important;
251
+ line-height: 1.5 !important;
252
+ }
253
+ """
254
+
255
+ # Custom theme with enhanced colors
256
+ custom_theme = gr.themes.Soft(
257
+ primary_hue="blue",
258
+ secondary_hue="purple",
259
+ neutral_hue="slate"
260
+ ).set(
261
+ body_background_fill="*primary_50",
262
+ body_background_fill_dark="*primary_900",
263
+ button_primary_background_fill="linear-gradient(135deg, *primary_500, *secondary_600)",
264
+ button_primary_background_fill_hover="linear-gradient(135deg, *primary_600, *secondary_700)",
265
+ block_background_fill="rgba(255, 255, 255, 0.05)",
266
+ block_border_color="rgba(255, 255, 255, 0.1)",
267
+ input_background_fill="rgba(255, 255, 255, 0.1)",
268
+ input_border_color="rgba(255, 255, 255, 0.2)"
269
+ )