Update seats and sponsors data; enhance index.html and script.js for improved display and sorting

This commit is contained in:
xiaomai
2025-09-15 19:49:20 +08:00
parent ae8d3ce510
commit 14bd00230e
4 changed files with 21 additions and 3 deletions

View File

@@ -8,6 +8,10 @@ function initSponsorsAndSeats(sponsors, seats) {
const moneyList = document.getElementById("moneyList");
const seatList = document.getElementById("seatList");
// Sort by amount descending
sponsors.sort((a, b) => parseFloat(b.amount) - parseFloat(a.amount));
seats.sort((a, b) => parseInt(b.seat) - parseInt(a.seat));
let totalAmount = 0;
sponsors.forEach((s) => {
totalAmount += parseFloat(s.amount);