File size: 29,966 Bytes
2a164d0 | 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 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | <!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Panel | Clip of The Year</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<style>
.submission-row:hover {
background-color: rgba(55, 65, 81, 0.5);
}
</style>
</head>
<body class="bg-gray-900 text-white">
<div class="min-h-screen">
<!-- Admin Header -->
<header class="bg-black bg-opacity-80 backdrop-blur-md sticky top-0 z-50">
<div class="container mx-auto px-4 py-4 flex justify-between items-center">
<div class="flex items-center space-x-2">
<i data-feather="shield" class="text-purple-500"></i>
<h1 class="text-2xl font-bold">Админ-панель</h1>
</div>
<button id="logout-admin" class="bg-red-600 hover:bg-red-700 px-4 py-2 rounded-md flex items-center space-x-2 transition">
<i data-feather="log-out"></i>
<span>Выйти</span>
</button>
</div>
</header>
<!-- Admin Content -->
<main class="container mx-auto px-4 py-8">
<div class="flex flex-col md:flex-row gap-8">
<!-- Sidebar -->
<aside class="md:w-64 bg-gray-800 rounded-xl p-4 h-fit sticky top-24">
<h2 class="text-xl font-bold mb-6 flex items-center">
<i data-feather="menu" class="mr-2"></i>
Меню
</h2>
<nav>
<ul class="space-y-2">
<li>
<button id="view-submissions" class="w-full text-left px-4 py-2 bg-purple-700 rounded-md font-medium">
<i data-feather="list" class="inline mr-2"></i>
Все заявки
</button>
</li>
<li>
<button id="view-stats" class="w-full text-left px-4 py-2 hover:bg-gray-700 rounded-md transition">
<i data-feather="bar-chart-2" class="inline mr-2"></i>
Статистика
</button>
</li>
<li>
<button id="view-settings" class="w-full text-left px-4 py-2 hover:bg-gray-700 rounded-md transition">
<i data-feather="settings" class="inline mr-2"></i>
Настройки
</button>
</li>
</ul>
</nav>
</aside>
<!-- Main Content -->
<div class="flex-1">
<!-- Submissions Section -->
<section id="submissions-section">
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-bold flex items-center">
<i data-feather="list" class="mr-2"></i>
Все заявки
</h2>
<div class="flex space-x-2">
<div class="relative">
<select id="filter-nomination" class="bg-gray-700 border border-gray-600 rounded-md px-4 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-purple-500 appearance-none">
<option value="">Все номинации</option>
<option value="1">"Бу! Испугался?"</option>
<option value="2">"Брошу стримы и пойду в киберспорт"</option>
<option value="3">"Буду как ЧА"</option>
<option value="4">"Команда мечты"</option>
<option value="5">"АУФ-момент"</option>
<option value="6">"BibleThump"</option>
<option value="7">"Ягами позавидует"</option>
<option value="8">"Это фиаско, братан"</option>
<option value="9">"Мимимимими"</option>
<option value="10">"Какая-то еще номинация"</option>
</select>
<i data-feather="chevron-down" class="absolute right-3 top-3 text-gray-400 pointer-events-none"></i>
</div>
<div class="relative">
<select id="filter-status" class="bg-gray-700 border border-gray-600 rounded-md px-4 py-2 pr-8 focus:outline-none focus:ring-2 focus:ring-purple-500 appearance-none">
<option value="">Все статусы</option>
<option value="На рассмотрении">На рассмотрении</option>
<option value="Одобрено">Одобрено</option>
<option value="Отклонено">Отклонено</option>
</select>
<i data-feather="chevron-down" class="absolute right-3 top-3 text-gray-400 pointer-events-none"></i>
</div>
</div>
</div>
<div class="bg-gray-800 rounded-xl overflow-hidden">
<table class="w-full">
<thead class="bg-gray-700">
<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>
<th class="px-6 py-3 text-right text-xs font-medium text-gray-300 uppercase tracking-wider">Действия</th>
</tr>
</thead>
<tbody id="submissions-table" class="divide-y divide-gray-700">
<!-- Submissions will be loaded here -->
</tbody>
</table>
</div>
<div class="mt-4 flex justify-between items-center">
<div class="text-sm text-gray-400">
Показано <span id="shown-count">0</span> из <span id="total-count">0</span> заявок
</div>
<div class="flex space-x-2">
<button id="prev-page" class="px-3 py-1 bg-gray-700 rounded-md disabled:opacity-50" disabled>
<i data-feather="chevron-left"></i>
</button>
<button id="next-page" class="px-3 py-1 bg-gray-700 rounded-md disabled:opacity-50" disabled>
<i data-feather="chevron-right"></i>
</button>
</div>
</div>
</section>
<!-- Stats Section -->
<section id="stats-section" class="hidden">
<h2 class="text-2xl font-bold mb-6 flex items-center">
<i data-feather="bar-chart-2" class="mr-2"></i>
Статистика
</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
<div class="bg-gray-800 rounded-xl p-6">
<div class="flex justify-between items-start">
<div>
<p class="text-gray-400">Всего заявок</p>
<p class="text-3xl font-bold mt-2">124</p>
</div>
<div class="bg-purple-600 bg-opacity-20 p-3 rounded-full">
<i data-feather="file-text" class="text-purple-400"></i>
</div>
</div>
</div>
<div class="bg-gray-800 rounded-xl p-6">
<div class="flex justify-between items-start">
<div>
<p class="text-gray-400">Уникальных участников</p>
<p class="text-3xl font-bold mt-2">87</p>
</div>
<div class="bg-blue-600 bg-opacity-20 p-3 rounded-full">
<i data-feather="users" class="text-blue-400"></i>
</div>
</div>
</div>
<div class="bg-gray-800 rounded-xl p-6">
<div class="flex justify-between items-start">
<div>
<p class="text-gray-400">Средний фоловеров</p>
<p class="text-3xl font-bold mt-2">1,240</p>
</div>
<div class="bg-green-600 bg-opacity-20 p-3 rounded-full">
<i data-feather="user-plus" class="text-green-400"></i>
</div>
</div>
</div>
</div>
<div class="bg-gray-800 rounded-xl p-6 mb-8">
<h3 class="text-lg font-medium mb-4">Заявки по номинациям</h3>
<div class="h-64">
<!-- Chart would go here -->
<div class="flex items-center justify-center h-full text-gray-500">
<i data-feather="bar-chart-2" class="w-16 h-16"></i>
<p class="ml-2">График заявок по номинациям</p>
</div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="bg-gray-800 rounded-xl p-6">
<h3 class="text-lg font-medium mb-4">Статусы заявок</h3>
<div class="h-64">
<!-- Chart would go here -->
<div class="flex items-center justify-center h-full text-gray-500">
<i data-feather="pie-chart" class="w-16 h-16"></i>
<p class="ml-2">График статусов заявок</p>
</div>
</div>
</div>
<div class="bg-gray-800 rounded-xl p-6">
<h3 class="text-lg font-medium mb-4">Активность по дням</h3>
<div class="h-64">
<!-- Chart would go here -->
<div class="flex items-center justify-center h-full text-gray-500">
<i data-feather="activity" class="w-16 h-16"></i>
<p class="ml-2">График активности</p>
</div>
</div>
</div>
</div>
</section>
<!-- Settings Section -->
<section id="settings-section" class="hidden">
<h2 class="text-2xl font-bold mb-6 flex items-center">
<i data-feather="settings" class="mr-2"></i>
Настройки
</h2>
<div class="bg-gray-800 rounded-xl p-6 mb-8">
<h3 class="text-lg font-medium mb-4">Основные настройки</h3>
<form class="space-y-4">
<div>
<label for="event-name" class="block mb-2 font-medium">Название премии</label>
<input type="text" id="event-name" class="w-full bg-gray-700 border border-gray-600 rounded-md px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500" value="Clip of The Year">
</div>
<div>
<label for="event-organizer" class="block mb-2 font-medium">Организатор</label>
<input type="text" id="event-organizer" class="w-full bg-gray-700 border border-gray-600 rounded-md px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500" value="FrunyaShow">
</div>
<div>
<label for="min-followers" class="block mb-2 font-medium">Минимальное количество подписчиков</label>
<input type="number" id="min-followers" class="w-full bg-gray-700 border border-gray-600 rounded-md px-4 py-2 focus:outline-none focus:ring-2 focus:ring-purple-500" value="50">
</div>
<div class="pt-2">
<button type="submit" class="bg-purple-600 hover:bg-purple-700 px-6 py-2 rounded-md font-medium transition">Сохранить</button>
</div>
</form>
</div>
<div class="bg-gray-800 rounded-xl p-6">
<h3 class="text-lg font-medium mb-4">Интеграции</h3>
<div class="space-y-6">
<div class="flex items-center justify-between">
<div>
<h4 class="font-medium">Google Sheets</h4>
<p class="text-sm text-gray-400">Подключение к Google Таблицам для хранения данных</p>
</div>
<button class="bg-green-600 hover:bg-green-700 px-4 py-2 rounded-md text-sm font-medium transition">Подключено</button>
</div>
<div class="flex items-center justify-between">
<div>
<h4 class="font-medium">Twitch API</h4>
<p class="text-sm text-gray-400">Авторизация через Twitch и проверка подписчиков</p>
</div>
<button class="bg-green-600 hover:bg-green-700 px-4 py-2 rounded-md text-sm font-medium transition">Подключено</button>
</div>
<div class="flex items-center justify-between">
<div>
<h4 class="font-medium">Discord Webhook</h4>
<p class="text-sm text-gray-400">Уведомления о новых заявках в Discord</p>
</div>
<button class="bg-gray-600 hover:bg-gray-700 px-4 py-2 rounded-md text-sm font-medium transition">Настроить</button>
</div>
</div>
</div>
</section>
</div>
</div>
</main>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
feather.replace();
// Navigation
const viewSubmissions = document.getElementById('view-submissions');
const viewStats = document.getElementById('view-stats');
const viewSettings = document.getElementById('view-settings');
const submissionsSection = document.getElementById('submissions-section');
const statsSection = document.getElementById('stats-section');
const settingsSection = document.getElementById('settings-section');
viewSubmissions.addEventListener('click', function() {
submissionsSection.classList.remove('hidden');
statsSection.classList.add('hidden');
settingsSection.classList.add('hidden');
viewSubmissions.classList.add('bg-purple-700');
viewStats.classList.remove('bg-purple-700');
viewSettings.classList.remove('bg-purple-700');
});
viewStats.addEventListener('click', function() {
submissionsSection.classList.add('hidden');
statsSection.classList.remove('hidden');
settingsSection.classList.add('hidden');
viewSubmissions.classList.remove('bg-purple-700');
viewStats.classList.add('bg-purple-700');
viewSettings.classList.remove('bg-purple-700');
});
viewSettings.addEventListener('click', function() {
submissionsSection.classList.add('hidden');
statsSection.classList.add('hidden');
settingsSection.classList.remove('hidden');
viewSubmissions.classList.remove('bg-purple-700');
viewStats.classList.remove('bg-purple-700');
viewSettings.classList.add('bg-purple-700');
});
// Logout
document.getElementById('logout-admin').addEventListener('click', function() {
window.location.href = 'index.html';
});
// Load submissions (mock data)
const submissionsTable = document.getElementById('submissions-table');
const totalCount = document.getElementById('total-count');
const shownCount = document.getElementById('shown-count');
// Mock data
const mockSubmissions = [
{
id: 1001,
streamer: 'FrunyaShow',
nomination: '"Бу! Испугался?"',
status: 'Одобрено',
date: '15.10.2023',
clipUrl: 'https://clips.twitch.tv/InventiveSuspiciousTrufflePogChamp',
description: 'Очень смешная реакция на скример'
},
{
id: 1002,
streamer: 'GamerPro',
nomination: '"Брошу стримы и пойду в киберспорт"',
status: 'На рассмотрении',
date: '16.10.2023',
clipUrl: 'https://clips.twitch.tv/StrongBenevolentCarrotPogChamp',
description: '360 ноускоуп в CS:GO'
},
{
id: 1003,
streamer: 'CosplayQueen',
nomination: '"Буду как ЧА"',
status: 'Отклонено',
date: '17.10.2023',
clipUrl: 'https://clips.twitch.tv/AgileBeautifulSushiPogChamp',
description: 'Бюджетный косплей на ЧА'
},
{
id: 1004,
streamer: 'TeamPlayer',
nomination: '"Команда мечты"',
status: 'На рассмотрении',
date: '18.10.2023',
clipUrl: 'https://clips.twitch.tv/FunnyVivaciousEggplantPogChamp',
description: 'Отличный момент в кооп-игре'
},
{
id: 1005,
streamer: 'WisdomMaster',
nomination: '"АУФ-момент"',
status: 'Одобрено',
date: '19.10.2023',
clipUrl: 'https://clips.twitch.tv/StrongBenevolentCarrotPogChamp',
description: 'Очень мудрый совет на стриме'
}
];
function renderSubmissions(submissions) {
submissionsTable.innerHTML = '';
if (submissions.length === 0) {
submissionsTable.innerHTML = `
<tr>
<td colspan="6" class="px-6 py-4 text-center text-gray-400">Нет заявок, соответствующих фильтрам</td>
</tr>
`;
return;
}
submissions.forEach(sub => {
const row = document.createElement('tr');
row.className = 'submission-row hover:bg-gray-700 transition cursor-pointer';
let statusClass = '';
if (sub.status === 'Одобрено') {
statusClass = 'bg-green-900 text-green-200';
} else if (sub.status === 'Отклонено') {
statusClass = 'bg-red-900 text-red-200';
} else {
statusClass = 'bg-yellow-900 text-yellow-200';
}
row.innerHTML = `
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium">${sub.id}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">${sub.streamer}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">${sub.nomination}</td>
<td class="px-6 py-4 whitespace-nowrap">
<span class="px-2 py-1 text-xs rounded-full ${statusClass}">${sub.status}</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-400">${sub.date}</td>
<td class="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">
<button class="text-purple-400 hover:text-purple-300 mr-2 view-submission" data-id="${sub.id}">
<i data-feather="eye" class="w-4 h-4"></i>
</button>
<button class="text-blue-400 hover:text-blue-300 mr-2 edit-submission" data-id="${sub.id}">
<i data-feather="edit" class="w-4 h-4"></i>
</button>
<button class="text-red-400 hover:text-red-300 delete-submission" data-id="${sub.id}">
<i data-feather="trash-2" class="w-4 h-4"></i>
</button>
</td>
`;
submissionsTable.appendChild(row);
});
totalCount.textContent = mockSubmissions.length;
shownCount.textContent = submissions.length;
feather.replace();
}
// Initial render
renderSubmissions(mockSubmissions);
// Filter submissions
const filterNomination = document.getElementById('filter-nomination');
const filterStatus = document.getElementById('filter-status');
function filterSubmissions() {
const nominationFilter = filterNomination.value;
const statusFilter = filterStatus.value;
let filtered = mockSubmissions;
if (nominationFilter) {
filtered = filtered.filter(sub => {
// In a real implementation, this would filter by nomination ID
return sub.nomination.includes(nominationFilter === '1' ? 'Бу! Испугался?' :
nominationFilter === '2' ? 'Брошу стримы' :
nominationFilter === '3' ? 'Буду как ЧА' : '');
});
}
if (statusFilter) {
filtered = filtered.filter(sub => sub.status === statusFilter);
}
renderSubmissions(filtered);
}
filterNomination.addEventListener('change', filterSubmissions);
filterStatus.addEventListener('change', filterSubmissions);
// View submission modal (would be implemented similarly to the user submission modal)
document.addEventListener('click', function(e) {
if (e.target.closest('.view-submission')) {
const subId = e.target.closest('button').getAttribute('data-id');
const submission = mockSubmissions.find(sub => sub.id == subId);
alert(`Просмотр заявки #${subId}\nСтример: ${submission.streamer}\nНоминация: ${submission.nomination}\nСтатус: ${submission.status}\nОписание: ${submission.description}\nСсылка: ${submission.clipUrl}`);
}
if (e.target.closest('.edit-submission')) {
const subId = e.target.closest('button').getAttribute('data-id');
alert(`Редактирование заявки #${subId}`);
}
if (e.target.closest('.delete-submission')) {
if (confirm('Вы уверены, что хотите удалить эту заявку?')) {
alert(`Заявка #${e.target.closest('button').getAttribute('data-id')} удалена`);
// In a real implementation, this would remove from Google Sheets
}
}
});
});
</script>
</body>
</html>
This solution includes:
1. **Main Website (index.html)**:
- Responsive design with TailwindCSS
- Twitch authentication integration
- Google Sheets API for data storage
- All 10 nomination categories with descriptions
- Clip submission form with preview
- Eligibility check for 50+ followers
- User profile section showing submissions
- Animated background with Vanta.js
- Smooth animations with AOS
2. **Admin Panel (admin.html)**:
- Dashboard to manage all submissions
- Filtering by nomination and status
- Statistics overview
- Settings management
- Integration status
- Responsive table for submissions
The implementation includes mock data and functions that would be replaced with actual Twitch OAuth and Google Sheets API calls in a production environment. The design is modern, user-friendly, and fully responsive across all device sizes. |