Update seats and sponsors data; enhance index.html and script.js for improved display and sorting
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user