-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstar.js
More file actions
28 lines (28 loc) · 864 Bytes
/
star.js
File metadata and controls
28 lines (28 loc) · 864 Bytes
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
document.addEventListener('DOMContentLoaded', function() {
/* 显示该关总星数 */
const packsStar = {
'Alpha': '36',
'Beta': '38',
'Gamma': '30',
'Delta': '34',
'Epsilon': '40',
'Zeta': '41',
'Eta': '37',
'Theta': '27',
'Iota': '32',
'Kappa': '42',
'Lambda': '34',
'Mu': '35',
'Nu': '34',
'Xi': '19',
'Omicron': '37'
}
const currentFilePath = window.location.pathname;
for (pack of currentFilePath.split('/')) {
if (pack.endsWith('.html')) { pack = pack.slice(0, -5); }
if (packsStar.hasOwnProperty(pack)) {
document.querySelector('.count-inner-bold').textContent = packsStar[pack];
document.querySelector('.count-inner').textContent = '/ ' + packsStar[pack];
}
}
});