-
Notifications
You must be signed in to change notification settings - Fork 4
/
setu.html
41 lines (41 loc) · 1.41 KB
/
setu.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
<title>Setu Viewer</title>
<script src="/js/jquery.min.js"></script>
<center>
<h1>Setu Viewer</h1>
<hr />
<table border="1"><tr><td width="510">
<img src="/images/loading.svg" width="500" onerror="getimg()"/>
</td><td width="250">
<p>PID: <span id="pid">Loading...</span></p>
<p>标题: <span id="title">Loading...</span></p>
<p>作者: <span id="author">Loading...</span></p>
<p>Tags: <span id="tags">Loading...</span></p>
</td></tr></table>
<p><button onclick="alert('Loading');">再来一张</button></p>
<hr />
Made By <a href="https://mayx.eu.org">Mayx</a>
</center>
<script>
var indexdata;
function getimg(){
$("img")[0].src = "/images/loading.svg";
setTimeout(function(){
$.get("/pixiv-index/data/" + indexdata[Math.floor(Math.random()*indexdata.length)] ,function(data){
console.log(data);
$("#pid")[0].innerHTML = "<a href=\"https://www.pixiv.net/artworks/" + data["pid"] + "\">" + data["pid"] + "</a>";
$("#title")[0].innerHTML = data["title"];
$("#author")[0].innerHTML = data["author"];
$("#tags")[0].innerHTML = data["tags"];
$("img")[0].src = "https://pixiv.mayx.eu.org" + data["url"];
});
}, 500);
}
function getindex(){
$.get("/pixiv-index/index.json",function(data){
indexdata = data;
$("button")[0].onclick=getimg;
getimg();
});
}
getindex();
</script>