-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5b256da
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- Alist部分静态文件存储仓库 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); // 初始化时间显示 |