-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
213 lines (179 loc) · 9.66 KB
/
index.html
File metadata and controls
213 lines (179 loc) · 9.66 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
<!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 unofficial catalogue of addons and side plugins for ProjectKorra. 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/servers.html">
<meta name="twitter:image" content="https://raw.githubusercontent.com/CozmycDev/PK-Addons/refs/heads/main/icon.png">
<meta property="og:type" content="website">
<meta property="og:title" content="ProjectKorra Addons Catalogue">
<meta property="og:description" content="Welcome to the unofficial catalogue of addons and side plugins for ProjectKorra. 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/servers.html">
<meta property="og:image" content="https://raw.githubusercontent.com/CozmycDev/PK-Addons/refs/heads/main/icon.png">
<title>ProjectKorra Addons</title>
<link id="theme-stylesheet" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootswatch@5.3.0/dist/flatly/bootstrap.min.css">
<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/dataTables.bootstrap5.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
select.theme-select {
color:#fff; background:#2c2c2c; border:1px solid #6c757d; padding:5px; margin-right:10px;
}
select.theme-select option { color:#000; background:#fff; }
#table { width:100% !important; }
@media (max-width: 992px) {
.navbar-collapse .dropdown-menu { position: static !important; float: none; }
}
</style>
<style>
.small-badge {
font-size: 0.7em;
padding: 0.15em 0.4em;
}
.nav-logo {
height: 48px;
width: auto;
object-fit: contain;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container">
<a class="navbar-brand" href="index.html"><img src="https://raw.githubusercontent.com/CozmycDev/PK-Addons/refs/heads/main/icon.png" alt="PK-Addons" class="nav-logo"></a>
<div class="d-flex" id="navbarNav">
<ul class="navbar-nav me-auto d-flex flex-row">
<li class="nav-item"><a class="nav-link active" href="index.html">Addons</a><span class="badge bg-danger ms-1 small-badge">NEW!</span> </li>
<li class="nav-item"><a class="nav-link" aria-current="page" href="servers.html">Servers</a><span class="badge bg-danger ms-1 small-badge">NEW!</span> </li>
</ul>
<ul class="navbar-nav ms-auto d-flex flex-row align-items-center">
<li `class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="themeDropdown" role="button" data-bs-toggle="dropdown">
<i class="fas fa-gear"></i>
</a>
<ul class="dropdown-menu dropdown-menu-end p-2" aria-labelledby="themeDropdown">
<li><select id="theme-selector" class="form-select mb-2"></select></li>
<li class="text-center"><button id="dark-toggle" class="btn btn-outline-dark w-100"><i class="fas fa-moon"></i> Toggle Dark</button></li>
</ul>
</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 mt-4 mb-4">
<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: Sep 1, 2025
</p>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<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 src="https://cdn.datatables.net/1.13.3/js/dataTables.bootstrap5.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('.dropdown-toggle').forEach(el => new bootstrap.Dropdown(el, { autoClose: true }));
const themes = ["cerulean","cosmo","cyborg","darkly","flatly","journal","litera","lumen","lux","materia",
"minty","morph","pulse","quartz","sandstone","simplex","sketchy","slate","solar","spacelab",
"superhero","united","vapor","yeti","zephyr"];
function applyTheme(theme){
document.getElementById('theme-stylesheet').href = `https://cdn.jsdelivr.net/npm/bootswatch@5.3.0/dist/${theme}/bootstrap.min.css`;
localStorage.setItem('pk-theme', theme);
}
function applyDarkMode(enabled){
document.body.classList.toggle('bg-dark', enabled);
document.body.classList.toggle('text-white', enabled);
const tableEl = document.getElementById('table');
tableEl.classList.toggle('table-dark', enabled);
tableEl.classList.toggle('table-light', !enabled);
localStorage.setItem('pk-dark', enabled ? '1' : '0');
}
const selector = document.getElementById('theme-selector');
themes.forEach(t => { const opt = document.createElement('option'); opt.value=t; opt.textContent=t.charAt(0).toUpperCase()+t.slice(1); selector.appendChild(opt); });
const storedTheme = localStorage.getItem('pk-theme') || 'flatly';
const darkMode = localStorage.getItem('pk-dark') === '1';
selector.value = storedTheme;
applyTheme(storedTheme);
applyDarkMode(darkMode);
document.getElementById('dark-toggle').innerHTML = darkMode ? '<i class="fas fa-moon"></i>' : '<i class="fas fa-sun"></i>';
selector.addEventListener('change', e => applyTheme(e.target.value));
document.getElementById('dark-toggle').addEventListener('click', () => {
const enabled = !document.body.classList.contains('bg-dark');
applyDarkMode(enabled);
document.getElementById('dark-toggle').innerHTML = enabled ? '<i class="fas fa-moon"></i>' : '<i class="fas fa-sun"></i>';
$('#table').DataTable().draw();
});
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(res => Promise.all(res.map(r => r.json())))
.then(([forum, github]) => [...(Array.isArray(forum)?forum:[]), ...(Array.isArray(github)?github:[])])
.catch(e=>{ console.error(e); 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=>{
const tableBody = document.getElementById("table-body");
const newCutoff = moment("2025-01-04", "YYYY-MM-DD");
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.download_url}" target="_blank"><i class="fa-solid fa-download"></i></a>`
: `<a href="${entry.source_url}" target="_blank">🌐</a> <a href="${entry.download_url}" target="_blank"><i class="fa-solid fa-download"></i></a>`)
: '<i class="fa-solid fa-x"></i>')
: '<i class="fas fa-question-circle"></i>';
const isNew = normalizedDate && moment(normalizedDate).isAfter(newCutoff);
const nameCell = entry.name || '<i class="fas fa-question-circle"></i>';
const nameWithBadge = isNew
? `${nameCell} <span class="badge bg-danger ms-1 small-badge">NEW!</span>`
: nameCell;
const row = document.createElement("tr");
row.innerHTML = `
<td>${nameWithBadge}</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>