-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
79 lines (77 loc) · 3.83 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Project Sekai: Colorful Stage Score Patching Tool</title>
<noscript>This page requires JavaScript to function.</noscript>
<link rel="stylesheet" href="css/style.css">
<script type="text/javascript">
window.onload = () => {
let list = document.getElementById("list");
const assets = "https://api.pjsek.ai/assets";
const db = "https://api.pjsek.ai/database/master";
const musics = "https://sekai-world.github.io/sekai-master-db-diff/musics.json";
let http = new XMLHttpRequest();
http.open("GET", db+"/musics?$limit=0");
http.setRequestHeader("Accept", "application/json");
http.onreadystatechange = () => {
if (http.readyState!=4) return;
const http2 = new XMLHttpRequest();
if (http.status>=200 && http.status<=299) {
let songCount = JSON.parse(http.response).total;
http2.open("GET", db+`/musics?$limit=${songCount}&$sort[id]=1`);
http2.setRequestHeader("Accept", "application/json");
http2.onload = () => {
list.innerHTML = '';
for (let song of JSON.parse(http2.response).data) {
let item = document.createElement("a");
let img = document.createElement("img");
img.crossOrigin="anonymous";
item.setAttribute("href", `song.html?id=${song.id}`);
img.setAttribute("src",`https://assets.pjsek.ai/file/pjsekai-assets/startapp/music/jacket/${song.assetbundleName}/${song.assetbundleName}.png`);
let name = document.createElement("div");
name.innerText = song.title;
item.classList.add("songicon");
item.appendChild(img);
item.appendChild(name);
list.appendChild(item);
}
}
} else {
http2.open("GET", musics);
http2.setRequestHeader("Accept", "application/json");
http2.onload = () => {
list.innerHTML = '';
for (let song of JSON.parse(http2.response)) {
let item = document.createElement("a");
let img = document.createElement("img");
img.crossOrigin="anonymous";
item.setAttribute("href", `song.html?id=${song.id}`);
img.setAttribute("src",`https://storage.sekai.best/sekai-jp-assets/music/jacket/${song.assetbundleName}_rip/${song.assetbundleName}.png`);
let name = document.createElement("div");
name.innerText = song.title;
item.classList.add("songicon");
item.appendChild(img);
item.appendChild(name);
list.appendChild(item);
}
}
}
http2.send();
}
http.send();
}
</script>
</head>
<body>
<h1>Project Sekai: Colorful Stage Score Patching Tool</h1>
<h2>Pick a song!</h2>
<div style="text-align: center;">Or, <a href="custom.html">patch your own chart!</a></div>
<div id="list" class="icons">
Retrieving song list...
</div>
<pre class="tagline">Asset sources are from <a href="https://pjsek.ai/">pjsek.ai</a> and <a href="https://sekai.best">Sekai Viewer</a>.</pre>
<pre class="tagline"><em>Created by <a href="https://github.com/Qrael/">Qrael</a></em></pre>
<pre class="tagline"><em>View website source at <a href="https://github.com/Qrael/PjskSUSPatcher">GitHub</a></em></pre>
</body>
</html>