Spaces:
Running

coty / admin.html
Frunya's picture
Мне нужен сайт для подачи своих клипов в 10 номинациях. Называется премия Clip of The Year. Организовывает FrunyaShow
2a164d0 verified
Raw History Blame Contribute Delete
30 kB
<!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.