Skip to content

Commit

Permalink
Alist静态资源
Browse files Browse the repository at this point in the history
  • Loading branch information
Shame-xiaoen authored Dec 24, 2024
0 parents commit 5b256da
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Alist部分静态文件存储仓库


18 changes: 18 additions & 0 deletions getip.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
fetch('https://api.vore.top/api/IPdata')
.then(response => response.json())
.then(data => {
const ip = data.ipinfo.text;
const province = data.ipdata.info1;
const city = data.ipdata.info2;
const isp = data.ipdata.isp;
const area_code = data.ipinfo.cnip;
const nation = data.ipdata.info1;
let welcomeMessage;
if (area_code) {
welcomeMessage = `欢迎${province}${city}${isp} (IP: ${ip}) 的小伙伴访问本站`;
} else {
welcomeMessage = `欢迎${nation}${isp} (IP: ${ip}) 的小伙伴访问本站`;
}
document.getElementById('welcome').textContent = welcomeMessage;
})
.catch(error => console.error(error));
15 changes: 15 additions & 0 deletions runtime.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
function updateRuntime() {
const startDate = new Date('2024-12-22T00:00:00'); // 建站日期
const now = new Date();
const elapsed = now - startDate;

const days = Math.floor(elapsed / (1000 * 60 * 60 * 24));
const hours = Math.floor((elapsed % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
const minutes = Math.floor((elapsed % (1000 * 60 * 60)) / (1000 * 60));
const seconds = Math.floor((elapsed % (1000 * 60)) / 1000);

document.getElementById('runtime').innerHTML = `${days}${hours}小时 ${minutes}${seconds}秒`;
}

setInterval(updateRuntime, 1000); // 每秒更新一次时间
updateRuntime(); // 初始化时间显示

0 comments on commit 5b256da

Please sign in to comment.