This repository has been archived by the owner on Aug 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
94 lines (78 loc) · 3.4 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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AFK History</title>
<script src="./js/canvasjs.min.js"></script>
<link rel="stylesheet" href="./css/main.css">
</head>
<body>
<div id="root">
<nav id="navbar">
<a class="navItem" href="./index.html">關於</a>
<a class="navItem" href="./all.html">所有記錄</a>
<a class="navItem" href="./period.html">根據時間區段</a>
<a class="navItem" href="./rank.html">各項排名</a>
</nav>
<div id="container">
<p style="font-size: 1.5rem; color: #d8622b;">
貌似又可以抓到了,先恢復看看。 <br>
穩定的話,有空再來加功能。
</p>
<br>
<h2>關於</h2>
<p>這裡收集了自 2021-06-25 以來所有課長們開車 (AFK Skip) 的記錄。</p>
<p>所有資料均解析於 Discord 的訊息。</p>
<p>目前設定每天 8 點 (UTC+8) 將自動更新資料。(由於 GitHub Actions 的侷限,更新作業可能略有延遲)</p>
<hr>
<ul>
<li>計劃發起: [NGG] temmie_950807</li>
<li>資料收集: [TEA] LianSheng、[NGG] temmie_950807</li>
</ul>
<br><br><br>
<p>
GitHub: <a href="https://github.com/CCO-Project/AFK-History" target="_blank">CCO-Project/AFK-History</a>
</p>
<br>
<div>
<b>Last Update</b><br><br>
Committer: <span id="update-committer">[Loaging...]</span><br>
Date: <span id="update-date">[Loaging...]</span><br>
Message: <span id="update-message">[Loaging...]</span><br>
<span id="update-message-more"></span>
</div>
</div>
</div>
<script>
window.onload = async () => {
let latestCommitUrl = await fetch(
"https://api.github.com/repos/CCO-Project/AFK-History/git/refs/heads/master"
).then(
r => r.json()
).then(
r => r.object.url
);
let lastCommitDetail = await fetch(latestCommitUrl).then(r => r.json());
document.querySelector("#update-committer").innerHTML = lastCommitDetail.committer.name;
document.querySelector("#update-date").innerHTML = dateFormatter(new Date(lastCommitDetail.committer.date));
document.querySelector("#update-message").innerHTML = lastCommitDetail.message.split("\n")[0];
document.querySelector("#update-message-more").innerHTML = lastCommitDetail.message.split("\n").slice(1).join("<br>");
/**
* @param {Date} date
* @returns {string}
*/
function dateFormatter(date) {
let Y = date.getFullYear();
let M = `0${date.getMonth()+1}`.substr(-2);
let D = `0${date.getDate()}`.substr(-2);
let h = `0${date.getHours()}`.substr(-2);
let m = `0${date.getMinutes()}`.substr(-2);
let s = `0${date.getSeconds()}`.substr(-2);
return `${Y}-${M}-${D} ${h}:${m}:${s}`;
}
}
</script>
</body>
</html>