Ifeanyi commited on
Commit
9a2810e
·
verified ·
1 Parent(s): 45b481e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -186
app.py CHANGED
@@ -27,202 +27,36 @@ def arithmetic(num1, num2, operation):
27
  return res[0]
28
 
29
  custom_css = """
30
- /* Define color variables for the dark theme */
31
- :root {
32
- --background-color: #121212;
33
- --surface-color: #1e1e1e;
34
- --primary-color: #3a6ea5;
35
- --accent-color: #6d9eeb;
36
- --text-primary: #ffffff;
37
- --text-secondary: #b0b0b0;
38
- --border-color: #2c2c2c;
39
- --input-background: #2a2a2a;
40
- --button-gradient-start: #4568dc;
41
- --button-gradient-end: #0f4c81;
42
- --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
43
- }
44
-
45
- /* Global styles for the Gradio app */
46
  body {
47
- background-color: var(--background-color) !important;
48
- color: var(--text-primary) !important;
49
- font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
50
- }
51
-
52
- /* Override Gradio's container styles */
53
- .gradio-container {
54
- width: 100% !important;
55
- max-width: none !important;
56
- margin: 0 auto !important;
57
- background-color: var(--background-color) !important;
58
- }
59
-
60
- /* Header styling */
61
- h1, h2, h3, h4, h5, h6 {
62
- color: var(--text-primary) !important;
63
- font-weight: 600 !important;
64
- }
65
-
66
- /* Make the main title stand out */
67
- h1 strong {
68
- background: linear-gradient(135deg, #4568dc, #6d9eeb);
69
- -webkit-background-clip: text;
70
- -webkit-text-fill-color: transparent;
71
- background-clip: text;
72
- }
73
-
74
- /* Style the blocks and rows */
75
- .block, .gr-box, .gr-form, .gr-panel {
76
- background-color: var(--surface-color) !important;
77
- border-radius: 8px !important;
78
- border: 1px solid var(--border-color) !important;
79
- box-shadow: var(--box-shadow) !important;
80
- padding: 16px !important;
81
- margin-bottom: 20px !important;
82
- }
83
-
84
- /* Style labels */
85
- label, .gr-label {
86
- color: var(--text-primary) !important;
87
- font-weight: 500 !important;
88
- margin-bottom: 8px !important;
89
- }
90
-
91
- /* Style number inputs */
92
- input[type="number"], .gr-text-input, .gr-input {
93
- background-color: var(--input-background) !important;
94
- color: var(--text-primary) !important;
95
- border: 1px solid var(--border-color) !important;
96
- border-radius: 6px !important;
97
- padding: 12px 16px !important;
98
- font-size: 16px !important;
99
- transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
100
- }
101
-
102
- input[type="number"]:focus, .gr-text-input:focus, .gr-input:focus {
103
- border-color: var(--accent-color) !important;
104
- box-shadow: 0 0 0 2px rgba(109, 158, 235, 0.2) !important;
105
- outline: none !important;
106
- }
107
-
108
- /* Style radio buttons */
109
- .gr-radio-group label {
110
- color: var(--text-secondary) !important;
111
- }
112
-
113
- .gr-radio {
114
- accent-color: var(--accent-color) !important;
115
- }
116
-
117
- .gr-checkbox-label, .gr-radio-label {
118
- color: var(--text-secondary) !important;
119
  }
120
 
121
- /* Override radio button containers */
122
- .gr-radio-group, .gr-form {
123
- background-color: var(--surface-color) !important;
124
- padding: 12px !important;
125
- border-radius: 8px !important;
126
- border: 1px solid var(--border-color) !important;
127
  }
128
 
129
- /* Style button with gradient */
130
- button, .gr-button {
131
- background: linear-gradient(135deg, var(--button-gradient-start), var(--button-gradient-end)) !important;
132
- color: white !important;
133
- border: none !important;
134
- padding: 12px 24px !important;
135
- border-radius: 6px !important;
136
- cursor: pointer !important;
137
- font-weight: 600 !important;
138
- letter-spacing: 0.5px !important;
139
- transition: all 0.3s ease !important;
140
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2) !important;
141
- text-transform: uppercase !important;
142
- font-size: 14px !important;
143
- width: auto !important;
144
- display: inline-block !important;
145
  }
146
 
147
- button:hover, .gr-button:hover {
148
- background: linear-gradient(135deg, #5273e3, #1a5fa0) !important;
149
- box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3) !important;
150
- transform: translateY(-1px) !important;
151
  }
152
 
153
- button:active, .gr-button:active {
154
- transform: translateY(1px) !important;
155
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
156
- }
157
-
158
- /* Result section styling */
159
- .gr-output-box {
160
- background-color: var(--surface-color) !important;
161
- border: 1px solid var(--border-color) !important;
162
- border-radius: 8px !important;
163
- padding: 16px !important;
164
- }
165
-
166
- /* Result number styling */
167
- .gr-number-output {
168
- font-size: 24px !important;
169
- font-weight: 700 !important;
170
- color: var(--accent-color) !important;
171
- text-align: center !important;
172
- }
173
-
174
- /* For the result header */
175
- h3 strong {
176
- color: var(--accent-color) !important;
177
- }
178
-
179
- /* Add a subtle border to all rows */
180
- .gr-row {
181
- margin-bottom: 20px !important;
182
- }
183
-
184
- /* Remove footer */
185
  footer {
186
- display: none !important;
187
- }
188
-
189
- /* Fix any dark text on dark background issues */
190
- .dark {
191
- color: var(--text-primary) !important;
192
- }
193
-
194
- /* Additional spacing for the operation radio buttons */
195
- #operation {
196
- margin-top: 10px !important;
197
- margin-bottom: 20px !important;
198
- }
199
-
200
- /* Add a subtle gradient background to the app container */
201
- .gradio-app {
202
- background: linear-gradient(160deg, #121212 0%, #1a1f2c 100%) !important;
203
- min-height: 100vh !important;
204
- }
205
-
206
- /* Ensure number inputs don't have spinner arrows in Firefox */
207
- input[type=number] {
208
- -moz-appearance: textfield !important;
209
- }
210
-
211
- /* Remove spinner arrows from number inputs in other browsers */
212
- input::-webkit-outer-spin-button,
213
- input::-webkit-inner-spin-button {
214
- -webkit-appearance: none !important;
215
- margin: 0 !important;
216
- }
217
-
218
- /* Make the result stand out more */
219
- #result {
220
- font-size: 28px !important;
221
- padding: 16px !important;
222
- text-align: center !important;
223
- background-color: rgba(58, 110, 165, 0.1) !important;
224
- border-radius: 8px !important;
225
- margin-top: 10px !important;
226
  }
227
  """
228
  with gr.Blocks(
 
27
  return res[0]
28
 
29
  custom_css = """
30
+ /* Ultra minimal dark theme with only essential styling */
31
+
32
+ /* Dark background and light text */
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  body {
34
+ background-color: #121212;
35
+ color: #ffffff;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
37
 
38
+ /* Make inputs visible on dark background */
39
+ input, textarea, select {
40
+ background-color: #2a2a2a;
41
+ color: #ffffff;
42
+ border: 1px solid #444;
 
43
  }
44
 
45
+ /* Simple gradient button */
46
+ button {
47
+ background: linear-gradient(135deg, #4568dc, #0f4c81);
48
+ color: white;
 
 
 
 
 
 
 
 
 
 
 
 
49
  }
50
 
51
+ /* Ensure result is visible */
52
+ #result, .output-class, .gr-number-output {
53
+ color: #ffffff !important;
54
+ font-size: large;
55
  }
56
 
57
+ /* Hide footer */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  footer {
59
+ display: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  }
61
  """
62
  with gr.Blocks(