File size: 20,569 Bytes
61f60d6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | <!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CS2 Team Stats</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.fade-in {
animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.player-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
.modal {
display: none;
position: fixed;
z-index: 100;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.7);
}
.modal-content {
background-color: #1a202c;
margin: 5% auto;
padding: 20px;
border: 1px solid #2d3748;
width: 80%;
max-width: 800px;
border-radius: 8px;
animation: modalFadeIn 0.3s;
}
@keyframes modalFadeIn {
from { opacity: 0; transform: translateY(-50px); }
to { opacity: 1; transform: translateY(0); }
}
#adminPanel {
display: none;
}
</style>
</head>
<body class="bg-gray-900 text-gray-100 min-h-screen">
<!-- Кнопка админ-панели -->
<div class="fixed bottom-4 right-4">
<button onclick="showAdminLogin()" class="bg-red-500 hover:bg-red-600 text-white p-3 rounded-full shadow-lg">
<i class="fas fa-lock"></i>
</button>
</div>
<!-- Модальное окно входа в админку -->
<div id="adminLoginModal" class="modal">
<div class="modal-content">
<div class="flex justify-between items-center mb-4">
<h2 class="text-2xl font-bold">Доступ к админ-панели</h2>
<button onclick="closeModal('adminLoginModal')" class="text-gray-400 hover:text-white text-2xl">×</button>
</div>
<div class="mb-4">
<label class="block text-gray-300 mb-2">Введите пароль:</label>
<input type="password" id="adminPassword" class="w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
</div>
<button onclick="checkAdminPassword()" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded">Войти</button>
</div>
</div>
<!-- Админ-панель -->
<div id="adminPanel" class="fixed inset-0 bg-gray-800 z-50 overflow-y-auto p-4">
<div class="max-w-7xl mx-auto">
<div class="flex justify-between items-center mb-6">
<h1 class="text-2xl font-bold">Админ-панель</h1>
<button onclick="hideAdminPanel()" class="text-gray-400 hover:text-white text-2xl">×</button>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<!-- Форма добавления матча -->
<div class="bg-gray-700 p-6 rounded-lg">
<h2 class="text-xl font-semibold mb-4">Добавить новый матч</h2>
<div class="space-y-4">
<div>
<label class="block text-gray-300 mb-2">Номер матча:</label>
<input type="number" id="matchNumber" class="w-full px-3 py-2 bg-gray-600 border border-gray-500 rounded-md">
</div>
<div>
<label class="block text-gray-300 mb-2">Дата:</label>
<input type="date" id="matchDate" class="w-full px-3 py-2 bg-gray-600 border border-gray-500 rounded-md">
</div>
<div>
<label class="block text-gray-300 mb-2">Карта:</label>
<select id="matchMap" class="w-full px-3 py-2 bg-gray-600 border border-gray-500 rounded-md">
<option value="Mirage">Mirage</option>
<option value="Inferno">Inferno</option>
<option value="Dust2">Dust2</option>
<option value="Overpass">Overpass</option>
<option value="Nuke">Nuke</option>
<option value="Vertigo">Vertigo</option>
<option value="Ancient">Ancient</option>
</select>
</div>
<div>
<label class="block text-gray-300 mb-2">Счет (Команда A):</label>
<input type="number" id="teamAScore" class="w-full px-3 py-2 bg-gray-600 border border-gray-500 rounded-md">
</div>
<div>
<label class="block text-gray-300 mb-2">Счет (Команда B):</label>
<input type="number" id="teamBScore" class="w-full px-3 py-2 bg-gray-600 border border-gray-500 rounded-md">
</div>
<button onclick="addNewMatch()" class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded">Добавить матч</button>
</div>
</div>
<!-- Форма добавления статистики игроков -->
<div class="bg-gray-700 p-6 rounded-lg">
<h2 class="text-xl font-semibold mb-4">Добавить статистику игроков</h2>
<div class="space-y-4">
<div>
<label class="block text-gray-300 mb-2">Номер матча:</label>
<select id="playerMatchNumber" class="w-full px-3 py-2 bg-gray-600 border border-gray-500 rounded-md">
<!-- Заполняется JavaScript -->
</select>
</div>
<div>
<label class="block text-gray-300 mb-2">Игрок:</label>
<select id="playerNameSelect" class="w-full px-3 py-2 bg-gray-600 border border-gray-500 rounded-md">
<option value="PlayerOne">PlayerOne (Команда A)</option>
<option value="PlayerTwo">PlayerTwo (Команда A)</option>
<option value="PlayerThree">PlayerThree (Команда A)</option>
<option value="PlayerFour">PlayerFour (Команда A)</option>
<option value="PlayerFive">PlayerFive (Команда A)</option>
<option value="PlayerSix">PlayerSix (Команда B)</option>
<option value="PlayerSeven">PlayerSeven (Команда B)</option>
<option value="PlayerEight">PlayerEight (Команда B)</option>
<option value="PlayerNine">PlayerNine (Команда B)</option>
<option value="PlayerTen">PlayerTen (Команда B)</option>
</select>
</div>
<div>
<label class="block text-gray-300 mb-2">Убийства:</label>
<input type="number" id="playerKills" class="w-full px-3 py-2 bg-gray-600 border border-gray-500 rounded-md">
</div>
<div>
<label class="block text-gray-300 mb-2">Смерти:</label>
<input type="number" id="playerDeaths" class="w-full px-3 py-2 bg-gray-600 border border-gray-500 rounded-md">
</div>
<div>
<label class="block text-gray-300 mb-2">ADR:</label>
<input type="number" step="0.1" id="playerADR" class="w-full px-3 py-2 bg-gray-600 border border-gray-500 rounded-md">
</div>
<button onclick="addPlayerStats()" class="bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded">Добавить статистику</button>
</div>
</div>
</div>
<!-- Список матчей для редактирования -->
<div class="mt-8 bg-gray-700 p-6 rounded-lg">
<h2 class="text-xl font-semibold mb-4">Все матчи</h2>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-600">
<thead class="bg-gray-600">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">ID</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">Дата</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">Карта</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">Счет</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-300 uppercase tracking-wider">Действия</th>
</tr>
</thead>
<tbody id="matchesList" class="bg-gray-700 divide-y divide-gray-600">
<!-- Заполняется JavaScript -->
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Остальной код сайта (навигация, контент, подвал) остается без изменений -->
<!-- ... -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
// Хранилище данных
let matchesData = JSON.parse(localStorage.getItem('cs2_matches')) || [];
let playersStats = JSON.parse(localStorage.getItem('cs2_players_stats')) || {};
// Инициализация данных по умолчанию
if (matchesData.length === 0) {
matchesData = [
{ id: 24, date: '2023-06-15', map: 'Mirage', teamAScore: 16, teamBScore: 14 },
{ id: 23, date: '2023-06-14', map: 'Inferno', teamAScore: 12, teamBScore: 16 },
{ id: 22, date: '2023-06-12', map: 'Dust2', teamAScore: 16, teamBScore: 10 },
{ id: 21, date: '2023-06-10', map: 'Overpass', teamAScore: 16, teamBScore: 12 }
];
localStorage.setItem('cs2_matches', JSON.stringify(matchesData));
}
if (Object.keys(playersStats).length === 0) {
playersStats = {
'24': {
'PlayerOne': { kills: 24, deaths: 12, adr: 98.7, team: 'A' },
'PlayerTwo': { kills: 18, deaths: 16, adr: 87.2, team: 'A' },
'PlayerThree': { kills: 15, deaths: 14, adr: 76.5, team: 'A' },
'PlayerFour': { kills: 12, deaths: 18, adr: 65.3, team: 'A' },
'PlayerFive': { kills: 10, deaths: 20, adr: 54.1, team: 'A' },
'PlayerSix': { kills: 22, deaths: 14, adr: 95.3, team: 'B' },
'PlayerSeven': { kills: 17, deaths: 15, adr: 85.6, team: 'B' },
'PlayerEight': { kills: 14, deaths: 16, adr: 74.2, team: 'B' },
'PlayerNine': { kills: 11, deaths: 18, adr: 63.8, team: 'B' },
'PlayerTen': { kills: 9, deaths: 20, adr: 52.4, team: 'B' }
},
// ... другие матчи
};
localStorage.setItem('cs2_players_stats', JSON.stringify(playersStats));
}
// Функции админ-панели
function showAdminLogin() {
document.getElementById('adminLoginModal').style.display = 'block';
}
function closeModal(modalId) {
document.getElementById(modalId).style.display = 'none';
}
function checkAdminPassword() {
const password = document.getElementById('adminPassword').value;
if (password === 'cs2admin') { // Замените на ваш реальный пароль
document.getElementById('adminLoginModal').style.display = 'none';
document.getElementById('adminPanel').style.display = 'block';
updateAdminPanel();
} else {
alert('Неверный пароль!');
}
}
function hideAdminPanel() {
document.getElementById('adminPanel').style.display = 'none';
}
function updateAdminPanel() {
// Обновляем список матчей
const matchesList = document.getElementById('matchesList');
matchesList.innerHTML = '';
matchesData.sort((a, b) => b.id - a.id).forEach(match => {
const row = document.createElement('tr');
row.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap">${match.id}</td>
<td class="px-6 py-4 whitespace-nowrap">${match.date}</td>
<td class="px-6 py-4 whitespace-nowrap">${match.map}</td>
<td class="px-6 py-4 whitespace-nowrap">${match.teamAScore} : ${match.teamBScore}</td>
<td class="px-6 py-4 whitespace-nowrap">
<button onclick="deleteMatch(${match.id})" class="text-red-400 hover:text-red-300 mr-2">Удалить</button>
</td>
`;
matchesList.appendChild(row);
});
// Обновляем выпадающий список матчей для статистики игроков
const matchSelect = document.getElementById('playerMatchNumber');
matchSelect.innerHTML = '';
matchesData.sort((a, b) => b.id - a.id).forEach(match => {
const option = document.createElement('option');
option.value = match.id;
option.textContent = `Матч #${match.id} (${match.date})`;
matchSelect.appendChild(option);
});
}
function addNewMatch() {
const matchNumber = parseInt(document.getElementById('matchNumber').value);
const matchDate = document.getElementById('matchDate').value;
const matchMap = document.getElementById('matchMap').value;
const teamAScore = parseInt(document.getElementById('teamAScore').value);
const teamBScore = parseInt(document.getElementById('teamBScore').value);
if (!matchNumber || !matchDate || !matchMap || isNaN(teamAScore) || isNaN(teamBScore)) {
alert('Заполните все поля!');
return;
}
// Проверяем, существует ли уже матч с таким номером
if (matchesData.some(m => m.id === matchNumber)) {
alert('Матч с таким номером уже существует!');
return;
}
// Добавляем новый матч
matchesData.push({
id: matchNumber,
date: matchDate,
map: matchMap,
teamAScore: teamAScore,
teamBScore: teamBScore
});
// Сохраняем в localStorage
localStorage.setItem('cs2_matches', JSON.stringify(matchesData));
// Обновляем админ-панель
updateAdminPanel();
// Очищаем форму
document.getElementById('matchNumber').value = '';
document.getElementById('matchDate').value = '';
document.getElementById('teamAScore').value = '';
document.getElementById('teamBScore').value = '';
alert('Матч успешно добавлен! Теперь добавьте статистику игроков.');
}
function deleteMatch(matchId) {
if (confirm(`Вы уверены, что хотите удалить матч #${matchId}?`)) {
// Удаляем матч из списка
matchesData = matchesData.filter(m => m.id !== matchId);
localStorage.setItem('cs2_matches', JSON.stringify(matchesData));
// Удаляем статистику игроков для этого матча
if (playersStats[matchId]) {
delete playersStats[matchId];
localStorage.setItem('cs2_players_stats', JSON.stringify(playersStats));
}
updateAdminPanel();
alert('Матч удален!');
}
}
function addPlayerStats() {
const matchId = document.getElementById('playerMatchNumber').value;
const playerName = document.getElementById('playerNameSelect').value;
const kills = parseInt(document.getElementById('playerKills').value);
const deaths = parseInt(document.getElementById('playerDeaths').value);
const adr = parseFloat(document.getElementById('playerADR').value);
if (!matchId || !playerName || isNaN(kills) || isNaN(deaths) || isNaN(adr)) {
alert('Заполните все поля!');
return;
}
// Определяем команду игрока
const team = playerName.includes('PlayerOne') || playerName.includes('PlayerTwo') ||
playerName.includes('PlayerThree') || playerName.includes('PlayerFour') ||
playerName.includes('PlayerFive') ? 'A' : 'B';
// Добавляем статистику игрока
if (!playersStats[matchId]) {
playersStats[matchId] = {};
}
playersStats[matchId][playerName] = {
kills: kills,
deaths: deaths,
adr: adr,
team: team
};
// Сохраняем в localStorage
localStorage.setItem('cs2_players_stats', JSON.stringify(playersStats));
// Очищаем форму
document.getElementById('playerKills').value = '';
document.getElementById('playerDeaths').value = '';
document.getElementById('playerADR').value = '';
alert(`Статистика для ${playerName} в матче #${matchId} добавлена!`);
}
// Остальные функции сайта (переключение вкладок, отображение статистики и т.д.)
// ... (остаются без изменений)
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Novis4/cs-2" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |