petter2025 commited on
Commit
f869101
·
verified ·
1 Parent(s): cc6b2b9

Update ui/styles.py

Browse files
Files changed (1) hide show
  1. ui/styles.py +153 -90
ui/styles.py CHANGED
@@ -1,126 +1,189 @@
1
  """
2
- CSS styles and themes - FIXED VERSION
3
  """
4
 
5
- # IMPORT gradio at the top of the file
6
- import gradio as gr
7
-
8
  CUSTOM_CSS = """
9
- /* Main container */
10
  .gradio-container {
11
- max-width: 1400px !important;
12
- margin: 0 auto !important;
13
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
14
- }
15
-
16
- /* Headers */
17
- h1, h2, h3, h4 {
18
- color: #1a365d !important;
19
- font-weight: 600 !important;
20
  }
21
 
 
22
  h1 {
23
- background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
24
  -webkit-background-clip: text;
25
  -webkit-text-fill-color: transparent;
26
  background-clip: text;
27
- margin-bottom: 10px !important;
 
 
 
28
  }
29
 
30
- /* Buttons */
31
- button.primary {
32
- background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
33
- color: white !important;
34
- border: none !important;
35
  font-weight: 600 !important;
36
- padding: 12px 24px !important;
37
- border-radius: 8px !important;
38
  }
39
 
40
- button.secondary {
41
- background: linear-gradient(90deg, #4ECDC4 0%, #44A08D 100%) !important;
42
- color: white !important;
43
- border: none !important;
 
 
 
 
 
44
  font-weight: 600 !important;
45
- padding: 12px 24px !important;
46
- border-radius: 8px !important;
 
 
 
 
 
 
 
 
 
 
 
47
  }
48
 
49
- /* JSON displays */
50
- .gr-json {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  border: 1px solid #e2e8f0 !important;
52
- border-radius: 8px !important;
53
- padding: 15px !important;
54
- background: #f8fafc !important;
55
- font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
56
- font-size: 13px !important;
 
 
57
  }
58
 
59
- /* Custom classes */
60
- .critical-metric {
61
- background: linear-gradient(135deg, rgba(255,107,107,0.1) 0%, rgba(255,107,107,0.2) 100%) !important;
62
- border-left: 4px solid #FF6B6B !important;
63
  padding: 15px !important;
 
 
 
 
 
 
 
 
64
  border-radius: 8px !important;
65
- margin: 10px 0 !important;
66
- font-weight: bold !important;
67
  }
68
 
69
- .success-metric {
70
- background: linear-gradient(135deg, rgba(78,205,196,0.1) 0%, rgba(78,205,196,0.2) 100%) !important;
71
- border-left: 4px solid #4ECDC4 !important;
72
- padding: 15px !important;
 
 
 
 
 
 
 
 
 
 
 
73
  border-radius: 8px !important;
74
- margin: 10px 0 !important;
75
- font-weight: bold !important;
76
  }
77
 
78
- .roi-highlight {
79
- font-size: 2.5em !important;
80
- font-weight: 900 !important;
81
- background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
82
- -webkit-background-clip: text !important;
83
- -webkit-text-fill-color: transparent !important;
84
- background-clip: text !important;
85
- text-align: center !important;
86
- margin: 20px 0 !important;
87
  }
88
 
89
- .presenter-guidance {
90
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
91
  color: white !important;
92
- padding: 20px !important;
93
- border-radius: 10px !important;
94
- margin: 15px 0 !important;
95
- border-left: 5px solid #4ECDC4 !important;
96
  }
97
 
98
- /* Footer */
99
- .footer {
100
- margin-top: 40px !important;
101
- padding-top: 20px !important;
102
- border-top: 1px solid #e2e8f0 !important;
103
- color: #718096 !important;
104
- font-size: 14px !important;
105
  }
106
- """
107
 
108
- # Now gr is defined, so this won't cause an error
109
- THEME = gr.themes.Soft(
110
- primary_hue="purple",
111
- secondary_hue="teal",
112
- neutral_hue="gray",
113
- font=["-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "sans-serif"]
114
- ).set(
115
- button_primary_background_fill="linear-gradient(90deg, #667eea 0%, #764ba2 100%)",
116
- button_primary_background_fill_hover="linear-gradient(90deg, #764ba2 0%, #667eea 100%)",
117
- button_primary_text_color="white",
118
- button_primary_border_color="#667eea",
119
- button_secondary_background_fill="linear-gradient(90deg, #4ECDC4 0%, #44A08D 100%)",
120
- button_secondary_background_fill_hover="linear-gradient(90deg, #44A08D 0%, #4ECDC4 100%)",
121
- button_secondary_text_color="white",
122
- background_fill_primary="#f8fafc",
123
- background_fill_secondary="#ffffff",
124
- border_color_primary="#e2e8f0",
125
- border_color_secondary="#cbd5e0"
126
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  """
2
+ CSS styles for the demo
3
  """
4
 
 
 
 
5
  CUSTOM_CSS = """
 
6
  .gradio-container {
7
+ max-width: 1800px !important;
8
+ margin: auto !important;
9
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
 
 
 
 
 
 
10
  }
11
 
12
+ /* Header styles */
13
  h1 {
14
+ background: linear-gradient(90deg, #1a365d 0%, #2d3748 100%);
15
  -webkit-background-clip: text;
16
  -webkit-text-fill-color: transparent;
17
  background-clip: text;
18
+ font-weight: 800 !important;
19
+ font-size: 2.5rem !important;
20
+ margin-bottom: 0.5rem !important;
21
+ line-height: 1.2 !important;
22
  }
23
 
24
+ h2 {
25
+ color: #4a5568 !important;
 
 
 
26
  font-weight: 600 !important;
27
+ font-size: 1.5rem !important;
28
+ margin-bottom: 1rem !important;
29
  }
30
 
31
+ h3 {
32
+ color: #2d3748 !important;
33
+ font-weight: 700 !important;
34
+ font-size: 1.25rem !important;
35
+ margin-bottom: 0.75rem !important;
36
+ }
37
+
38
+ h4 {
39
+ color: #4a5568 !important;
40
  font-weight: 600 !important;
41
+ font-size: 1.1rem !important;
42
+ margin-bottom: 0.5rem !important;
43
+ }
44
+
45
+ /* Status indicators */
46
+ .critical {
47
+ color: #FF6B6B !important;
48
+ font-weight: 700 !important;
49
+ }
50
+
51
+ .warning {
52
+ color: #FFA726 !important;
53
+ font-weight: 700 !important;
54
  }
55
 
56
+ .success {
57
+ color: #4ECDC4 !important;
58
+ font-weight: 700 !important;
59
+ }
60
+
61
+ .info {
62
+ color: #42A5F5 !important;
63
+ font-weight: 700 !important;
64
+ }
65
+
66
+ /* Cards and containers */
67
+ .metric-card {
68
+ background: white !important;
69
+ border-radius: 12px !important;
70
+ padding: 20px !important;
71
+ box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
72
  border: 1px solid #e2e8f0 !important;
73
+ margin-bottom: 15px !important;
74
+ transition: transform 0.2s ease, box-shadow 0.2s ease;
75
+ }
76
+
77
+ .metric-card:hover {
78
+ transform: translateY(-2px);
79
+ box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
80
  }
81
 
82
+ /* Plot containers */
83
+ .plot-container {
84
+ background: white !important;
85
+ border-radius: 12px !important;
86
  padding: 15px !important;
87
+ box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
88
+ border: 1px solid #e2e8f0 !important;
89
+ margin-bottom: 20px !important;
90
+ }
91
+
92
+ /* Data tables */
93
+ .dataframe {
94
+ background: white !important;
95
  border-radius: 8px !important;
96
+ border: 1px solid #e2e8f0 !important;
 
97
  }
98
 
99
+ .dataframe th {
100
+ background: #f8fafc !important;
101
+ color: #4a5568 !important;
102
+ font-weight: 600 !important;
103
+ padding: 12px !important;
104
+ border-bottom: 2px solid #e2e8f0 !important;
105
+ }
106
+
107
+ .dataframe td {
108
+ padding: 10px 12px !important;
109
+ border-bottom: 1px solid #e2e8f0 !important;
110
+ }
111
+
112
+ /* Buttons */
113
+ button {
114
  border-radius: 8px !important;
115
+ font-weight: 600 !important;
116
+ transition: all 0.2s ease !important;
117
  }
118
 
119
+ button:hover {
120
+ transform: translateY(-1px);
121
+ box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
 
 
 
 
 
 
122
  }
123
 
124
+ button.primary {
125
+ background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%) !important;
126
  color: white !important;
127
+ border: none !important;
 
 
 
128
  }
129
 
130
+ button.secondary {
131
+ background: white !important;
132
+ color: #4a5568 !important;
133
+ border: 1px solid #e2e8f0 !important;
 
 
 
134
  }
 
135
 
136
+ button.secondary:hover {
137
+ background: #f8fafc !important;
138
+ border-color: #cbd5e0 !important;
139
+ }
140
+
141
+ button.stop {
142
+ background: linear-gradient(135deg, #FF6B6B 0%, #C53030 100%) !important;
143
+ color: white !important;
144
+ border: none !important;
145
+ }
146
+
147
+ /* Inputs and controls */
148
+ input, textarea, select {
149
+ border-radius: 8px !important;
150
+ border: 1px solid #e2e8f0 !important;
151
+ padding: 10px 12px !important;
152
+ background: white !important;
153
+ }
154
+
155
+ input:focus, textarea:focus, select:focus {
156
+ border-color: #4ECDC4 !important;
157
+ box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1) !important;
158
+ outline: none !important;
159
+ }
160
+
161
+ /* Tabs */
162
+ .tab-nav {
163
+ background: linear-gradient(90deg, #f8fafc 0%, #ffffff 100%) !important;
164
+ border-radius: 12px !important;
165
+ padding: 8px !important;
166
+ margin-bottom: 25px !important;
167
+ border: 1px solid #e2e8f0 !important;
168
+ }
169
+
170
+ .tab-button {
171
+ border-radius: 8px !important;
172
+ font-weight: 600 !important;
173
+ padding: 10px 20px !important;
174
+ }
175
+
176
+ .tab-button.selected {
177
+ background: white !important;
178
+ color: #4ECDC4 !important;
179
+ box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
180
+ border: 1px solid #e2e8f0 !important;
181
+ }
182
+
183
+ /* JSON display */
184
+ .json-container {
185
+ background: #f8fafc !important;
186
+ border-radius: 8px !important;
187
+ padding: 15px !important;
188
+ border: 1px solid #e2e8f0 !important;
189
+ font-family: 'Monaco', '