forked from anime-kun32/AniTeams-amvstrm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetails.html
More file actions
304 lines (266 loc) · 11 KB
/
details.html
File metadata and controls
304 lines (266 loc) · 11 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Loading....</title>
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
<link href="css/details.css" rel="stylesheet">
</head>
<body class="bg-gray-900 text-white">
<div id="anime-details" class="py-4">
<!-- Anime details will be dynamically inserted here -->
</div>
<style>
.video-container {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.9);
justify-content: center;
align-items: center;
z-index: 1000;
}
#video-frame {
width: 80%;
height: 80%;
max-width: 800px;
max-height: 450px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6); /* Shadow effect */
border-radius: 15px; /* Blunt edges */
}
.close-button {
position: absolute;
top: 20px;
right: 20px;
background: transparent;
border: none;
font-size: 2rem;
color: #fff;
cursor: pointer;
}
</style> <div id="video-container" class="video-container">
<button class="close-button" onclick="closeVideo()">×</button>
<iframe id="video-frame" src="" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</div>
<!-- Cards will be dynamically inserted here -->
<div class="py-4">
<h5 class="text-lg font-bold text-white mb-2">Related Anime </h5>
<hr class="border-gray-600 mb-4">
<div id="related-section" class="flex overflow-x-auto space-x-4 py-4" style="height: 300px;">
</div>
</div>
<style>
/* Custom scrollbar styling */
#related-section::-webkit-scrollbar {
height: 8px;
}
#related-section::-webkit-scrollbar-thumb {
background-color: #4a4a4a;
border-radius: 10px;
}
#related-section::-webkit-scrollbar-track {
background: #333;
}
/* Hover effects for movie cards */
.related-card:hover .movie-image {
filter: blur(4px);
}
.related-card:hover .movie-info {
opacity: 1;
}
.related-card {
transition: transform 0.2s, box-shadow 0.2s;
}
.related-card:hover {
transform: translateY(-8px);
box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
}
/* Styling for text overflow handling */
.movie-info h2,
.movie-info p {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* Loading spinner styling */
.loader {
border: 4px solid #f3f3f3;
border-top: 4px solid #3498db;
border-radius: 50%;
width: 40px;
height: 40px;
background-color: #333; /* Updated background color */
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
const relatedSection = document.getElementById('related-section');
const loader = document.createElement('div');
loader.classList.add('loader');
relatedSection.appendChild(loader);
const urlParams = new URLSearchParams(window.location.search);
const id = urlParams.get('id');
fetch(`https://api-p1xr.vercel.app/api/v2/info/${id}`)
.then(response => response.json())
.then(data => {
console.log('API Response:', data); // Log the entire response
loader.remove();
// Check if the response structure is as expected
if (data && data.relation && Array.isArray(data.relation)) {
data.relation.forEach(anime => {
const card = document.createElement('div');
card.classList.add('related-card', 'relative', 'w-60', 'flex-shrink-0', 'bg-gray-800', 'rounded-lg', 'overflow-hidden');
card.innerHTML = `
<a href="details.html?id=${anime.id}" class="block w-full h-full">
<img src="${anime.coverImage.large}" alt="${anime.title.english}" class="movie-image w-full h-full object-cover">
<div class="movie-info absolute inset-0 bg-black bg-opacity-75 text-white p-4 opacity-0 transition-opacity duration-200">
<h2 class="text-lg font-bold">${anime.title.english}</h2>
<p>Season: ${anime.season}</p>
<p>Format: ${anime.format}</p>
<p>Type: ${anime.type}</p>
<p>Genres: ${anime.genres.join(', ')}</p>
</div>
</a>
`;
relatedSection.appendChild(card);
});
} else {
console.error('Unexpected API response structure:', data);
relatedSection.innerHTML = '<p class="text-white">No related anime </p>';
}
})
.catch(error => {
console.error('Error fetching data:', error);
loader.remove();
relatedSection.innerHTML = '<p class="text-white">No recommendations provided by Anilist</p>';
});
});
</script>
<div class="py-4">
<h5 class="text-lg font-bold text-white mb-2">Recommendations</h5>
<hr class="border-gray-600 mb-4">
<div id="recommendation-section" class="flex overflow-x-auto space-x-4 py-4" style="height: 300px;">
<!-- Cards will be dynamically inserted here -->
</div>
</div>
<style>
/* Custom scrollbar styling */
#recommendation-section::-webkit-scrollbar {
height: 8px;
}
#recommendation-section::-webkit-scrollbar-thumb {
background-color: #4a4a4a;
border-radius: 10px;
}
#recommendation-section::-webkit-scrollbar-track {
background: #333;
}
/* Hover effects for movie cards */
.recommendation-card:hover .movie-image {
filter: blur(4px);
}
.recommendation-card:hover .movie-info {
opacity: 1;
}
.recommendation-card {
transition: transform 0.2s, box-shadow 0.2s;
}
.recommendation-card:hover {
transform: translateY(-8px);
box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
}
/* Styling for text overflow handling */
.movie-info h2,
.movie-info p {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* Loading spinner styling */
.loader {
border: 4px solid #f3f3f3;
border-top: 4px solid #3498db;
border-radius: 50%;
width: 40px;
height: 40px;
background-color: #333; /* Updated background color */
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
const recommendationSection = document.getElementById('recommendation-section');
const loader = document.createElement('div');
loader.classList.add('loader');
recommendationSection.appendChild(loader);
const urlParams = new URLSearchParams(window.location.search);
const id = urlParams.get('id');
fetch(`https://api-p1xr.vercel.app/api/v2/recommendations/${id}`)
.then(response => response.json())
.then(data => {
loader.remove();
data.results.forEach(anime => {
const card = document.createElement('div');
card.classList.add('recommendation-card', 'relative', 'w-60', 'flex-shrink-0', 'bg-gray-800', 'rounded-lg', 'overflow-hidden');
card.innerHTML = `
<a href="details.html?id=${anime.id}" class="block w-full h-full">
<img src="${anime.coverImage.large}" alt="${anime.title.english}" class="movie-image w-full h-full object-cover">
<div class="movie-info absolute inset-0 bg-black bg-opacity-75 text-white p-4 opacity-0 transition-opacity duration-200">
<h2 class="text-lg font-bold">${anime.title.english}</h2>
<p>Season: ${anime.season}</p>
<p>Format: ${anime.format}</p>
<p>Type: ${anime.type}</p>
<p>Genres: ${anime.genres.join(', ')}</p>
</div>
</a>
`;
recommendationSection.appendChild(card);
});
})
.catch(error => {
console.error('Error fetching data:', error);
loader.remove();
recommendationSection.innerHTML = '<p class="text-white">No recommendations provided by Anilist </p>';
});
});
</script>
<!-- Bottom Toolbar -->
<div class="bg-gray-900 p-4 shadow-md fixed bottom-0 inset-x-0 flex justify-around">
<!-- Home Icon -->
<a href="index.html" class="flex flex-col items-center transform transition-transform duration-200 hover:scale-110">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-white hover:text-blue-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 12l2-2m0 0l7-7 7 7M13 5v6a1 1 0 001 1h3m4 0a1 1 0 011 1v6a1 1 0 01-1 1H6a1 1 0 01-1-1v-6a1 1 0 011-1h3m-4 0l2 2" />
</svg>
<span class="text-white text-xs mt-1 hover:text-blue-400">Home</span>
</a>
<!-- Search Icon -->
<a href="search.html" class="flex flex-col items-center transform transition-transform duration-200 hover:scale-110">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-white hover:text-green-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-4.35-4.35M18 10a8 8 0 11-16 0 8 8 0 0116 0z" />
</svg>
<span class="text-white text-xs mt-1 hover:text-green-400">Search</span>
</a>
<!-- Bookmark Icon -->
<a href="bookmark.html" class="flex flex-col items-center transform transition-transform duration-200 hover:scale-110">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 text-white hover:text-red-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 5v16l7-5 7 5V5a2 2 0 00-2-2H7a2 2 0 00-2 2z" />
</svg>
<span class="text-white text-xs mt-1 hover:text-red-400">Bookmark</span>
</a>
</div>
<script src="js/details.js"></script>
</body>
</html>