Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -27,60 +27,82 @@ def arithmetic(num1, num2, operation):
|
|
27 |
return res[0]
|
28 |
|
29 |
custom_css = """
|
30 |
-
|
31 |
-
|
32 |
-
background-color: #
|
33 |
-
color: #
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
|
36 |
-
/*
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
}
|
40 |
|
41 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
input, textarea {
|
43 |
-
background-color:
|
44 |
-
|
45 |
-
|
46 |
padding: 10px;
|
47 |
border-radius: 5px;
|
48 |
width: 100%;
|
49 |
box-sizing: border-box;
|
50 |
}
|
51 |
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
56 |
}
|
57 |
|
58 |
-
/* Style the buttons
|
59 |
button {
|
60 |
-
background:
|
61 |
-
color:
|
62 |
border: none;
|
63 |
padding: 10px 20px;
|
64 |
border-radius: 5px;
|
65 |
cursor: pointer;
|
66 |
-
transition: background 0.3s ease;
|
67 |
}
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
72 |
}
|
73 |
-
|
74 |
-
|
75 |
-
label {
|
76 |
-
color: #ffffff;
|
77 |
-
font-weight: bold;
|
78 |
-
margin-top: 10px;
|
79 |
-
display: block;
|
80 |
-
}
|
81 |
-
|
82 |
-
/* Hide footer display */
|
83 |
-
footer {display: none !important;}
|
84 |
"""
|
85 |
with gr.Blocks(
|
86 |
title="R-Powered Calculator",
|
|
|
27 |
return res[0]
|
28 |
|
29 |
custom_css = """
|
30 |
+
/* Define color variables for light mode */
|
31 |
+
:root {
|
32 |
+
--background-color-light: #ffffff;
|
33 |
+
--text-color-light: #000000;
|
34 |
+
--input-background-light: #f0f0f0;
|
35 |
+
--input-text-light: #000000;
|
36 |
+
--button-background-light: #4CAF50;
|
37 |
+
--button-text-light: #ffffff;
|
38 |
}
|
39 |
|
40 |
+
/* Define color variables for dark mode */
|
41 |
+
@media (prefers-color-scheme: dark) {
|
42 |
+
:root {
|
43 |
+
--background-color-dark: #121212;
|
44 |
+
--text-color-dark: #ffffff;
|
45 |
+
--input-background-dark: #1e1e1e;
|
46 |
+
--input-text-dark: #ffffff;
|
47 |
+
--button-background-dark: #2a5298;
|
48 |
+
--button-text-dark: #ffffff;
|
49 |
+
}
|
50 |
}
|
51 |
|
52 |
+
/* Apply background and text colors based on the current mode */
|
53 |
+
body {
|
54 |
+
background-color: var(--background-color-light);
|
55 |
+
color: var(--text-color-light);
|
56 |
+
}
|
57 |
+
|
58 |
+
@media (prefers-color-scheme: dark) {
|
59 |
+
body {
|
60 |
+
background-color: var(--background-color-dark);
|
61 |
+
color: var(--text-color-dark);
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
/* Style the input fields */
|
66 |
input, textarea {
|
67 |
+
background-color: var(--input-background-light);
|
68 |
+
color: var(--input-text-light);
|
69 |
+
border: 1px solid #ccc;
|
70 |
padding: 10px;
|
71 |
border-radius: 5px;
|
72 |
width: 100%;
|
73 |
box-sizing: border-box;
|
74 |
}
|
75 |
|
76 |
+
@media (prefers-color-scheme: dark) {
|
77 |
+
input, textarea {
|
78 |
+
background-color: var(--input-background-dark);
|
79 |
+
color: var(--input-text-dark);
|
80 |
+
border: 1px solid #444;
|
81 |
+
}
|
82 |
}
|
83 |
|
84 |
+
/* Style the buttons */
|
85 |
button {
|
86 |
+
background-color: var(--button-background-light);
|
87 |
+
color: var(--button-text-light);
|
88 |
border: none;
|
89 |
padding: 10px 20px;
|
90 |
border-radius: 5px;
|
91 |
cursor: pointer;
|
92 |
+
transition: background-color 0.3s ease;
|
93 |
}
|
94 |
|
95 |
+
@media (prefers-color-scheme: dark) {
|
96 |
+
button {
|
97 |
+
background-color: var(--button-background-dark);
|
98 |
+
color: var(--button-text-dark);
|
99 |
+
}
|
100 |
+
button:hover {
|
101 |
+
background-color: #1e3c72;
|
102 |
+
}
|
103 |
}
|
104 |
+
/* Hide footer display */
|
105 |
+
footer {display: none !important;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
"""
|
107 |
with gr.Blocks(
|
108 |
title="R-Powered Calculator",
|