Skip to content

Commit 8734fa6

Browse files
committed
scrollable fair table
1 parent 96a7f36 commit 8734fa6

2 files changed

Lines changed: 29 additions & 2 deletions

File tree

website/js/fair-distribution.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -968,15 +968,15 @@
968968
d3.descending(a.actual.Silver, b.actual.Silver) ||
969969
d3.descending(a.actual.Bronze, b.actual.Bronze)
970970
)
971-
.slice(0, 10);
971+
.slice(0, 300);
972972

973973
const fairRanking = [...rows]
974974
.sort((a, b) =>
975975
d3.descending(a.fair.Gold || 0, b.fair.Gold || 0) ||
976976
d3.descending(a.fair.Silver || 0, b.fair.Silver || 0) ||
977977
d3.descending(a.fair.Bronze || 0, b.fair.Bronze || 0)
978978
)
979-
.slice(0, 10);
979+
.slice(0, 300);
980980

981981
root.html(`
982982
<div class="fair-ranking-controls">

website/styles.css

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,33 @@ p {
12211221
justify-content: space-between;
12221222
}
12231223

1224+
.fair-ranking-card {
1225+
max-height: 520px;
1226+
overflow-y: auto;
1227+
overflow-x: hidden;
1228+
}
1229+
1230+
.fair-ranking-card::-webkit-scrollbar {
1231+
width: 8px;
1232+
}
1233+
1234+
.fair-ranking-card::-webkit-scrollbar-track {
1235+
background: rgba(255,255,255,0.08);
1236+
border-radius: 999px;
1237+
}
1238+
1239+
.fair-ranking-card::-webkit-scrollbar-thumb {
1240+
background: #f4b400;
1241+
border-radius: 999px;
1242+
}
1243+
1244+
.fair-ranking-table thead th {
1245+
position: sticky;
1246+
top: 0;
1247+
background: #111;
1248+
z-index: 2;
1249+
}
1250+
12241251
/* =============================================
12251252
Footer
12261253
=========================================== */

0 commit comments

Comments
 (0)