Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -412,12 +412,18 @@ table {
|
|
| 412 |
text-decoration: none;
|
| 413 |
}
|
| 414 |
|
| 415 |
-
.header-table .sort-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
margin-left: 15px;
|
| 420 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 421 |
}
|
| 422 |
|
| 423 |
.itemlist .athing {
|
|
@@ -457,9 +463,9 @@ table {
|
|
| 457 |
font-size: 12pt;
|
| 458 |
}
|
| 459 |
|
| 460 |
-
.sort-
|
| 461 |
font-size: 12pt;
|
| 462 |
-
|
| 463 |
}
|
| 464 |
|
| 465 |
.storylink {
|
|
@@ -494,8 +500,12 @@ table {
|
|
| 494 |
color: black;
|
| 495 |
}
|
| 496 |
|
| 497 |
-
.header-table .sort-
|
| 498 |
-
color:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 499 |
}
|
| 500 |
|
| 501 |
.itemlist .athing {
|
|
@@ -537,32 +547,25 @@ with demo:
|
|
| 537 |
""")
|
| 538 |
# Hacker News-like Header with "Hot" and "New" sort options
|
| 539 |
with gr.Row():
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
<
|
| 543 |
-
<
|
| 544 |
-
<
|
| 545 |
-
<
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
<
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
gradioApp().getElementById('hot_sort_button').click();
|
| 557 |
-
}
|
| 558 |
-
function NewSort() {
|
| 559 |
-
gradioApp().getElementById('new_sort_button').click();
|
| 560 |
-
}
|
| 561 |
-
</script>
|
| 562 |
-
""")
|
| 563 |
# Hidden buttons to trigger sort methods
|
| 564 |
-
hot_sort = gr.Button("Hot Sort", visible=False, elem_id="
|
| 565 |
-
new_sort = gr.Button("New Sort", visible=False, elem_id="
|
| 566 |
# Paper list
|
| 567 |
paper_list = gr.HTML()
|
| 568 |
# Navigation Buttons
|
|
|
|
| 412 |
text-decoration: none;
|
| 413 |
}
|
| 414 |
|
| 415 |
+
.header-table .sort-buttons button {
|
| 416 |
+
background: none;
|
| 417 |
+
border: none;
|
| 418 |
+
color: #0000ff;
|
|
|
|
| 419 |
cursor: pointer;
|
| 420 |
+
font-size: 14pt;
|
| 421 |
+
text-decoration: underline;
|
| 422 |
+
padding: 0 10px;
|
| 423 |
+
}
|
| 424 |
+
|
| 425 |
+
.header-table .sort-buttons button:hover {
|
| 426 |
+
color: #551A8B;
|
| 427 |
}
|
| 428 |
|
| 429 |
.itemlist .athing {
|
|
|
|
| 463 |
font-size: 12pt;
|
| 464 |
}
|
| 465 |
|
| 466 |
+
.sort-buttons button {
|
| 467 |
font-size: 12pt;
|
| 468 |
+
padding: 0 5px;
|
| 469 |
}
|
| 470 |
|
| 471 |
.storylink {
|
|
|
|
| 500 |
color: black;
|
| 501 |
}
|
| 502 |
|
| 503 |
+
.header-table .sort-buttons button {
|
| 504 |
+
color: #add8e6;
|
| 505 |
+
}
|
| 506 |
+
|
| 507 |
+
.header-table .sort-buttons button:hover {
|
| 508 |
+
color: #9370db;
|
| 509 |
}
|
| 510 |
|
| 511 |
.itemlist .athing {
|
|
|
|
| 547 |
""")
|
| 548 |
# Hacker News-like Header with "Hot" and "New" sort options
|
| 549 |
with gr.Row():
|
| 550 |
+
# Left side: Site title
|
| 551 |
+
gr.Markdown("""
|
| 552 |
+
<table border="0" cellpadding="0" cellspacing="0" class="header-table">
|
| 553 |
+
<tr>
|
| 554 |
+
<td>
|
| 555 |
+
<span class="pagetop">
|
| 556 |
+
<b class="hnname"><a href="#">Daily Papers</a></b>
|
| 557 |
+
</span>
|
| 558 |
+
</td>
|
| 559 |
+
<td align="right" class="sort-buttons">
|
| 560 |
+
<button onclick="gradioApp().getElementById('hot_sort').click()">Hot</button> |
|
| 561 |
+
<button onclick="gradioApp().getElementById('new_sort').click()">New</button>
|
| 562 |
+
</td>
|
| 563 |
+
</tr>
|
| 564 |
+
</table>
|
| 565 |
+
""", show_label=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 566 |
# Hidden buttons to trigger sort methods
|
| 567 |
+
hot_sort = gr.Button("Hot Sort", visible=False, elem_id="hot_sort")
|
| 568 |
+
new_sort = gr.Button("New Sort", visible=False, elem_id="new_sort")
|
| 569 |
# Paper list
|
| 570 |
paper_list = gr.HTML()
|
| 571 |
# Navigation Buttons
|