Spaces:
Running
Running
пошук аніме по оцін,Кількість епізодів,Рік релізу,Кількість оцінок,Віковий рейтинг,Тип,Статус тайтла оденаково як на https://v2.animelib.org/ru/catalog?seed=53e386923eaa6f8d66aa901b276ca556&tags[]=37
Browse files- catalog.html +379 -0
- index.html +46 -132
catalog.html
ADDED
|
@@ -0,0 +1,379 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>AnimeLib Explorer - Catalog</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 11 |
+
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.net.min.js"></script>
|
| 12 |
+
<style>
|
| 13 |
+
.anime-card:hover {
|
| 14 |
+
transform: translateY(-5px);
|
| 15 |
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
| 16 |
+
}
|
| 17 |
+
.custom-scrollbar::-webkit-scrollbar {
|
| 18 |
+
width: 6px;
|
| 19 |
+
}
|
| 20 |
+
.custom-scrollbar::-webkit-scrollbar-thumb {
|
| 21 |
+
background-color: rgba(236, 72, 153, 0.5);
|
| 22 |
+
border-radius: 3px;
|
| 23 |
+
}
|
| 24 |
+
</style>
|
| 25 |
+
</head>
|
| 26 |
+
<body class="bg-gray-900 text-gray-100">
|
| 27 |
+
<div id="vanta-bg" class="fixed inset-0 z-0"></div>
|
| 28 |
+
|
| 29 |
+
<!-- Header -->
|
| 30 |
+
<header class="relative z-10 bg-gray-900 bg-opacity-80 backdrop-blur-sm">
|
| 31 |
+
<div class="container mx-auto px-4 py-6">
|
| 32 |
+
<div class="flex flex-col md:flex-row justify-between items-center">
|
| 33 |
+
<div class="flex items-center mb-4 md:mb-0">
|
| 34 |
+
<a href="/" class="flex items-center">
|
| 35 |
+
<i data-feather="tv" class="text-pink-500 mr-2"></i>
|
| 36 |
+
<h1 class="text-2xl font-bold bg-gradient-to-r from-pink-500 to-purple-600 bg-clip-text text-transparent">AnimeLib Explorer</h1>
|
| 37 |
+
</a>
|
| 38 |
+
</div>
|
| 39 |
+
<div class="relative w-full md:w-64">
|
| 40 |
+
<input type="text" placeholder="Search anime..." id="searchInput" class="w-full bg-gray-800 rounded-full py-2 px-4 pl-10 text-gray-200 focus:outline-none focus:ring-2 focus:ring-pink-500">
|
| 41 |
+
<i data-feather="search" class="absolute left-3 top-2.5 text-gray-400"></i>
|
| 42 |
+
</div>
|
| 43 |
+
</div>
|
| 44 |
+
</div>
|
| 45 |
+
</header>
|
| 46 |
+
|
| 47 |
+
<!-- Main Content -->
|
| 48 |
+
<main class="relative z-10 container mx-auto px-4 py-8">
|
| 49 |
+
<!-- Filters -->
|
| 50 |
+
<div class="mb-8 p-6 bg-gray-800 bg-opacity-60 rounded-xl shadow-lg">
|
| 51 |
+
<h2 class="text-xl font-semibold mb-4 text-pink-400">Filters</h2>
|
| 52 |
+
<div class="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-4">
|
| 53 |
+
<div>
|
| 54 |
+
<label class="block text-sm font-medium text-gray-300 mb-1">Рейтинг</label>
|
| 55 |
+
<select id="ratingFilter" class="w-full bg-gray-700 rounded-md py-1 px-2 text-gray-200">
|
| 56 |
+
<option value="">Всі</option>
|
| 57 |
+
<option value="9">9+</option>
|
| 58 |
+
<option value="8">8+</option>
|
| 59 |
+
<option value="7">7+</option>
|
| 60 |
+
<option value="6">6+</option>
|
| 61 |
+
</select>
|
| 62 |
+
</div>
|
| 63 |
+
<div>
|
| 64 |
+
<label class="block text-sm font-medium text-gray-300 mb-1">Кількість епізодів</label>
|
| 65 |
+
<select id="episodesFilter" class="w-full bg-gray-700 rounded-md py-1 px-2 text-gray-200">
|
| 66 |
+
<option value="">Всі</option>
|
| 67 |
+
<option value="1-12">1-12</option>
|
| 68 |
+
<option value="13-24">13-24</option>
|
| 69 |
+
<option value="25+">25+</option>
|
| 70 |
+
</select>
|
| 71 |
+
</div>
|
| 72 |
+
<div>
|
| 73 |
+
<label class="block text-sm font-medium text-gray-300 mb-1">Рік релізу</label>
|
| 74 |
+
<select id="yearFilter" class="w-full bg-gray-700 rounded-md py-1 px-2 text-gray-200">
|
| 75 |
+
<option value="">Всі</option>
|
| 76 |
+
<option value="2020">2020s</option>
|
| 77 |
+
<option value="2010">2010s</option>
|
| 78 |
+
<option value="2000">2000s</option>
|
| 79 |
+
</select>
|
| 80 |
+
</div>
|
| 81 |
+
<div>
|
| 82 |
+
<label class="block text-sm font-medium text-gray-300 mb-1">Кількість оцінок</label>
|
| 83 |
+
<select id="votesFilter" class="w-full bg-gray-700 rounded-md py-1 px-2 text-gray-200">
|
| 84 |
+
<option value="">Всі</option>
|
| 85 |
+
<option value="10000">10k+</option>
|
| 86 |
+
<option value="50000">50k+</option>
|
| 87 |
+
<option value="100000">100k+</option>
|
| 88 |
+
</select>
|
| 89 |
+
</div>
|
| 90 |
+
<div>
|
| 91 |
+
<label class="block text-sm font-medium text-gray-300 mb-1">Віковий рейтинг</label>
|
| 92 |
+
<select id="ageRatingFilter" class="w-full bg-gray-700 rounded-md py-1 px-2 text-gray-200">
|
| 93 |
+
<option value="">Всі</option>
|
| 94 |
+
<option value="G">G</option>
|
| 95 |
+
<option value="PG">PG</option>
|
| 96 |
+
<option value="PG-13">PG-13</option>
|
| 97 |
+
<option value="R">R</option>
|
| 98 |
+
</select>
|
| 99 |
+
</div>
|
| 100 |
+
<div>
|
| 101 |
+
<label class="block text-sm font-medium text-gray-300 mb-1">Тип</label>
|
| 102 |
+
<select id="typeFilter" class="w-full bg-gray-700 rounded-md py-1 px-2 text-gray-200">
|
| 103 |
+
<option value="">Всі</option>
|
| 104 |
+
<option value="TV">TV</option>
|
| 105 |
+
<option value="Movie">Movie</option>
|
| 106 |
+
<option value="OVA">OVA</option>
|
| 107 |
+
</select>
|
| 108 |
+
</div>
|
| 109 |
+
<div>
|
| 110 |
+
<label class="block text-sm font-medium text-gray-300 mb-1">Статус</label>
|
| 111 |
+
<select id="statusFilter" class="w-full bg-gray-700 rounded-md py-1 px-2 text-gray-200">
|
| 112 |
+
<option value="">Всі</option>
|
| 113 |
+
<option value="ongoing">Онґоїнг</option>
|
| 114 |
+
<option value="completed">Завершений</option>
|
| 115 |
+
</select>
|
| 116 |
+
</div>
|
| 117 |
+
</div>
|
| 118 |
+
<button id="applyFilters" class="mt-4 bg-pink-600 hover:bg-pink-700 text-white py-2 px-6 rounded-full flex items-center">
|
| 119 |
+
<i data-feather="filter" class="mr-2"></i> Застосувати фільтри
|
| 120 |
+
</button>
|
| 121 |
+
</div>
|
| 122 |
+
|
| 123 |
+
<!-- Anime Grid -->
|
| 124 |
+
<div class="mb-8">
|
| 125 |
+
<div class="flex justify-between items-center mb-6">
|
| 126 |
+
<h2 class="text-2xl font-bold text-pink-400">Результати пошуку</h2>
|
| 127 |
+
<div class="flex space-x-2">
|
| 128 |
+
<button id="gridView" class="p-2 rounded-full bg-gray-800 hover:bg-gray-700">
|
| 129 |
+
<i data-feather="grid"></i>
|
| 130 |
+
</button>
|
| 131 |
+
<button id="listView" class="p-2 rounded-full bg-gray-800 hover:bg-gray-700">
|
| 132 |
+
<i data-feather="list"></i>
|
| 133 |
+
</button>
|
| 134 |
+
</div>
|
| 135 |
+
</div>
|
| 136 |
+
|
| 137 |
+
<div id="animeGrid" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-6">
|
| 138 |
+
<!-- Anime cards will be loaded dynamically -->
|
| 139 |
+
</div>
|
| 140 |
+
</div>
|
| 141 |
+
|
| 142 |
+
<!-- Pagination -->
|
| 143 |
+
<div id="pagination" class="flex justify-center">
|
| 144 |
+
<!-- Pagination will be loaded dynamically -->
|
| 145 |
+
</div>
|
| 146 |
+
</main>
|
| 147 |
+
|
| 148 |
+
<!-- Footer -->
|
| 149 |
+
<footer class="relative z-10 bg-gray-900 bg-opacity-80 mt-12 py-8">
|
| 150 |
+
<div class="container mx-auto px-4">
|
| 151 |
+
<div class="flex flex-col md:flex-row justify-between items-center">
|
| 152 |
+
<div class="mb-4 md:mb-0">
|
| 153 |
+
<div class="flex items-center">
|
| 154 |
+
<i data-feather="tv" class="text-pink-500 mr-2"></i>
|
| 155 |
+
<span class="text-xl font-bold bg-gradient-to-r from-pink-500 to-purple-600 bg-clip-text text-transparent">AnimeLib Explorer</span>
|
| 156 |
+
</div>
|
| 157 |
+
<p class="text-gray-400 text-sm mt-2">Знайдіть своє нове улюблене аніме</p>
|
| 158 |
+
</div>
|
| 159 |
+
<div class="flex space-x-6">
|
| 160 |
+
<a href="#" class="text-gray-400 hover:text-pink-500">
|
| 161 |
+
<i data-feather="github"></i>
|
| 162 |
+
</a>
|
| 163 |
+
<a href="#" class="text-gray-400 hover:text-pink-500">
|
| 164 |
+
<i data-feather="twitter"></i>
|
| 165 |
+
</a>
|
| 166 |
+
<a href="#" class="text-gray-400 hover:text-pink-500">
|
| 167 |
+
<i data-feather="discord"></i>
|
| 168 |
+
</a>
|
| 169 |
+
</div>
|
| 170 |
+
</div>
|
| 171 |
+
<div class="border-t border-gray-800 mt-6 pt-6 text-sm text-gray-500 text-center">
|
| 172 |
+
© 2023 AnimeLib Explorer. Всі дані про аніме взяті з публічного API AnimeLib.
|
| 173 |
+
</div>
|
| 174 |
+
</div>
|
| 175 |
+
</footer>
|
| 176 |
+
|
| 177 |
+
<script>
|
| 178 |
+
// Initialize Vanta.js background
|
| 179 |
+
VANTA.NET({
|
| 180 |
+
el: "#vanta-bg",
|
| 181 |
+
mouseControls: true,
|
| 182 |
+
touchControls: true,
|
| 183 |
+
gyroControls: false,
|
| 184 |
+
minHeight: 200.00,
|
| 185 |
+
minWidth: 200.00,
|
| 186 |
+
scale: 1.00,
|
| 187 |
+
scaleMobile: 1.00,
|
| 188 |
+
color: 0xec4899,
|
| 189 |
+
backgroundColor: 0x111827,
|
| 190 |
+
points: 10.00,
|
| 191 |
+
maxDistance: 20.00,
|
| 192 |
+
spacing: 15.00
|
| 193 |
+
});
|
| 194 |
+
|
| 195 |
+
// Initialize Feather Icons
|
| 196 |
+
feather.replace();
|
| 197 |
+
|
| 198 |
+
// Get URL parameters
|
| 199 |
+
const urlParams = new URLSearchParams(window.location.search);
|
| 200 |
+
|
| 201 |
+
// Set filter values from URL
|
| 202 |
+
document.getElementById('ratingFilter').value = urlParams.get('rating') || '';
|
| 203 |
+
document.getElementById('episodesFilter').value = urlParams.get('episodes') || '';
|
| 204 |
+
document.getElementById('yearFilter').value = urlParams.get('year') || '';
|
| 205 |
+
document.getElementById('votesFilter').value = urlParams.get('votes') || '';
|
| 206 |
+
document.getElementById('ageRatingFilter').value = urlParams.get('ageRating') || '';
|
| 207 |
+
document.getElementById('typeFilter').value = urlParams.get('type') || '';
|
| 208 |
+
document.getElementById('statusFilter').value = urlParams.get('status') || '';
|
| 209 |
+
document.getElementById('searchInput').value = urlParams.get('search') || '';
|
| 210 |
+
|
| 211 |
+
// Function to load anime data from API
|
| 212 |
+
async function loadAnimeData() {
|
| 213 |
+
try {
|
| 214 |
+
// Construct API URL with filters
|
| 215 |
+
let apiUrl = '/api/anime?';
|
| 216 |
+
|
| 217 |
+
if (urlParams.get('rating')) apiUrl += `&rating=${urlParams.get('rating')}`;
|
| 218 |
+
if (urlParams.get('episodes')) apiUrl += `&episodes=${urlParams.get('episodes')}`;
|
| 219 |
+
if (urlParams.get('year')) apiUrl += `&year=${urlParams.get('year')}`;
|
| 220 |
+
if (urlParams.get('votes')) apiUrl += `&votes=${urlParams.get('votes')}`;
|
| 221 |
+
if (urlParams.get('ageRating')) apiUrl += `&ageRating=${urlParams.get('ageRating')}`;
|
| 222 |
+
if (urlParams.get('type')) apiUrl += `&type=${urlParams.get('type')}`;
|
| 223 |
+
if (urlParams.get('status')) apiUrl += `&status=${urlParams.get('status')}`;
|
| 224 |
+
if (urlParams.get('search')) apiUrl += `&search=${urlParams.get('search')}`;
|
| 225 |
+
|
| 226 |
+
const response = await fetch(apiUrl);
|
| 227 |
+
const data = await response.json();
|
| 228 |
+
|
| 229 |
+
// Display anime data
|
| 230 |
+
displayAnimeData(data.anime);
|
| 231 |
+
|
| 232 |
+
// Display pagination
|
| 233 |
+
displayPagination(data.totalPages, data.currentPage);
|
| 234 |
+
|
| 235 |
+
} catch (error) {
|
| 236 |
+
console.error('Error loading anime data:', error);
|
| 237 |
+
}
|
| 238 |
+
}
|
| 239 |
+
|
| 240 |
+
// Function to display anime data
|
| 241 |
+
function displayAnimeData(animeList) {
|
| 242 |
+
const animeGrid = document.getElementById('animeGrid');
|
| 243 |
+
animeGrid.innerHTML = '';
|
| 244 |
+
|
| 245 |
+
animeList.forEach(anime => {
|
| 246 |
+
const animeCard = document.createElement('div');
|
| 247 |
+
animeCard.className = 'anime-card bg-gray-800 bg-opacity-60 rounded-xl overflow-hidden shadow-md transition-all duration-300';
|
| 248 |
+
animeCard.innerHTML = `
|
| 249 |
+
<div class="relative">
|
| 250 |
+
<img src="${anime.image || 'http://static.photos/anime/320x240/1'}" alt="${anime.title}" class="w-full h-48 object-cover">
|
| 251 |
+
<div class="absolute top-2 left-2 bg-pink-600 text-white text-xs font-bold px-2 py-1 rounded">
|
| 252 |
+
${anime.rating || 'N/A'}
|
| 253 |
+
</div>
|
| 254 |
+
</div>
|
| 255 |
+
<div class="p-4">
|
| 256 |
+
<h3 class="font-bold text-white mb-1 truncate">${anime.title}</h3>
|
| 257 |
+
<div class="flex justify-between text-xs text-gray-400 mb-2">
|
| 258 |
+
<span>${anime.type || 'Unknown'} • ${anime.episodes || '?'} eps</span>
|
| 259 |
+
<span>${anime.year || 'Unknown'}</span>
|
| 260 |
+
</div>
|
| 261 |
+
<div class="flex flex-wrap gap-1">
|
| 262 |
+
${anime.genres?.map(genre => `<span class="text-xs bg-gray-700 px-2 py-0.5 rounded">${genre}</span>`).join('') || ''}
|
| 263 |
+
</div>
|
| 264 |
+
</div>
|
| 265 |
+
`;
|
| 266 |
+
animeGrid.appendChild(animeCard);
|
| 267 |
+
});
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
// Function to display pagination
|
| 271 |
+
function displayPagination(totalPages, currentPage) {
|
| 272 |
+
const pagination = document.getElementById('pagination');
|
| 273 |
+
pagination.innerHTML = '';
|
| 274 |
+
|
| 275 |
+
const nav = document.createElement('nav');
|
| 276 |
+
nav.className = 'flex items-center space-x-2';
|
| 277 |
+
|
| 278 |
+
// Previous button
|
| 279 |
+
const prevButton = document.createElement('button');
|
| 280 |
+
prevButton.className = 'p-2 rounded-full bg-gray-800 hover:bg-gray-700';
|
| 281 |
+
prevButton.innerHTML = '<i data-feather="chevron-left"></i>';
|
| 282 |
+
prevButton.addEventListener('click', () => {
|
| 283 |
+
if (currentPage > 1) {
|
| 284 |
+
urlParams.set('page', currentPage - 1);
|
| 285 |
+
window.location.search = urlParams.toString();
|
| 286 |
+
}
|
| 287 |
+
});
|
| 288 |
+
nav.appendChild(prevButton);
|
| 289 |
+
|
| 290 |
+
// Page buttons
|
| 291 |
+
for (let i = 1; i <= totalPages; i++) {
|
| 292 |
+
const pageButton = document.createElement('button');
|
| 293 |
+
pageButton.className = `w-10 h-10 rounded-full ${i === currentPage ? 'bg-pink-600 text-white' : 'bg-gray-800 hover:bg-gray-700'}`;
|
| 294 |
+
pageButton.textContent = i;
|
| 295 |
+
pageButton.addEventListener('click', () => {
|
| 296 |
+
urlParams.set('page', i);
|
| 297 |
+
window.location.search = urlParams.toString();
|
| 298 |
+
});
|
| 299 |
+
nav.appendChild(pageButton);
|
| 300 |
+
}
|
| 301 |
+
|
| 302 |
+
// Next button
|
| 303 |
+
const nextButton = document.createElement('button');
|
| 304 |
+
nextButton.className = 'p-2 rounded-full bg-gray-800 hover:bg-gray-700';
|
| 305 |
+
nextButton.innerHTML = '<i data-feather="chevron-right"></i>';
|
| 306 |
+
nextButton.addEventListener('click', () => {
|
| 307 |
+
if (currentPage < totalPages) {
|
| 308 |
+
urlParams.set('page', currentPage + 1);
|
| 309 |
+
window.location.search = urlParams.toString();
|
| 310 |
+
}
|
| 311 |
+
});
|
| 312 |
+
nav.appendChild(nextButton);
|
| 313 |
+
|
| 314 |
+
pagination.appendChild(nav);
|
| 315 |
+
feather.replace();
|
| 316 |
+
}
|
| 317 |
+
|
| 318 |
+
// Apply filters button
|
| 319 |
+
document.getElementById('applyFilters').addEventListener('click', function() {
|
| 320 |
+
const rating = document.getElementById('ratingFilter').value;
|
| 321 |
+
const episodes = document.getElementById('episodesFilter').value;
|
| 322 |
+
const year = document.getElementById('yearFilter').value;
|
| 323 |
+
const votes = document.getElementById('votesFilter').value;
|
| 324 |
+
const ageRating = document.getElementById('ageRatingFilter').value;
|
| 325 |
+
const type = document.getElementById('typeFilter').value;
|
| 326 |
+
const status = document.getElementById('statusFilter').value;
|
| 327 |
+
const searchQuery = document.getElementById('searchInput').value.toLowerCase();
|
| 328 |
+
|
| 329 |
+
// Reset to page 1 when applying new filters
|
| 330 |
+
urlParams.delete('page');
|
| 331 |
+
|
| 332 |
+
if (rating) urlParams.set('rating', rating);
|
| 333 |
+
else urlParams.delete('rating');
|
| 334 |
+
|
| 335 |
+
if (episodes) urlParams.set('episodes', episodes);
|
| 336 |
+
else urlParams.delete('episodes');
|
| 337 |
+
|
| 338 |
+
if (year) urlParams.set('year', year);
|
| 339 |
+
else urlParams.delete('year');
|
| 340 |
+
|
| 341 |
+
if (votes) urlParams.set('votes', votes);
|
| 342 |
+
else urlParams.delete('votes');
|
| 343 |
+
|
| 344 |
+
if (ageRating) urlParams.set('ageRating', ageRating);
|
| 345 |
+
else urlParams.delete('ageRating');
|
| 346 |
+
|
| 347 |
+
if (type) urlParams.set('type', type);
|
| 348 |
+
else urlParams.delete('type');
|
| 349 |
+
|
| 350 |
+
if (status) urlParams.set('status', status);
|
| 351 |
+
else urlParams.delete('status');
|
| 352 |
+
|
| 353 |
+
if (searchQuery) urlParams.set('search', searchQuery);
|
| 354 |
+
else urlParams.delete('search');
|
| 355 |
+
|
| 356 |
+
window.location.search = urlParams.toString();
|
| 357 |
+
});
|
| 358 |
+
|
| 359 |
+
// Handle Enter key in search
|
| 360 |
+
document.getElementById('searchInput').addEventListener('keypress', function(e) {
|
| 361 |
+
if (e.key === 'Enter') {
|
| 362 |
+
document.getElementById('applyFilters').click();
|
| 363 |
+
}
|
| 364 |
+
});
|
| 365 |
+
|
| 366 |
+
// View toggle buttons
|
| 367 |
+
document.getElementById('gridView').addEventListener('click', function() {
|
| 368 |
+
document.getElementById('animeGrid').className = 'grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-6';
|
| 369 |
+
});
|
| 370 |
+
|
| 371 |
+
document.getElementById('listView').addEventListener('click', function() {
|
| 372 |
+
document.getElementById('animeGrid').className = 'grid grid-cols-1 gap-4';
|
| 373 |
+
});
|
| 374 |
+
|
| 375 |
+
// Load initial data
|
| 376 |
+
loadAnimeData();
|
| 377 |
+
</script>
|
| 378 |
+
</body>
|
| 379 |
+
</html>
|
index.html
CHANGED
|
@@ -35,10 +35,10 @@
|
|
| 35 |
<h1 class="text-2xl font-bold bg-gradient-to-r from-pink-500 to-purple-600 bg-clip-text text-transparent">AnimeLib Explorer</h1>
|
| 36 |
</div>
|
| 37 |
<div class="relative w-full md:w-64">
|
| 38 |
-
<input type="text" placeholder="Search anime..." class="w-full bg-gray-800 rounded-full py-2 px-4 pl-10 text-gray-200 focus:outline-none focus:ring-2 focus:ring-pink-500">
|
| 39 |
<i data-feather="search" class="absolute left-3 top-2.5 text-gray-400"></i>
|
| 40 |
</div>
|
| 41 |
-
|
| 42 |
</div>
|
| 43 |
</header>
|
| 44 |
|
|
@@ -113,10 +113,10 @@
|
|
| 113 |
</select>
|
| 114 |
</div>
|
| 115 |
</div>
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
</button>
|
| 119 |
-
|
| 120 |
|
| 121 |
<!-- Anime Grid -->
|
| 122 |
<div class="mb-8">
|
|
@@ -131,132 +131,15 @@
|
|
| 131 |
</button>
|
| 132 |
</div>
|
| 133 |
</div>
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
<div class="anime-card bg-gray-800 bg-opacity-60 rounded-xl overflow-hidden shadow-md transition-all duration-300">
|
| 138 |
-
<div class="relative">
|
| 139 |
-
<img src="http://static.photos/anime/320x240/1" alt="Anime Cover" class="w-full h-48 object-cover">
|
| 140 |
-
<div class="absolute top-2 left-2 bg-pink-600 text-white text-xs font-bold px-2 py-1 rounded">
|
| 141 |
-
9.2
|
| 142 |
-
</div>
|
| 143 |
-
</div>
|
| 144 |
-
<div class="p-4">
|
| 145 |
-
<h3 class="font-bold text-white mb-1 truncate">Attack on Titan</h3>
|
| 146 |
-
<div class="flex justify-between text-xs text-gray-400 mb-2">
|
| 147 |
-
<span>TV • 24 eps</span>
|
| 148 |
-
<span>2023</span>
|
| 149 |
-
</div>
|
| 150 |
-
<div class="flex flex-wrap gap-1">
|
| 151 |
-
<span class="text-xs bg-gray-700 px-2 py-0.5 rounded">Action</span>
|
| 152 |
-
<span class="text-xs bg-gray-700 px-2 py-0.5 rounded">Drama</span>
|
| 153 |
-
</div>
|
| 154 |
-
</div>
|
| 155 |
-
</div>
|
| 156 |
-
|
| 157 |
-
<!-- Anime Card 2 -->
|
| 158 |
-
<div class="anime-card bg-gray-800 bg-opacity-60 rounded-xl overflow-hidden shadow-md transition-all duration-300">
|
| 159 |
-
<div class="relative">
|
| 160 |
-
<img src="http://static.photos/anime/320x240/2" alt="Anime Cover" class="w-full h-48 object-cover">
|
| 161 |
-
<div class="absolute top-2 left-2 bg-pink-600 text-white text-xs font-bold px-2 py-1 rounded">
|
| 162 |
-
8.9
|
| 163 |
-
</div>
|
| 164 |
-
</div>
|
| 165 |
-
<div class="p-4">
|
| 166 |
-
<h3 class="font-bold text-white mb-1 truncate">Demon Slayer</h3>
|
| 167 |
-
<div class="flex justify-between text-xs text-gray-400 mb-2">
|
| 168 |
-
<span>TV • 26 eps</span>
|
| 169 |
-
<span>2019</span>
|
| 170 |
-
</div>
|
| 171 |
-
<div class="flex flex-wrap gap-1">
|
| 172 |
-
<span class="text-xs bg-gray-700 px-2 py-0.5 rounded">Action</span>
|
| 173 |
-
<span class="text-xs bg-gray-700 px-2 py-0.5 rounded">Fantasy</span>
|
| 174 |
-
</div>
|
| 175 |
-
</div>
|
| 176 |
-
</div>
|
| 177 |
-
|
| 178 |
-
<!-- Anime Card 3 -->
|
| 179 |
-
<div class="anime-card bg-gray-800 bg-opacity-60 rounded-xl overflow-hidden shadow-md transition-all duration-300">
|
| 180 |
-
<div class="relative">
|
| 181 |
-
<img src="http://static.photos/anime/320x240/3" alt="Anime Cover" class="w-full h-48 object-cover">
|
| 182 |
-
<div class="absolute top-2 left-2 bg-pink-600 text-white text-xs font-bold px-2 py-1 rounded">
|
| 183 |
-
9.1
|
| 184 |
-
</div>
|
| 185 |
-
</div>
|
| 186 |
-
<div class="p-4">
|
| 187 |
-
<h3 class="font-bold text-white mb-1 truncate">Jujutsu Kaisen</h3>
|
| 188 |
-
<div class="flex justify-between text-xs text-gray-400 mb-2">
|
| 189 |
-
<span>TV • 24 eps</span>
|
| 190 |
-
<span>2020</span>
|
| 191 |
-
</div>
|
| 192 |
-
<div class="flex flex-wrap gap-1">
|
| 193 |
-
<span class="text-xs bg-gray-700 px-2 py-0.5 rounded">Action</span>
|
| 194 |
-
<span class="text-xs bg-gray-700 px-2 py-0.5 rounded">Supernatural</span>
|
| 195 |
-
</div>
|
| 196 |
-
</div>
|
| 197 |
-
</div>
|
| 198 |
-
|
| 199 |
-
<!-- Anime Card 4 -->
|
| 200 |
-
<div class="anime-card bg-gray-800 bg-opacity-60 rounded-xl overflow-hidden shadow-md transition-all duration-300">
|
| 201 |
-
<div class="relative">
|
| 202 |
-
<img src="http://static.photos/anime/320x240/4" alt="Anime Cover" class="w-full h-48 object-cover">
|
| 203 |
-
<div class="absolute top-2 left-2 bg-pink-600 text-white text-xs font-bold px-2 py-1 rounded">
|
| 204 |
-
8.7
|
| 205 |
-
</div>
|
| 206 |
-
</div>
|
| 207 |
-
<div class="p-4">
|
| 208 |
-
<h3 class="font-bold text-white mb-1 truncate">My Hero Academia</h3>
|
| 209 |
-
<div class="flex justify-between text-xs text-gray-400 mb-2">
|
| 210 |
-
<span>TV • 25 eps</span>
|
| 211 |
-
<span>2016</span>
|
| 212 |
-
</div>
|
| 213 |
-
<div class="flex flex-wrap gap-1">
|
| 214 |
-
<span class="text-xs bg-gray-700 px-2 py-0.5 rounded">Action</span>
|
| 215 |
-
<span class="text-xs bg-gray-700 px-2 py-0.5 rounded">School</span>
|
| 216 |
-
</div>
|
| 217 |
-
</div>
|
| 218 |
-
</div>
|
| 219 |
-
|
| 220 |
-
<!-- Anime Card 5 -->
|
| 221 |
-
<div class="anime-card bg-gray-800 bg-opacity-60 rounded-xl overflow-hidden shadow-md transition-all duration-300">
|
| 222 |
-
<div class="relative">
|
| 223 |
-
<img src="http://static.photos/anime/320x240/5" alt="Anime Cover" class="w-full h-48 object-cover">
|
| 224 |
-
<div class="absolute top-2 left-2 bg-pink-600 text-white text-xs font-bold px-2 py-1 rounded">
|
| 225 |
-
8.8
|
| 226 |
-
</div>
|
| 227 |
-
</div>
|
| 228 |
-
<div class="p-4">
|
| 229 |
-
<h3 class="font-bold text-white mb-1 truncate">One Piece</h3>
|
| 230 |
-
<div class="flex justify-between text-xs text-gray-400 mb-2">
|
| 231 |
-
<span>TV • 1000+ eps</span>
|
| 232 |
-
<span>1999</span>
|
| 233 |
-
</div>
|
| 234 |
-
<div class="flex flex-wrap gap-1">
|
| 235 |
-
<span class="text-xs bg-gray-700 px-2 py-0.5 rounded">Adventure</span>
|
| 236 |
-
<span class="text-xs bg-gray-700 px-2 py-0.5 rounded">Comedy</span>
|
| 237 |
-
</div>
|
| 238 |
-
</div>
|
| 239 |
-
</div>
|
| 240 |
-
</div>
|
| 241 |
</div>
|
| 242 |
-
|
| 243 |
<!-- Pagination -->
|
| 244 |
-
<div class="flex justify-center">
|
| 245 |
-
<
|
| 246 |
-
<button class="p-2 rounded-full bg-gray-800 hover:bg-gray-700">
|
| 247 |
-
<i data-feather="chevron-left"></i>
|
| 248 |
-
</button>
|
| 249 |
-
<button class="w-10 h-10 rounded-full bg-pink-600 text-white font-medium">1</button>
|
| 250 |
-
<button class="w-10 h-10 rounded-full bg-gray-800 hover:bg-gray-700">2</button>
|
| 251 |
-
<button class="w-10 h-10 rounded-full bg-gray-800 hover:bg-gray-700">3</button>
|
| 252 |
-
<span class="mx-1">...</span>
|
| 253 |
-
<button class="w-10 h-10 rounded-full bg-gray-800 hover:bg-gray-700">10</button>
|
| 254 |
-
<button class="p-2 rounded-full bg-gray-800 hover:bg-gray-700">
|
| 255 |
-
<i data-feather="chevron-right"></i>
|
| 256 |
-
</button>
|
| 257 |
-
</nav>
|
| 258 |
</div>
|
| 259 |
-
|
| 260 |
|
| 261 |
<!-- Footer -->
|
| 262 |
<footer class="relative z-10 bg-gray-900 bg-opacity-80 mt-12 py-8">
|
|
@@ -286,8 +169,7 @@
|
|
| 286 |
</div>
|
| 287 |
</div>
|
| 288 |
</footer>
|
| 289 |
-
|
| 290 |
-
<script>
|
| 291 |
// Initialize Vanta.js background
|
| 292 |
VANTA.NET({
|
| 293 |
el: "#vanta-bg",
|
|
@@ -307,6 +189,38 @@
|
|
| 307 |
|
| 308 |
// Initialize Feather Icons
|
| 309 |
feather.replace();
|
| 310 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 311 |
</body>
|
| 312 |
</html>
|
|
|
|
| 35 |
<h1 class="text-2xl font-bold bg-gradient-to-r from-pink-500 to-purple-600 bg-clip-text text-transparent">AnimeLib Explorer</h1>
|
| 36 |
</div>
|
| 37 |
<div class="relative w-full md:w-64">
|
| 38 |
+
<input type="text" placeholder="Search anime..." id="searchInput" class="w-full bg-gray-800 rounded-full py-2 px-4 pl-10 text-gray-200 focus:outline-none focus:ring-2 focus:ring-pink-500">
|
| 39 |
<i data-feather="search" class="absolute left-3 top-2.5 text-gray-400"></i>
|
| 40 |
</div>
|
| 41 |
+
</div>
|
| 42 |
</div>
|
| 43 |
</header>
|
| 44 |
|
|
|
|
| 113 |
</select>
|
| 114 |
</div>
|
| 115 |
</div>
|
| 116 |
+
<button id="applyFilters" class="mt-4 bg-pink-600 hover:bg-pink-700 text-white py-2 px-6 rounded-full flex items-center">
|
| 117 |
+
<i data-feather="filter" class="mr-2"></i> Застосувати фільтри
|
| 118 |
+
</button>
|
| 119 |
+
</div>
|
| 120 |
|
| 121 |
<!-- Anime Grid -->
|
| 122 |
<div class="mb-8">
|
|
|
|
| 131 |
</button>
|
| 132 |
</div>
|
| 133 |
</div>
|
| 134 |
+
<div id="animeGrid" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-6">
|
| 135 |
+
<!-- Anime cards will be loaded dynamically -->
|
| 136 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
</div>
|
|
|
|
| 138 |
<!-- Pagination -->
|
| 139 |
+
<div id="pagination" class="flex justify-center">
|
| 140 |
+
<!-- Pagination will be loaded dynamically -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
</div>
|
| 142 |
+
</main>
|
| 143 |
|
| 144 |
<!-- Footer -->
|
| 145 |
<footer class="relative z-10 bg-gray-900 bg-opacity-80 mt-12 py-8">
|
|
|
|
| 169 |
</div>
|
| 170 |
</div>
|
| 171 |
</footer>
|
| 172 |
+
<script>
|
|
|
|
| 173 |
// Initialize Vanta.js background
|
| 174 |
VANTA.NET({
|
| 175 |
el: "#vanta-bg",
|
|
|
|
| 189 |
|
| 190 |
// Initialize Feather Icons
|
| 191 |
feather.replace();
|
| 192 |
+
|
| 193 |
+
// Filter and search functionality
|
| 194 |
+
document.getElementById('applyFilters').addEventListener('click', function() {
|
| 195 |
+
const rating = document.querySelector('select:nth-of-type(1)').value;
|
| 196 |
+
const episodes = document.querySelector('select:nth-of-type(2)').value;
|
| 197 |
+
const year = document.querySelector('select:nth-of-type(3)').value;
|
| 198 |
+
const votes = document.querySelector('select:nth-of-type(4)').value;
|
| 199 |
+
const ageRating = document.querySelector('select:nth-of-type(5)').value;
|
| 200 |
+
const type = document.querySelector('select:nth-of-type(6)').value;
|
| 201 |
+
const status = document.querySelector('select:nth-of-type(7)').value;
|
| 202 |
+
const searchQuery = document.getElementById('searchInput').value.toLowerCase();
|
| 203 |
+
|
| 204 |
+
const queryParams = new URLSearchParams();
|
| 205 |
+
|
| 206 |
+
if (rating !== 'Всі') queryParams.append('rating', rating);
|
| 207 |
+
if (episodes !== 'Всі') queryParams.append('episodes', episodes);
|
| 208 |
+
if (year !== 'Всі') queryParams.append('year', year);
|
| 209 |
+
if (votes !== 'Всі') queryParams.append('votes', votes);
|
| 210 |
+
if (ageRating !== 'Всі') queryParams.append('ageRating', ageRating);
|
| 211 |
+
if (type !== 'Всі') queryParams.append('type', type);
|
| 212 |
+
if (status !== 'Всі') queryParams.append('status', status);
|
| 213 |
+
if (searchQuery) queryParams.append('search', searchQuery);
|
| 214 |
+
|
| 215 |
+
window.location.href = `/catalog?${queryParams.toString()}`;
|
| 216 |
+
});
|
| 217 |
+
|
| 218 |
+
// Handle Enter key in search
|
| 219 |
+
document.getElementById('searchInput').addEventListener('keypress', function(e) {
|
| 220 |
+
if (e.key === 'Enter') {
|
| 221 |
+
document.getElementById('applyFilters').click();
|
| 222 |
+
}
|
| 223 |
+
});
|
| 224 |
+
</script>
|
| 225 |
</body>
|
| 226 |
</html>
|