Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -150,8 +150,7 @@ def get_zip_data_link():
|
|
| 150 |
href = (
|
| 151 |
f'<a href="data:application/zip;base64,{b64}" '
|
| 152 |
'download="data.zip" '
|
| 153 |
-
'style="text-decoration: none; font-weight: bold; font-size: 1.1em; '
|
| 154 |
-
'color: inherit; font-family: \'Inter\', sans-serif;">Download Data</a>'
|
| 155 |
)
|
| 156 |
return href
|
| 157 |
|
|
@@ -278,11 +277,11 @@ global_header_html = f"""
|
|
| 278 |
### CUSTOM CSS for Dark Mode and Mobile Responsiveness ###
|
| 279 |
custom_css = """
|
| 280 |
/* Table and layout */
|
| 281 |
-
.
|
| 282 |
table-layout: fixed;
|
| 283 |
width: 100%;
|
| 284 |
}
|
| 285 |
-
.
|
| 286 |
max-width: 150px;
|
| 287 |
white-space: nowrap;
|
| 288 |
overflow: hidden;
|
|
@@ -294,21 +293,29 @@ custom_css = """
|
|
| 294 |
margin-right: auto;
|
| 295 |
}
|
| 296 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 297 |
/* Dark mode styles */
|
| 298 |
@media (prefers-color-scheme: dark) {
|
| 299 |
body {
|
| 300 |
background-color: #121212;
|
| 301 |
color: #e0e0e0;
|
| 302 |
}
|
| 303 |
-
.
|
| 304 |
background-color: #333;
|
|
|
|
|
|
|
| 305 |
color: #e0e0e0;
|
| 306 |
}
|
| 307 |
-
.
|
| 308 |
color: #e0e0e0;
|
| 309 |
}
|
| 310 |
-
|
| 311 |
-
|
|
|
|
| 312 |
}
|
| 313 |
}
|
| 314 |
|
|
@@ -321,19 +328,18 @@ custom_css = """
|
|
| 321 |
"""
|
| 322 |
|
| 323 |
### GRADIO INTERFACE ###
|
| 324 |
-
|
| 325 |
demo = gr.Blocks(css=custom_css)
|
| 326 |
|
| 327 |
with demo:
|
| 328 |
# --- Header Links ---
|
| 329 |
gr.HTML(f"""
|
| 330 |
<div style="display: flex; justify-content: space-evenly; align-items: center; margin-bottom: 20px;">
|
| 331 |
-
<a href="https://huggingface.co/spaces/AIEnergyScore/submission_portal" style="text-decoration: none; font-weight: bold; font-size: 1.1em;">Submission Portal</a>
|
| 332 |
-
<a href="https://huggingface.co/spaces/AIEnergyScore/Label" style="text-decoration: none; font-weight: bold; font-size: 1.1em;">Label Generator</a>
|
| 333 |
-
<a href="https://huggingface.github.io/AIEnergyScore/#faq" style="text-decoration: none; font-weight: bold; font-size: 1.1em;">FAQ</a>
|
| 334 |
-
<a href="https://huggingface.github.io/AIEnergyScore/#documentation" style="text-decoration: none; font-weight: bold; font-size: 1.1em;">Documentation</a>
|
| 335 |
{get_zip_data_link()}
|
| 336 |
-
<a href="https://huggingface.co/spaces/AIEnergyScore/README/discussions" style="text-decoration: none; font-weight: bold; font-size: 1.1em;">Community</a>
|
| 337 |
</div>
|
| 338 |
""")
|
| 339 |
|
|
|
|
| 150 |
href = (
|
| 151 |
f'<a href="data:application/zip;base64,{b64}" '
|
| 152 |
'download="data.zip" '
|
| 153 |
+
'style="text-decoration: none; font-weight: bold; font-size: 1.1em; color: inherit; font-family: \'Inter\', sans-serif;">Download Data</a>'
|
|
|
|
| 154 |
)
|
| 155 |
return href
|
| 156 |
|
|
|
|
| 277 |
### CUSTOM CSS for Dark Mode and Mobile Responsiveness ###
|
| 278 |
custom_css = """
|
| 279 |
/* Table and layout */
|
| 280 |
+
.data-table {
|
| 281 |
table-layout: fixed;
|
| 282 |
width: 100%;
|
| 283 |
}
|
| 284 |
+
.data-table th, .data-table td {
|
| 285 |
max-width: 150px;
|
| 286 |
white-space: nowrap;
|
| 287 |
overflow: hidden;
|
|
|
|
| 293 |
margin-right: auto;
|
| 294 |
}
|
| 295 |
|
| 296 |
+
/* Force header links to be black in light mode */
|
| 297 |
+
.header-link {
|
| 298 |
+
color: black !important;
|
| 299 |
+
}
|
| 300 |
+
|
| 301 |
/* Dark mode styles */
|
| 302 |
@media (prefers-color-scheme: dark) {
|
| 303 |
body {
|
| 304 |
background-color: #121212;
|
| 305 |
color: #e0e0e0;
|
| 306 |
}
|
| 307 |
+
.data-table thead {
|
| 308 |
background-color: #333;
|
| 309 |
+
}
|
| 310 |
+
.data-table th {
|
| 311 |
color: #e0e0e0;
|
| 312 |
}
|
| 313 |
+
.data-table td {
|
| 314 |
color: #e0e0e0;
|
| 315 |
}
|
| 316 |
+
/* Non-header links in dark mode */
|
| 317 |
+
a:not(.header-link) {
|
| 318 |
+
color: #3fa45bff !important;
|
| 319 |
}
|
| 320 |
}
|
| 321 |
|
|
|
|
| 328 |
"""
|
| 329 |
|
| 330 |
### GRADIO INTERFACE ###
|
|
|
|
| 331 |
demo = gr.Blocks(css=custom_css)
|
| 332 |
|
| 333 |
with demo:
|
| 334 |
# --- Header Links ---
|
| 335 |
gr.HTML(f"""
|
| 336 |
<div style="display: flex; justify-content: space-evenly; align-items: center; margin-bottom: 20px;">
|
| 337 |
+
<a class="header-link" href="https://huggingface.co/spaces/AIEnergyScore/submission_portal" style="text-decoration: none; font-weight: bold; font-size: 1.1em;">Submission Portal</a>
|
| 338 |
+
<a class="header-link" href="https://huggingface.co/spaces/AIEnergyScore/Label" style="text-decoration: none; font-weight: bold; font-size: 1.1em;">Label Generator</a>
|
| 339 |
+
<a class="header-link" href="https://huggingface.github.io/AIEnergyScore/#faq" style="text-decoration: none; font-weight: bold; font-size: 1.1em;">FAQ</a>
|
| 340 |
+
<a class="header-link" href="https://huggingface.github.io/AIEnergyScore/#documentation" style="text-decoration: none; font-weight: bold; font-size: 1.1em;">Documentation</a>
|
| 341 |
{get_zip_data_link()}
|
| 342 |
+
<a class="header-link" href="https://huggingface.co/spaces/AIEnergyScore/README/discussions" style="text-decoration: none; font-weight: bold; font-size: 1.1em;">Community</a>
|
| 343 |
</div>
|
| 344 |
""")
|
| 345 |
|