-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
72 lines (68 loc) · 2.01 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
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="https://nop.crazydan.io/img/logo.png" />
<title>Nop 组件包仓库(非官方)使用说明</title>
<script>
window.ZeroMdConfig = {
markedUrl: './assets/marked.min.js',
prismUrl: [
['./assets/prism.min.js', 'data-manual'],
'./assets/prism-autoloader.min.js'
],
cssUrls: ['./assets/github-markdown.min.css', './assets/prism.min.css']
};
</script>
<script type="module" src="./assets/zero-md.min.js"></script>
<style>
body {
padding: 2rem 5rem;
}
@media only screen and (max-width: 768px) {
body {
padding: 2rem;
}
}
zero-md .loading {
text-align: center;
font-size: 2rem;
}
pre.language-ignore {
max-height: 15rem;
}
</style>
</head>
<body>
<zero-md src="USAGE.md" no-shadow="true">
<div class="loading">页面加载中,请耐心等待 ...</div>
</zero-md>
<script>
const app = document.querySelector('zero-md');
const current_repo_url =
window.location.origin + window.location.pathname;
const default_repo_url = 'https://nop.repo.crazydan.io/';
app.addEventListener('zero-md-rendered', (e) => {
if (!e.detail.stamped || !e.detail.stamped.body) {
return;
}
app.querySelector('.loading').remove();
if (default_repo_url != current_repo_url) {
setTimeout(() => {
app.querySelectorAll('code').forEach((code) => {
code.childNodes.forEach((e) => {
if (
e.nodeType === Node.TEXT_NODE &&
e.textContent === default_repo_url
) {
e.textContent = current_repo_url;
}
});
});
}, 500);
}
});
</script>
</body>
</html>