Skip to content

Commit

Permalink
update 0913 rank/tier test
Browse files Browse the repository at this point in the history
  • Loading branch information
tksarah committed Sep 13, 2024
1 parent d157fd8 commit 662b2fd
Showing 1 changed file with 125 additions and 0 deletions.
125 changes: 125 additions & 0 deletions docs/rank/index_test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<!DOCTYPE html>
<html>
<head>
<title>Stake Rankings During the Build&Earn Subperiod</title>
<style>
.tier1 { color: #1f77b4; }
.tier2 { color: #ff7f0e; }
.tier3 { color: #2ca02c; }
.tier4 { color: #d62728; }
body {
font-family: 'Courier New', monospace;
background-color: #000000;
color: #FFFFFF;
}
table {
border-collapse: collapse;
width: 100%;
margin-top: 20px;
}
th, td {
padding: 8px;
text-align: left;
border-bottom: 1px solid #ddd;
color: #FFFFFF;
}
th {
background-color: #4CAF50;
color: white;
cursor: pointer;
}
tr:nth-child(even) {
background-color: #222222;
}
tr:nth-child(-n+11) {
color: #FFFF00;
}
h1 {
font-size: 24px;
font-weight: bold;
color: #d0d0d0;
border-bottom: 1px solid #bbb;
padding-bottom: 2px;
margin-bottom: 10px;
}
h2 {
font-size: 18px;
font-weight: bold;
color: #d0d0d0;
border-bottom: 1px solid #bbb;
padding-bottom: 2px;
margin-bottom: 10px;
}
.footer {
text-align: center;
padding: 20px;
background-color: #f4f4f4;
color: #333;
font-size: 0.8em;
position: fixed;
bottom: 0;
width: 100%;
border-top: 1px solid #ddd;
}
</style>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.1.0/papaparse.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.31.3/js/jquery.tablesorter.min.js"></script>
</head>
<body>
<h1 style="color: #FFFFFF;">dApp Ranking During Build&Earn Subperiod</h1>
<h2 style="color: #FFFFFF;">Update: DATEJST</h2>
<table id="myTable" class="table table-striped">
<thead>
<tr>
<th>Rank</th>
<th>Name</th>
<th>Category</th>
<th>TotalStaked</th>
<th>Tier</th>
</tr>
</thead>
<tbody></tbody>
</table>

<script>
$(document).ready(function() {
Papa.parse('TotalAmount.csv', {
download: true,
header: true,
complete: function(results) {
var data = results.data;
var tierGroups = {
"Tier 1": [],
"Tier 2": [],
"Tier 3": [],
"Tier 4": []
};

// Tierごとにデータを分類
data.forEach(row => {
if (row.Name) {
tierGroups[row.Tier].push(row);
}
});

// 各Tierごとにソートとランキング付け
Object.keys(tierGroups).forEach(tier => {
tierGroups[tier].sort((a, b) => b.TotalStaked - a.TotalStaked);
tierGroups[tier].forEach((row, index) => {
var tierClass = 'tier' + row.Tier.charAt(5);
$('#myTable tbody').append(`<tr><td>${index + 1}</td><td>${row.Name}</td><td>${row.Category}</td><td style="text-align: right;">${parseInt(row.TotalStaked).toLocaleString()}</td><td class="${tierClass}">${row.Tier}</td></tr>`);
});
});

$("#myTable").tablesorter();
}
});
});
</script>
</br>
</br>
<p>
</body>
</html>

0 comments on commit 662b2fd

Please sign in to comment.