feat: Add crowdfunding and sponsor management features

- Introduced fund_progress.txt to track server upgrade funding and vehicle replacement costs.
- Created sponsors.txt to log sponsorship contributions with details including name, project, amount, and date.
- Developed components.js for reusable UI components including navbar and footer.
- Implemented data_utils.js for parsing sponsor data and calculating totals.
- Added script.js for managing server status, crowdfunding display, and sponsor data fetching.
- Created sponsor_script.js for detailed sponsor data management, filtering, and UI interactions.
- Developed stats_script.js for player statistics display, including leaderboards and detailed player stats in a modal.
This commit is contained in:
zhangyuheng
2026-03-02 11:29:02 +08:00
parent d475d329e9
commit 47ef36f600
16 changed files with 1239 additions and 1020 deletions

View File

@@ -26,13 +26,14 @@
<meta property="twitter:image" content="https://img.lunadeer.cn/i/2024/04/22/6625ce6c8ddc1.png">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="css/style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://img.lunadeer.cn">
<link rel="dns-prefetch" href="https://outline.lunadeer.cn">
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&family=Inter:wght@400;600;800&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
<link rel="stylesheet" href="css/pages/stats.css">
<!-- Structured Data -->
<script type="application/ld+json">
@@ -49,412 +50,13 @@
}
}
</script>
<style>
/* Specific styles for stats page override/additions */
.stats-hero {
height: 40vh;
min-height: 300px;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 20px;
margin-top: 30px;
}
.player-card {
background: var(--card-bg);
border-radius: var(--radius-medium);
padding: 20px;
text-align: center;
transition: var(--transition);
cursor: pointer;
box-shadow: 0 4px 6px rgba(0,0,0,0.02);
position: relative;
overflow: hidden;
}
.player-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
.player-card img {
width: 80px;
height: 80px;
border-radius: 10px;
margin-bottom: 15px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.player-card h3 {
font-size: 16px;
margin-bottom: 5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.player-card .p-uuid {
font-size: 12px;
color: var(--text-secondary);
margin-bottom: 10px;
font-family: monospace;
}
/* Leaderboard Cards */
.leaderboard-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
margin-bottom: 60px;
}
.lb-card {
background: white;
border-radius: var(--radius-medium);
padding: 25px;
box-shadow: 0 4px 20px rgba(0,0,0,0.05);
position: relative;
overflow: hidden;
}
.lb-card.gold { border-top: 4px solid #FFD700; }
.lb-card.silver { border-top: 4px solid #C0C0C0; }
.lb-card.bronze { border-top: 4px solid #CD7F32; }
.lb-card.red { border-top: 4px solid #ff3b30; }
.lb-header {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 20px;
}
.lb-icon {
width: 40px;
height: 40px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10px;
background: var(--bg-color);
color: var(--text-primary);
font-size: 20px;
}
.lb-title {
font-weight: 600;
font-size: 18px;
}
.lb-top-player {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 20px;
padding-bottom: 20px;
border-bottom: 1px solid #f0f0f0;
}
.lb-top-player img {
width: 64px;
height: 64px;
border-radius: 8px;
margin-bottom: 10px;
}
.lb-top-data {
font-size: 24px;
font-weight: 700;
color: var(--accent-color);
}
.lb-list {
list-style: none;
}
.lb-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 0;
font-size: 14px;
border-bottom: 1px dashed #eee;
}
.lb-item:last-child { border-bottom: none; }
.lb-rank {
width: 24px;
height: 24px;
background: #eee;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
font-weight: 700;
margin-right: 8px;
}
/* Search Box */
.search-container {
max-width: 600px;
margin: 0 auto 40px;
position: relative;
}
.search-input {
width: 100%;
padding: 15px 20px 15px 45px;
border: 1px solid rgba(0,0,0,0.1);
border-radius: 15px;
font-size: 16px;
outline: none;
transition: var(--transition);
background: white;
}
.search-input:focus {
border-color: var(--accent-color);
box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}
.search-icon {
position: absolute;
left: 15px;
top: 50%;
transform: translateY(-50%);
color: #ccc;
}
/* Stats Modal Override */
.stat-row {
display: flex;
justify-content: space-between;
padding: 10px 0;
border-bottom: 1px solid #eee;
}
.stat-label { color: var(--text-secondary); }
.stat-value { font-weight: 600; }
.loading-text {
text-align: center;
padding: 40px;
color: var(--text-secondary);
font-size: 18px;
}
.load-more-container {
text-align: center;
margin-top: 40px;
}
.load-more-btn {
background: white;
border: 1px solid #ddd;
padding: 12px 30px;
border-radius: 20px;
cursor: pointer;
font-weight: 600;
transition: var(--transition);
}
.load-more-btn:hover {
background: #f9f9f9;
transform: translateY(-2px);
}
/* Modal Redesign */
.modal-content.expanded-modal {
max-width: 800px;
width: 90%;
display: flex;
flex-direction: column;
max-height: 90vh; /* Scrollable if too tall */
overflow-y: auto;
}
/* Custom Scrollbar for Modal */
.modal-content.expanded-modal::-webkit-scrollbar {
width: 6px; /* Thinner width */
}
.modal-content.expanded-modal::-webkit-scrollbar-track {
background: transparent; /* Transparent track */
margin: 10px 0; /* Add margin to top/bottom */
}
.modal-content.expanded-modal::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, 0.15); /* Subtle color */
border-radius: 10px; /* Rounded corners */
}
.modal-content.expanded-modal::-webkit-scrollbar-thumb:hover {
background: rgba(0, 0, 0, 0.25); /* Darker on hover */
}
.modal-top-section {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin-bottom: 20px;
}
.modal-identity {
flex: 1;
min-width: 200px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
}
.modal-identity img {
width: 100px;
height: 100px;
border-radius: 12px;
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
margin-bottom: 15px;
}
#modal-name {
margin: 5px 0;
font-size: 24px;
}
#modal-uuid {
font-size: 12px;
color: #999;
font-family: monospace;
word-break: break-all;
}
.stats-list-container.compact-stats {
flex: 1;
min-width: 250px;
display: flex;
flex-direction: column;
justify-content: center;
background: #f9f9f9;
padding: 15px;
border-radius: 12px;
}
.modal-divider {
border: 0;
border-top: 1px solid #eee;
margin: 10px 0 20px;
}
/* Accordion Styles */
.accordion {
display: flex;
flex-direction: column;
gap: 10px;
}
.accordion-item {
border: 1px solid #eee;
border-radius: 8px;
overflow: hidden;
}
.accordion-header {
background: #fdfdfd;
padding: 12px 15px;
cursor: pointer;
font-weight: 600;
display: flex;
justify-content: space-between;
align-items: center;
transition: background 0.2s;
}
.accordion-header:hover {
background: #f0f0f0;
}
.accordion-header .icon {
margin-right: 8px;
width: 20px;
text-align: center;
color: var(--text-secondary);
}
.accordion-header .arrow {
transition: transform 0.3s;
}
.accordion-header.active .arrow {
transform: rotate(180deg);
}
.accordion-header.active {
background: #f0f0f0;
color: var(--accent-color);
}
.accordion-content {
display: none; /* Hidden by default */
padding: 15px;
background: white;
border-top: 1px solid #eee;
}
.accordion-content.show {
display: block;
}
/* Grid for stats inside accordion */
.detail-stats-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: 10px;
}
.detail-stat-item {
display: flex;
justify-content: space-between;
font-size: 13px;
padding: 4px 0;
border-bottom: 1px dashed #f5f5f5;
}
.detail-stat-label {
color: #666;
margin-right: 10px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.detail-stat-value {
font-weight: 600;
font-family: monospace;
}
/* Mobile Adjustments */
@media (max-width: 600px) {
.modal-top-section {
flex-direction: column;
}
.modal-identity, .stats-list-container.compact-stats {
width: 100%;
}
}
</style>
</head>
<body>
<div id="navbar-component"></div>
<!-- Hero Section -->
<header class="hero stats-hero" style="background-image: url('https://img.lunadeer.cn/i/2025/11/26/69267755e14e3.png');">
<header class="hero stats-hero stats-hero-bg">
<div class="hero-overlay"></div>
<div class="hero-content">
<h1 class="hero-title">数据中心</h1>
@@ -463,7 +65,7 @@
</header>
<!-- Main Content -->
<div class="features-section" style="background: var(--bg-color);">
<div class="features-section stats-main-section">
<div class="container">
<!-- Leaderboards -->
@@ -514,7 +116,7 @@
</div>
<!-- 5. Play Time -->
<div class="lb-card" style="border-top: 4px solid #9b59b6;">
<div class="lb-card purple">
<div class="lb-header">
<div class="lb-icon"><i class="fas fa-crown"></i></div>
<div class="lb-title">尊者</div>
@@ -525,7 +127,7 @@
</div>
<!-- 6. Kills -->
<div class="lb-card" style="border-top: 4px solid #e74c3c;">
<div class="lb-card kill-red">
<div class="lb-header">
<div class="lb-icon"><i class="fas fa-crosshairs"></i></div>
<div class="lb-title">屠夫</div>
@@ -603,7 +205,7 @@
<!-- Bottom Section: Detailed Stats Accordion -->
<div class="modal-details-section">
<hr class="modal-divider">
<div id="loading-details" style="text-align:center; padding:20px; color:#888;">正在加载详细数据...</div>
<div id="loading-details" class="loading-details-text">正在加载详细数据...</div>
<div id="stats-accordion" class="accordion">
<!-- Dynamic Content -->
</div>
@@ -614,7 +216,7 @@
<div id="footer-component"></div>
<script src="components.js"></script>
<script src="stats_script.js"></script>
<script src="js/components.js"></script>
<script src="js/stats_script.js"></script>
</body>
</html>