akhaliq HF Staff commited on
Commit
03f9262
·
verified ·
1 Parent(s): c6e36bd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -34
app.py CHANGED
@@ -412,12 +412,18 @@ table {
412
  text-decoration: none;
413
  }
414
 
415
- .header-table .sort-links a {
416
- color: black;
417
- font-weight: normal;
418
- font-size: 14pt;
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-links a {
461
  font-size: 12pt;
462
- margin-left: 10px;
463
  }
464
 
465
  .storylink {
@@ -494,8 +500,12 @@ table {
494
  color: black;
495
  }
496
 
497
- .header-table .sort-links a {
498
- color: black;
 
 
 
 
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
- gr.HTML("""
541
- <table border="0" cellpadding="0" cellspacing="0" class="header-table">
542
- <tr>
543
- <td>
544
- <span class="pagetop">
545
- <b class="hnname"><a href="#">Daily Papers</a></b>
546
- </span>
547
- </td>
548
- <td align="right" class="sort-links">
549
- <a href="#" onclick="HotSort()">Hot</a> |
550
- <a href="#" onclick="NewSort()">New</a>
551
- </td>
552
- </tr>
553
- </table>
554
- <script>
555
- function HotSort() {
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="hot_sort_button")
565
- new_sort = gr.Button("New Sort", visible=False, elem_id="new_sort_button")
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