-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathindex.html
61 lines (60 loc) · 2.11 KB
/
index.html
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
50
51
52
53
54
55
56
57
58
59
60
61
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>字图 CDN - 中文网字计划</title>
<link
rel="stylesheet"
href="./packages/cef/dist/CEFFontsCJK-Regular/result.css"
/>
</head>
<body
style="
font-family: 'CEF Fonts CJK';
text-align: center;
max-width: 60rem;
margin: auto;
"
>
<h1>
字图 CDN, 一个免费的中文字体公益 CDN 服务, 致力于为国内外全球 CJK
开发者提供高质量网络字体服务,让中文字体在互联网世界起飞。
</h1>
<h2>这里是字图CDN的索引页面</h2>
<ol
id="index-list"
style="
font-family: system-ui, -apple-system, BlinkMacSystemFont,
'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
'Helvetica Neue', sans-serif;
"
></ol>
<script>
fetch("./index.json")
.then((res) => res.json())
.then((res) => {
console.log(res);
return Object.entries(res).flatMap(([key, val]) => {
return val.remotePath.map(({ path: i }) => {
return "./" + i;
});
});
})
.then((res) => {
console.log(res);
const ul = document.getElementById("index-list");
return res
.map((i) => {
const li = document.createElement("li");
li.innerHTML = `<a href="${i}">${i}</a>`;
return li;
})
.forEach((li) => {
console.log(li);
ul.appendChild(li);
});
});
</script>
</body>
</html>