Update ui/styles.py
Browse files- ui/styles.py +153 -90
ui/styles.py
CHANGED
|
@@ -1,126 +1,189 @@
|
|
| 1 |
"""
|
| 2 |
-
CSS styles
|
| 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:
|
| 12 |
-
margin:
|
| 13 |
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
| 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, #
|
| 24 |
-webkit-background-clip: text;
|
| 25 |
-webkit-text-fill-color: transparent;
|
| 26 |
background-clip: text;
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
| 28 |
}
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%) !important;
|
| 33 |
-
color: white !important;
|
| 34 |
-
border: none !important;
|
| 35 |
font-weight: 600 !important;
|
| 36 |
-
|
| 37 |
-
|
| 38 |
}
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
font-weight: 600 !important;
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
}
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
border: 1px solid #e2e8f0 !important;
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
|
|
|
|
|
|
| 57 |
}
|
| 58 |
|
| 59 |
-
/*
|
| 60 |
-
.
|
| 61 |
-
background:
|
| 62 |
-
border-
|
| 63 |
padding: 15px !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
border-radius: 8px !important;
|
| 65 |
-
|
| 66 |
-
font-weight: bold !important;
|
| 67 |
}
|
| 68 |
|
| 69 |
-
.
|
| 70 |
-
background:
|
| 71 |
-
|
| 72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
border-radius: 8px !important;
|
| 74 |
-
|
| 75 |
-
|
| 76 |
}
|
| 77 |
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 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 |
-
.
|
| 90 |
-
background: linear-gradient(135deg, #
|
| 91 |
color: white !important;
|
| 92 |
-
|
| 93 |
-
border-radius: 10px !important;
|
| 94 |
-
margin: 15px 0 !important;
|
| 95 |
-
border-left: 5px solid #4ECDC4 !important;
|
| 96 |
}
|
| 97 |
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
border-top: 1px solid #e2e8f0 !important;
|
| 103 |
-
color: #718096 !important;
|
| 104 |
-
font-size: 14px !important;
|
| 105 |
}
|
| 106 |
-
"""
|
| 107 |
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 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', '
|