Update index.html
Browse files- index.html +28 -15
index.html
CHANGED
|
@@ -104,12 +104,18 @@
|
|
| 104 |
}
|
| 105 |
.control-group { display: flex; align-items: center; gap: 8px; }
|
| 106 |
.control-group label { font-size: 13px; font-weight: 600; color: #555; }
|
| 107 |
-
|
| 108 |
-
|
|
|
|
| 109 |
border: 2px solid #e0e0e0;
|
|
|
|
| 110 |
border-radius: 6px;
|
| 111 |
-
|
|
|
|
|
|
|
| 112 |
}
|
|
|
|
|
|
|
| 113 |
.tab-buttons { display: flex; gap: 5px; margin-left: auto; }
|
| 114 |
.tab-btn {
|
| 115 |
padding: 8px 20px;
|
|
@@ -135,6 +141,8 @@
|
|
| 135 |
.refresh-btn:hover { background: #ea580c; }
|
| 136 |
.refresh-btn:disabled { background: #ccc; }
|
| 137 |
|
|
|
|
|
|
|
| 138 |
.rankings-panel {
|
| 139 |
background: white;
|
| 140 |
border-radius: 10px;
|
|
@@ -250,13 +258,13 @@
|
|
| 250 |
<div class="controls">
|
| 251 |
<div class="control-group">
|
| 252 |
<label>Time:</label>
|
| 253 |
-
<
|
| 254 |
-
<
|
| 255 |
-
<
|
| 256 |
-
<
|
| 257 |
-
<
|
| 258 |
-
<
|
| 259 |
-
</
|
| 260 |
</div>
|
| 261 |
|
| 262 |
<div class="tab-buttons">
|
|
@@ -382,12 +390,13 @@
|
|
| 382 |
const name = item.player || item.team;
|
| 383 |
const team = currentTab === 'players' ? (item.team || '') : '';
|
| 384 |
const url = currentTab === 'players' ? `/player/${encodeURIComponent(name)}` : `/team/${encodeURIComponent(name)}`;
|
|
|
|
| 385 |
|
| 386 |
return `
|
| 387 |
<a href="${url}" class="ranking-item">
|
| 388 |
<div class="rank-num">${item.rank}</div>
|
| 389 |
<div class="player-info">
|
| 390 |
-
<div class="player-name">${name}</div>
|
| 391 |
${team ? `<div class="player-team">${team}</div>` : ''}
|
| 392 |
</div>
|
| 393 |
<div class="mention-count">
|
|
@@ -411,9 +420,13 @@
|
|
| 411 |
});
|
| 412 |
});
|
| 413 |
|
| 414 |
-
document.
|
| 415 |
-
|
| 416 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 417 |
});
|
| 418 |
|
| 419 |
document.getElementById('refreshBtn').addEventListener('click', async () => {
|
|
@@ -443,4 +456,4 @@
|
|
| 443 |
setInterval(loadStatus, 10000);
|
| 444 |
</script>
|
| 445 |
</body>
|
| 446 |
-
</html>
|
|
|
|
| 104 |
}
|
| 105 |
.control-group { display: flex; align-items: center; gap: 8px; }
|
| 106 |
.control-group label { font-size: 13px; font-weight: 600; color: #555; }
|
| 107 |
+
.time-filters { display: flex; gap: 5px; }
|
| 108 |
+
.time-btn {
|
| 109 |
+
padding: 6px 12px;
|
| 110 |
border: 2px solid #e0e0e0;
|
| 111 |
+
background: white;
|
| 112 |
border-radius: 6px;
|
| 113 |
+
cursor: pointer;
|
| 114 |
+
font-size: 13px;
|
| 115 |
+
font-weight: 500;
|
| 116 |
}
|
| 117 |
+
.time-btn:hover { border-color: #f97316; color: #f97316; }
|
| 118 |
+
.time-btn.active { background: #f97316; color: white; border-color: #f97316; }
|
| 119 |
.tab-buttons { display: flex; gap: 5px; margin-left: auto; }
|
| 120 |
.tab-btn {
|
| 121 |
padding: 8px 20px;
|
|
|
|
| 141 |
.refresh-btn:hover { background: #ea580c; }
|
| 142 |
.refresh-btn:disabled { background: #ccc; }
|
| 143 |
|
| 144 |
+
.velocity { font-size: 18px; margin-left: 8px; }
|
| 145 |
+
|
| 146 |
.rankings-panel {
|
| 147 |
background: white;
|
| 148 |
border-radius: 10px;
|
|
|
|
| 258 |
<div class="controls">
|
| 259 |
<div class="control-group">
|
| 260 |
<label>Time:</label>
|
| 261 |
+
<div class="time-filters">
|
| 262 |
+
<button class="time-btn" data-hours="6">6h</button>
|
| 263 |
+
<button class="time-btn" data-hours="12">12h</button>
|
| 264 |
+
<button class="time-btn active" data-hours="24">24h</button>
|
| 265 |
+
<button class="time-btn" data-hours="48">48h</button>
|
| 266 |
+
<button class="time-btn" data-hours="168">7d</button>
|
| 267 |
+
</div>
|
| 268 |
</div>
|
| 269 |
|
| 270 |
<div class="tab-buttons">
|
|
|
|
| 390 |
const name = item.player || item.team;
|
| 391 |
const team = currentTab === 'players' ? (item.team || '') : '';
|
| 392 |
const url = currentTab === 'players' ? `/player/${encodeURIComponent(name)}` : `/team/${encodeURIComponent(name)}`;
|
| 393 |
+
const velocity = currentTab === 'players' && item.velocity ? `<span class="velocity">${item.velocity}</span>` : '';
|
| 394 |
|
| 395 |
return `
|
| 396 |
<a href="${url}" class="ranking-item">
|
| 397 |
<div class="rank-num">${item.rank}</div>
|
| 398 |
<div class="player-info">
|
| 399 |
+
<div class="player-name">${name}${velocity}</div>
|
| 400 |
${team ? `<div class="player-team">${team}</div>` : ''}
|
| 401 |
</div>
|
| 402 |
<div class="mention-count">
|
|
|
|
| 420 |
});
|
| 421 |
});
|
| 422 |
|
| 423 |
+
document.querySelectorAll('.time-btn').forEach(btn => {
|
| 424 |
+
btn.addEventListener('click', () => {
|
| 425 |
+
document.querySelectorAll('.time-btn').forEach(b => b.classList.remove('active'));
|
| 426 |
+
btn.classList.add('active');
|
| 427 |
+
hours = parseInt(btn.dataset.hours);
|
| 428 |
+
loadRankings();
|
| 429 |
+
});
|
| 430 |
});
|
| 431 |
|
| 432 |
document.getElementById('refreshBtn').addEventListener('click', async () => {
|
|
|
|
| 456 |
setInterval(loadStatus, 10000);
|
| 457 |
</script>
|
| 458 |
</body>
|
| 459 |
+
</html>
|