-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
30 lines (24 loc) · 1.11 KB
/
script.js
File metadata and controls
30 lines (24 loc) · 1.11 KB
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
fetch('https://v1.hitokoto.cn')
.then(response => response.json())
.then(data => {
const hitokoto = document.querySelector('#hitokoto_text')
hitokoto.href = `https://hitokoto.cn/?uuid=${data.uuid}`
hitokoto.innerText = data.hitokoto
})
.catch(console.error)
setInterval(function () {
let time = new Date().getHours().toString().padStart(2, "0") + ":" + new Date().getMinutes().toString().padStart(2, "0")
let elementtime = document.getElementById('time')
elementtime.innerHTML = new Date().getHours().toString().padStart(2, "0") + ":" + new Date().getMinutes().toString().padStart(2, "0");
}, 1)
let m = new Date().getMonth()
var date = new Date().getFullYear() + '年' + parseInt(m + 1) + '月' + new Date().getDate() + '日';
document.getElementById("times").innerHTML = date;
let week = ['星期日','星期二','星期三','星期四','星期五','星期六','星期一']
let weekday = week[new Date().getDay()];
document.getElementById("xq").innerHTML = weekday;
function game(name){
if (name == 2022) {
} else {
}
}