-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
49 lines (44 loc) · 1.79 KB
/
script.js
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
const links = {
'官网 / Official': 'https://suningyao.com',
'简历 / Resume': 'https://resume.suningyao.com/',
'博客 / Blog': 'https://blog.suningyao.com',
'研究 / Research': 'https://mirror.xyz/msfew.eth',
'周报 / Newsletter': 'https://www.proofoftrack.xyz',
'音乐 / Music': 'https://blog.suningyao.com/docs/Music/liked/',
'推特 / Twitter': 'https://twitter.com/msfew_eth',
'开发 / GitHub': 'https://github.com/fewwwww',
'领英 / Linkedin': 'https://www.linkedin.com/in/suning-yao/',
'邮箱 / Email': 'mailto:yaosuning@gmail.com',
'微信 / WeChat': 'https://fewwwww.github.io/WeChat-AddMe/',
}
const ulDOM = document.getElementsByTagName('ul')[0]
// CHANGE: removed the dark color theme, just the remaining cute one
// const switchColorMode = () => {
// if(!(new Date().getHours() > 6 && new Date().getHours() < 20)) {
// document.getElementsByTagName('html')[0].style.filter = 'invert(1)'
// // otherwise, will be looking like laser
// document.getElementsByTagName('img')[0].style.filter = 'invert(1)'
// }
// }
// switchColorMode()
document.addEventListener('DOMContentLoaded', function () {
// contradict to <ul> lol, but whatever
let keyIndex = 0
for (let key in links) {
const aDOM = document.createElement('a')
const liDOM = document.createElement('li')
liDOM.innerText = key
if (keyIndex % 2 === 0) {
liDOM.style.backgroundColor = '#F0FFFF'
} else {
liDOM.style.backgroundColor = '#FFF0FF'
}
// Remove link underline decoration
aDOM.style.textDecoration = 'none'
aDOM.appendChild(liDOM)
aDOM.href = links[key]
ulDOM.appendChild(aDOM)
keyIndex++
}
});
new cursoreffects.rainbowCursor();