-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
208 lines (152 loc) · 7.02 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv='cache-control' content='no-cache'>
<meta http-equiv='expires' content='0'>
<meta http-equiv='pragma' content='no-cache'>
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="Cozmyc">
<meta name="twitter:title" content="ProjectKorra Addons Catalogue">
<meta name="twitter:description" content="Welcome to the catalogue of addons for ProjectKorra, sourced from the ProjectKorra forums and GitHub, fully updated at least quarterly. Contributions are welcome, and removal requests will be honored. Data can be found at: https://github.com/CozmycDev/PK-Addons">
<meta name="twitter:url" content="https://github.com/CozmycDev/PK-Addons/">
<meta property="og:type" content="website">
<meta property="og:title" content="ProjectKorra Addons Catalogue">
<meta property="og:description" content="Welcome to the catalogue of addons for ProjectKorra, sourced from the ProjectKorra forums and GitHub, fully updated at least quarterly. Contributions are welcome, and removal requests will be honored. Data can be found at: https://github.com/CozmycDev/PK-Addons">
<meta property="og:url" content="https://github.com/CozmycDev/PK-Addons/">
<title>ProjectKorra Addons</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/6.2.0/mdb.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.3/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<link id="theme-stylesheet" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/lux/bootstrap.min.css">
<style>
select {
color: #ffffff;
background-color: #2c2c2c;
border: 1px solid #6c757d;
padding: 5px;
}
select option {
color: #000000;
background-color: #ffffff;
}
</style>
</head>
<body class="bg-dark text-white">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container">
<a class="navbar-brand" href="index.html">PK-Addons</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="index.html">Addons</a>
</li>
<li class="nav-item">
<a class="nav-link" href="servers.html">Servers</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container my-4">
<h1 class="text-center mb-4">ProjectKorra Addons</h1>
<div class="table-responsive">
<table id="table" class="table table-dark table-striped table-bordered text-white">
<thead class="bg-secondary">
<tr>
<th>Name</th>
<th>Author</th>
<th>Category</th>
<th>Last Update</th>
<th>Latest Version</th>
<th>Download</th>
</tr>
</thead>
<tbody id="table-body">
</tbody>
</table>
</div>
</div>
<div class="text-center">
<p>
This site is not owned or operated by ProjectKorra.<br>If you would like to see something added or removed, open a PR or issue on <a href="https://github.com/CozmycDev/PK-Addons">the repo</a>.<br>Legend: <i class="fas fa-question-circle"></i>=Unknown, <i class="fa-solid fa-x"></i>=Dead Link<br>Last Updated: Jan 05, 2025
</p>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/6.2.0/mdb.min.js"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js"></script>
<script src="https://cdn.datatables.net/1.13.3/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.13.3/sorting/datetime-moment.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
const forumUrl = "https://cozmycdev.github.io/PK-Addons/forum.json";
const githubUrl = "https://cozmycdev.github.io/PK-Addons/github.json";
function fetchAndMergeData() {
return Promise.all([fetch(forumUrl), fetch(githubUrl)])
.then(responses => Promise.all(responses.map(res => res.json())))
.then(([forumData, githubData]) => {
if (!Array.isArray(forumData) || !Array.isArray(githubData)) {
throw new Error('Invalid data format: Expected arrays');
}
return [...forumData, ...githubData];
})
.catch(error => {
console.error('Error fetching or merging data:', error);
return [];
});
}
function normalizeDate(dateStr) {
const formats = [
"MMM D, YYYY",
"MMM D YYYY",
"MMMM D, YYYY",
"MMMM D YYYY"
];
const date = moment(dateStr, formats, true);
return date.isValid() ? date.format('YYYY-MM-DD') : null;
}
fetchAndMergeData().then(data => {
if (!Array.isArray(data)) {
console.error('Invalid data format: Expected an array');
return;
}
const tableBody = document.getElementById("table-body");
data.forEach(entry => {
const normalizedDate = normalizeDate(entry.last_update);
const sourceLink = entry.source_url
? (entry.source_url !== "DEAD LINK"
? (entry.source_url.includes("github.com")
? `<a href="${entry.source_url}" target="_blank"><i class="fa-brands fa-github"></i> ↗️</a>`
: `<a href="${entry.source_url}" target="_blank">↗️</a>`)
: '<i class="fa-solid fa-x"></i>')
: '<i class="fas fa-question-circle"></i>';
const row = document.createElement("tr");
row.innerHTML = `
<td>${entry.name || '<i class="fas fa-question-circle"></i>'}</td>
<td>${entry.author || '<i class="fas fa-question-circle"></i>'}</td>
<td>${entry.category || '<i class="fas fa-question-circle"></i>'}</td>
<td>${normalizedDate || '<i class="fas fa-question-circle"></i>'}</td>
<td>${entry.latest_version || '<i class="fas fa-question-circle"></i>'}</td>
<td>${sourceLink}</td>
`;
tableBody.appendChild(row);
});
$.fn.dataTable.moment('YYYY-MM-DD');
$('#table').DataTable({
"order": [[3, 'desc']],
"columnDefs": [
{
"targets": 3,
"type": "date"
}
]
});
});
});
</script>
</body>
</html>