-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
799 lines (689 loc) · 25.7 KB
/
Copy pathindex.html
File metadata and controls
799 lines (689 loc) · 25.7 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
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
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PolyExtender - PolyFNPlayList</title>
<!-- Favicon using GitHub avatar -->
<link rel="icon" href="https://github.com/PolyExtender.png" type="image/png">
<style>
/* Modern variables */
:root {
--primary-color: #9d4dbb;
--secondary-color: #5643cc;
--dark-bg: #1e1e1e;
--card-bg: #2a2a2a;
--text-primary: #ffffff;
--text-secondary: #cccccc;
--text-muted: #888888;
--shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
--hover-transition: all 0.3s ease;
}
/* Base styles */
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: var(--dark-bg);
color: var(--text-primary);
margin: 0;
padding: 0;
overflow-x: hidden;
}
/* Scrollbar styling */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: #333;
}
::-webkit-scrollbar-thumb {
background: var(--primary-color);
border-radius: 4px;
}
/* Container */
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
/* Navigation */
.navbar {
background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
padding: 15px 0;
position: sticky;
top: 0;
z-index: 1000;
box-shadow: var(--shadow);
}
.nav-container {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
.logo {
display: flex;
align-items: center;
gap: 10px;
text-decoration: none;
color: white;
}
.logo img {
height: 40px;
border-radius: 50%;
border: 2px solid rgba(255, 255, 255, 0.5);
transition: var(--hover-transition);
}
.logo img:hover {
transform: rotate(15deg);
border-color: white;
}
.logo-text {
font-size: 22px;
font-weight: 700;
letter-spacing: 0.5px;
}
.nav-links {
display: flex;
gap: 20px;
}
.nav-link {
color: rgba(255, 255, 255, 0.8);
text-decoration: none;
font-weight: 500;
font-size: 16px;
padding: 5px 10px;
border-radius: 5px;
transition: var(--hover-transition);
position: relative;
}
.nav-link:hover {
color: white;
}
.nav-link::after {
content: '';
position: absolute;
width: 0;
height: 2px;
bottom: 0;
left: 50%;
background-color: white;
transition: var(--hover-transition);
}
.nav-link:hover::after {
width: 100%;
left: 0;
}
.nav-link.active {
background-color: rgba(255, 255, 255, 0.2);
color: white;
}
.menu-toggle {
display: none;
flex-direction: column;
justify-content: space-between;
width: 30px;
height: 21px;
cursor: pointer;
}
.menu-toggle span {
height: 3px;
width: 100%;
background-color: white;
border-radius: 10px;
}
/* Header */
.header {
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
padding: 40px 20px;
border-radius: 12px;
margin-bottom: 30px;
box-shadow: var(--shadow);
position: relative;
overflow: hidden;
}
.header::before {
content: '';
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: radial-gradient(rgba(255, 255, 255, 0.1), transparent);
opacity: 0.5;
pointer-events: none;
}
h1 {
margin: 0;
font-size: 36px;
text-align: center;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
font-weight: 800;
background: linear-gradient(to right, #ffffff, #d6c5ff);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
animation: shimmer 3s infinite;
}
@keyframes shimmer {
0% { background-position: -200% 0; }
100% { background-position: 200% 0; }
}
.subtitle {
text-align: center;
margin-top: 10px;
color: rgba(255, 255, 255, 0.8);
font-size: 18px;
}
/* Search */
.search-container {
margin-bottom: 30px;
display: flex;
gap: 10px;
position: relative;
z-index: 1;
}
input, select, button {
padding: 12px 15px;
border-radius: 8px;
border: none;
background-color: #333;
color: white;
font-size: 16px;
transition: var(--hover-transition);
}
input:focus, select:focus {
outline: none;
box-shadow: 0 0 0 2px var(--secondary-color);
}
input {
flex: 1;
background-color: rgba(51, 51, 51, 0.8);
backdrop-filter: blur(10px);
}
select {
cursor: pointer;
background-color: #333;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 10px center;
padding-right: 30px;
appearance: none;
}
button {
background: linear-gradient(to right, var(--secondary-color), var(--primary-color));
cursor: pointer;
font-weight: 600;
padding: 12px 20px;
transition: var(--hover-transition);
}
button:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(86, 67, 204, 0.4);
}
button:active {
transform: translateY(0);
}
/* Loading */
.loading {
text-align: center;
font-size: 18px;
margin: 40px 0;
color: var(--primary-color);
display: flex;
flex-direction: column;
align-items: center;
}
.loading::after {
content: '';
width: 50px;
height: 50px;
margin-top: 20px;
border: 3px solid rgba(157, 77, 187, 0.3);
border-radius: 50%;
border-top-color: var(--primary-color);
animation: spin 1s ease-in-out infinite;
display: inline-block;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
/* Playlists Grid */
.playlists-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 25px;
}
.playlist-card {
background-color: var(--card-bg);
border-radius: 12px;
overflow: hidden;
box-shadow: var(--shadow);
transition: var(--hover-transition);
border: 1px solid rgba(255, 255, 255, 0.1);
}
.playlist-card:hover {
transform: translateY(-8px);
box-shadow: 0 12px 20px rgba(0, 0, 0, 0.4);
border-color: rgba(157, 77, 187, 0.3);
}
.playlist-image {
width: 100%;
height: 180px;
object-fit: cover;
transition: var(--hover-transition);
}
.playlist-card:hover .playlist-image {
transform: scale(1.05);
}
.playlist-info {
padding: 20px;
}
.playlist-name {
font-size: 20px;
font-weight: 700;
margin-bottom: 12px;
color: var(--primary-color);
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
.playlist-description {
font-size: 14px;
color: var(--text-secondary);
margin-bottom: 15px;
max-height: 80px;
overflow-y: auto;
line-height: 1.5;
}
.playlist-meta {
display: flex;
justify-content: space-between;
font-size: 13px;
color: var(--text-muted);
border-top: 1px solid rgba(255, 255, 255, 0.1);
padding-top: 12px;
margin-top: 10px;
}
.playlist-tags {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-top: 12px;
}
.tag {
background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
padding: 4px 10px;
border-radius: 20px;
font-size: 11px;
font-weight: 500;
letter-spacing: 0.5px;
transition: var(--hover-transition);
}
.tag:hover {
transform: translateY(-2px);
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}
/* Pagination */
.pagination {
display: flex;
justify-content: center;
align-items: center;
margin-top: 40px;
gap: 15px;
flex-wrap: wrap;
}
.page-button {
background-color: #333;
border: none;
color: white;
padding: 10px 20px;
border-radius: 8px;
cursor: pointer;
transition: var(--hover-transition);
font-weight: 500;
}
.page-button:hover:not(:disabled) {
background-color: var(--primary-color);
transform: translateY(-2px);
}
.page-button:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: translateY(0);
}
.page-info {
display: flex;
align-items: center;
color: var(--text-secondary);
font-size: 16px;
background-color: rgba(51, 51, 51, 0.5);
padding: 8px 15px;
border-radius: 8px;
}
/* Error */
.error {
background-color: rgba(255, 71, 71, 0.2);
border-left: 4px solid #ff4747;
padding: 20px;
border-radius: 8px;
text-align: center;
margin: 30px 0;
animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(-10px); }
to { opacity: 1; transform: translateY(0); }
}
/* Footer */
.footer {
margin-top: 60px;
padding: 30px 0;
text-align: center;
color: var(--text-muted);
border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.footer a {
color: var(--primary-color);
text-decoration: none;
transition: var(--hover-transition);
}
.footer a:hover {
color: var(--secondary-color);
text-decoration: underline;
}
/* Responsive design */
@media (max-width: 768px) {
.nav-links {
display: none;
flex-direction: column;
position: absolute;
top: 70px;
left: 0;
right: 0;
background-color: var(--dark-bg);
padding: 20px;
box-shadow: var(--shadow);
z-index: 1000;
}
.nav-links.active {
display: flex;
}
.menu-toggle {
display: flex;
}
.search-container {
flex-direction: column;
}
h1 {
font-size: 28px;
}
.subtitle {
font-size: 16px;
}
.playlists-grid {
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 15px;
}
}
</style>
</head>
<body>
<!-- Navigation Bar -->
<nav class="navbar">
<div class="nav-container">
<a href="https://polyextender.github.io" class="logo">
<img src="https://github.com/PolyExtender.png" alt="PolyExtender Logo">
<span class="logo-text">PolyExtender</span>
</a>
<div class="nav-links" id="navLinks">
<a href="https://polyextender.github.io" class="nav-link">Home</a>
<a href="https://polyextender.github.io/PolyFNPlayList" class="nav-link active">Playlists</a>
<a href="https://github.com/PolyExtender" class="nav-link">GitHub</a>
<a href="https://github.com/PolyExtender/PolyFNPlayList" class="nav-link">About</a>
<a href="https://github.com/PolyExtender/PolyFNPlayList/issues" class="nav-link">Contact</a>
</div>
<div class="menu-toggle" id="menuToggle">
<span></span>
<span></span>
<span></span>
</div>
</div>
</nav>
<div class="container">
<div class="header">
<h1>PolyExtender - PolyFNPlayList</h1>
<p class="subtitle">Discover and explore Fortnite playlists in style</p>
</div>
<div class="search-container">
<input type="text" id="searchInput" placeholder="Search playlists by name, description, or tags...">
<select id="sortSelect">
<option value="name">Sort by Name</option>
<option value="gameplayTags">Sort by Tags</option>
<option value="maxPlayers">Sort by Max Players</option>
</select>
<button id="searchButton">Search Playlists</button>
</div>
<div id="content">
<div class="loading">Loading playlists...</div>
</div>
<div id="pagination" class="pagination" style="display: none;">
<button id="prevPage" class="page-button" disabled>Previous</button>
<div class="page-info">Page <span id="currentPage">1</span> of <span id="totalPages">1</span></div>
<button id="nextPage" class="page-button">Next</button>
</div>
<div class="footer">
<p>© 2025 <a href="https://github.com/PolyExtender" target="_blank">PolyExtender</a>. All rights reserved.</p>
<p>Powered by <a href="https://fortnite-api.com" target="_blank">Fortnite API</a></p>
</div>
</div>
<script>
// Global variables
let allPlaylists = [];
let filteredPlaylists = [];
let currentPage = 1;
const itemsPerPage = 12;
// DOM elements
const searchInput = document.getElementById('searchInput');
const sortSelect = document.getElementById('sortSelect');
const searchButton = document.getElementById('searchButton');
const contentArea = document.getElementById('content');
const paginationArea = document.getElementById('pagination');
const prevPageButton = document.getElementById('prevPage');
const nextPageButton = document.getElementById('nextPage');
const currentPageSpan = document.getElementById('currentPage');
const totalPagesSpan = document.getElementById('totalPages');
const menuToggle = document.getElementById('menuToggle');
const navLinks = document.getElementById('navLinks');
// Mobile menu toggle
menuToggle.addEventListener('click', () => {
navLinks.classList.toggle('active');
});
// Fetch playlists from API
async function fetchPlaylists() {
try {
contentArea.innerHTML = '<div class="loading">Loading playlists...</div>';
const response = await fetch('https://fortnite-api.com/v1/playlists');
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
const data = await response.json();
allPlaylists = data.data || []; // Ensure data.data exists, fallback to empty array
// Initial filtering and display
filterAndDisplayPlaylists();
} catch (error) {
console.error('Error fetching playlists:', error);
contentArea.innerHTML = `
<div class="error">
<h3>Failed to load playlists</h3>
<p>${error.message}</p>
<button id="retryButton" class="page-button" style="margin-top: 10px;">Retry</button>
</div>
`;
document.getElementById('retryButton')?.addEventListener('click', fetchPlaylists);
}
}
// Filter and sort playlists based on search and sort criteria
function filterAndDisplayPlaylists() {
const searchTerm = searchInput.value.toLowerCase();
const sortBy = sortSelect.value;
// Filter playlists
filteredPlaylists = allPlaylists.filter(playlist => {
// If search is empty, show all playlists
if (searchTerm === '') {
return true;
}
return (
(playlist.name && playlist.name.toLowerCase().includes(searchTerm)) ||
(playlist.description && playlist.description.toLowerCase().includes(searchTerm)) ||
(playlist.gameplayTags && playlist.gameplayTags.some(tag => tag.toLowerCase().includes(searchTerm)))
);
});
// Sort playlists
filteredPlaylists.sort((a, b) => {
switch (sortBy) {
case 'name':
return (a.name || '').localeCompare(b.name || '');
case 'gameplayTags':
const tagsA = a.gameplayTags ? a.gameplayTags.length : 0;
const tagsB = b.gameplayTags ? b.gameplayTags.length : 0;
return tagsB - tagsA;
case 'maxPlayers':
const maxA = a.maxPlayers || 0;
const maxB = b.maxPlayers || 0;
return maxB - maxA;
default:
return 0;
}
});
// Update pagination
const totalPages = Math.ceil(filteredPlaylists.length / itemsPerPage);
totalPagesSpan.textContent = totalPages;
// Reset to first page when filtering
currentPage = 1;
currentPageSpan.textContent = currentPage;
// Update pagination button states
prevPageButton.disabled = currentPage === 1;
nextPageButton.disabled = currentPage >= totalPages;
// Display current page
displayCurrentPage();
// Show/hide pagination
paginationArea.style.display = filteredPlaylists.length > itemsPerPage ? 'flex' : 'none';
}
// Display current page of playlists
function displayCurrentPage() {
const startIndex = (currentPage - 1) * itemsPerPage;
const endIndex = Math.min(startIndex + itemsPerPage, filteredPlaylists.length);
const currentPlaylists = filteredPlaylists.slice(startIndex, endIndex);
if (currentPlaylists.length === 0) {
contentArea.innerHTML = `
<div class="error">
<h3>No playlists found</h3>
<p>No playlists match your search criteria. Try using different keywords.</p>
</div>
`;
return;
}
let html = '<div class="playlists-grid">';
currentPlaylists.forEach(playlist => {
const imageUrl = playlist.images && playlist.images.showcase ?
playlist.images.showcase :
'https://via.placeholder.com/300x180?text=No+Image';
html += `
<div class="playlist-card">
<img class="playlist-image" src="${imageUrl}" alt="${playlist.name || 'Unnamed Playlist'}" loading="lazy" onerror="this.src='https://via.placeholder.com/300x180?text=Image+Error';">
<div class="playlist-info">
<div class="playlist-name">${playlist.name || 'Unnamed Playlist'}</div>
<div class="playlist-description">${playlist.description || 'No description available.'}</div>
${renderTags(playlist.gameplayTags)}
<div class="playlist-meta">
<span>ID: ${playlist.id || 'N/A'}</span>
<span>Max Players: ${playlist.maxPlayers || 'N/A'}</span>
</div>
</div>
</div>
`;
});
html += '</div>';
contentArea.innerHTML = html;
// Add animations
const cards = document.querySelectorAll('.playlist-card');
cards.forEach((card, index) => {
card.style.opacity = '0';
card.style.transform = 'translateY(20px)';
setTimeout(() => {
card.style.transition = 'opacity 0.5s ease, transform 0.5s ease';
card.style.opacity = '1';
card.style.transform = 'translateY(0)';
}, 50 * index);
});
}
// Render tags for a playlist
function renderTags(tags) {
if (!tags || tags.length === 0) {
return '<div class="playlist-tags"><span class="tag">No Tags</span></div>';
}
let html = '<div class="playlist-tags">';
// Limit to 5 tags to avoid overflow
const displayTags = tags.slice(0, 5);
displayTags.forEach(tag => {
// Extract the last part of the tag for cleaner display
const displayTag = tag.split(':').pop();
html += `<span class="tag">${displayTag}</span>`;
});
if (tags.length > 5) {
html += `<span class="tag">+${tags.length - 5} more</span>`;
}
html += '</div>';
return html;
}
// Event listeners
searchButton.addEventListener('click', () => {
filterAndDisplayPlaylists();
});
searchInput.addEventListener('keypress', (e) => {
if (e.key === 'Enter') {
filterAndDisplayPlaylists();
}
});
sortSelect.addEventListener('change', () => {
filterAndDisplayPlaylists();
});
prevPageButton.addEventListener('click', () => {
if (currentPage > 1) {
currentPage--;
currentPageSpan.textContent = currentPage;
prevPageButton.disabled = currentPage === 1;
nextPageButton.disabled = false;
displayCurrentPage();
window.scrollTo({ top: 0, behavior: 'smooth' });
}
});
nextPageButton.addEventListener('click', () => {
const totalPages = Math.ceil(filteredPlaylists.length / itemsPerPage);
if (currentPage < totalPages) {
currentPage++;
currentPageSpan.textContent = currentPage;
prevPageButton.disabled = false;
nextPageButton.disabled = currentPage >= totalPages;
displayCurrentPage();
window.scrollTo({ top: 0, behavior: 'smooth' });
}
});
// Load playlists automatically when page loads
window.addEventListener('DOMContentLoaded', () => {
fetchPlaylists();
// Add some animation effects on page load
document.querySelector('.header').style.opacity = '0';
document.querySelector('.header').style.transform = 'translateY(-20px)';
setTimeout(() => {
document.querySelector('.header').style.transition = 'opacity 0.8s ease, transform 0.8s ease';
document.querySelector('.header').style.opacity = '1';
document.querySelector('.header').style.transform = 'translateY(0)';
}, 100);
});
</script>
</body>
</html>