zhangdocs 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.bin/zhangdocs.js +1 -1
- package/README.md +28 -57
- package/index.html +152 -0
- package/lib/build.js +13 -2
- package/lib/toc.js +20 -2
- package/md/README.md +40 -0
- package/package.json +46 -40
- package/static/css/_partial/head_nav.styl/head_nav.styl +239 -0
- package/static/css/_partial/highlight.styl/highlight.styl +103 -0
- package/static/css/_partial/markdown.styl/markdown.styl +121 -0
- package/static/css/_partial/reset.styl/reset.styl +101 -0
- package/static/css/_partial/variables.styl/variables.styl +10 -0
- package/static/css/main.css +1 -0
- package/static/css/main.styl/main.styl +156 -0
- package/static/img/forkgithub.png/forkgithub.png +0 -0
- package/theme/handbook/footer.ejs +58 -58
- package/theme/handbook/gitignore +22 -22
- package/theme/handbook/head.ejs +57 -57
- package/theme/handbook/header.ejs +5 -5
- package/theme/handbook/layout.ejs +109 -108
- package/theme/handbook/source/css/_partial/highlight.styl +103 -103
- package/theme/handbook/source/css/_partial/markdown.styl +122 -122
- package/theme/handbook/source/css/_partial/reset.styl +100 -100
- package/theme/handbook/source/css/_partial/variables.styl +9 -9
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
@import('_partial/reset.styl')
|
|
2
|
+
// CSS reset
|
|
3
|
+
global-reset()
|
|
4
|
+
reset-html()
|
|
5
|
+
|
|
6
|
+
@import('_partial/variables.styl')
|
|
7
|
+
@import('_partial/markdown.styl')
|
|
8
|
+
@import('_partial/highlight.styl')
|
|
9
|
+
@import('_partial/head_nav.styl')
|
|
10
|
+
|
|
11
|
+
*
|
|
12
|
+
box-sizing: border-box
|
|
13
|
+
body,html
|
|
14
|
+
height:100%
|
|
15
|
+
font-family: "Helvetica Neue", Helvetica, Microsoft Yahei, Hiragino Sans GB, WenQuanYi Micro Hei, sans-serif;
|
|
16
|
+
.logo
|
|
17
|
+
float:left
|
|
18
|
+
padding: 0 20px 0 0px
|
|
19
|
+
font-size: 24px
|
|
20
|
+
font-weight: 500
|
|
21
|
+
color: #563d7c
|
|
22
|
+
img
|
|
23
|
+
vertical-align: middle
|
|
24
|
+
margin: -4px 0 0 0
|
|
25
|
+
max-height: 27px
|
|
26
|
+
|
|
27
|
+
.container
|
|
28
|
+
padding-left: 15px
|
|
29
|
+
padding-right: 15px
|
|
30
|
+
width: 1124px
|
|
31
|
+
margin 0 auto
|
|
32
|
+
@media mq-tablet
|
|
33
|
+
width auto
|
|
34
|
+
@media mq-mobile
|
|
35
|
+
width auto
|
|
36
|
+
&:before
|
|
37
|
+
display: table
|
|
38
|
+
content: " "
|
|
39
|
+
&:after
|
|
40
|
+
display: table
|
|
41
|
+
content: " "
|
|
42
|
+
clear: both
|
|
43
|
+
|
|
44
|
+
.bs-docs-header
|
|
45
|
+
background:#445588
|
|
46
|
+
background-image: linear-gradient(to bottom,#445588 0,#458 100%)
|
|
47
|
+
background-repeat: repeat-x
|
|
48
|
+
position: relative
|
|
49
|
+
padding: 88px 0
|
|
50
|
+
color: #A3AFD4
|
|
51
|
+
font-size: 24px
|
|
52
|
+
text-align: left
|
|
53
|
+
text-shadow: 0 1px 0 rgba(0,0,0,.1)
|
|
54
|
+
@media mq-mobile
|
|
55
|
+
padding: 28px 0
|
|
56
|
+
h1,p
|
|
57
|
+
margin-right: 380px
|
|
58
|
+
@media mq-mobile
|
|
59
|
+
margin-right: 0
|
|
60
|
+
@media mq-tablet
|
|
61
|
+
margin-right 50px
|
|
62
|
+
h1
|
|
63
|
+
color: #fff
|
|
64
|
+
font-family: inherit
|
|
65
|
+
font-weight: 500
|
|
66
|
+
margin: .67em 0
|
|
67
|
+
margin-bottom: 10px
|
|
68
|
+
margin-top: 0
|
|
69
|
+
font-size: 60px
|
|
70
|
+
line-height: 1
|
|
71
|
+
text-align: left
|
|
72
|
+
@media mq-mobile
|
|
73
|
+
margin: .37em 0
|
|
74
|
+
text-align center
|
|
75
|
+
p
|
|
76
|
+
margin-bottom: 0
|
|
77
|
+
font-weight: 300
|
|
78
|
+
line-height: 1.4
|
|
79
|
+
.navbar-line
|
|
80
|
+
border-bottom: 1px solid #E9E9F1
|
|
81
|
+
|
|
82
|
+
.markdown-body
|
|
83
|
+
overflow: auto
|
|
84
|
+
.page-toc
|
|
85
|
+
width: 200px
|
|
86
|
+
float: right
|
|
87
|
+
width: 220px
|
|
88
|
+
background: #fff
|
|
89
|
+
padding: 9px 0 25px 20px
|
|
90
|
+
margin-top: 35px
|
|
91
|
+
border-left: 1px solid #EEE
|
|
92
|
+
font-family: "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,sans-serif !important
|
|
93
|
+
@media mq-tablet
|
|
94
|
+
width auto
|
|
95
|
+
@media mq-mobile
|
|
96
|
+
display none
|
|
97
|
+
ul
|
|
98
|
+
list-style-type: none
|
|
99
|
+
margin: 0
|
|
100
|
+
a
|
|
101
|
+
display: block
|
|
102
|
+
padding: 3px 0
|
|
103
|
+
color: #151515
|
|
104
|
+
text-decoration: none
|
|
105
|
+
font-weight:bold
|
|
106
|
+
line-height: 16px
|
|
107
|
+
font-size: 14px
|
|
108
|
+
&:hover
|
|
109
|
+
color:red
|
|
110
|
+
text-decoration: underline
|
|
111
|
+
li
|
|
112
|
+
padding-left:3px
|
|
113
|
+
text-align:left
|
|
114
|
+
float: initial
|
|
115
|
+
ul
|
|
116
|
+
margin:0 0 0 10px
|
|
117
|
+
list-style-type: square
|
|
118
|
+
padding: 0 0 0 9px
|
|
119
|
+
li
|
|
120
|
+
a
|
|
121
|
+
font-size:90%
|
|
122
|
+
font-weight:normal
|
|
123
|
+
border-bottom:0
|
|
124
|
+
.copyright
|
|
125
|
+
border-top: 1px dashed #E9E9E9
|
|
126
|
+
padding: 6px 0 5px 2px
|
|
127
|
+
margin: 32px 0 0 0
|
|
128
|
+
line-height: 16px
|
|
129
|
+
font-size: 12px
|
|
130
|
+
color: #dfdfdf
|
|
131
|
+
a
|
|
132
|
+
color: #D6DDF8
|
|
133
|
+
text-decoration: underline
|
|
134
|
+
&:hover
|
|
135
|
+
color:#333
|
|
136
|
+
|
|
137
|
+
.forkgithub
|
|
138
|
+
position: absolute
|
|
139
|
+
z-index: 2
|
|
140
|
+
right: 0
|
|
141
|
+
background: url("../img/forkgithub.png") 14px -15px no-repeat
|
|
142
|
+
@media mq-mobile
|
|
143
|
+
display none
|
|
144
|
+
@media mq-tablet
|
|
145
|
+
background-image inherit
|
|
146
|
+
a
|
|
147
|
+
display: block
|
|
148
|
+
width: 149px
|
|
149
|
+
height: 1px
|
|
150
|
+
padding-top 149px
|
|
151
|
+
overflow hidden
|
|
152
|
+
@media mq-tablet
|
|
153
|
+
padding-top 0
|
|
154
|
+
// height: 149px
|
|
155
|
+
height 50px
|
|
156
|
+
|
|
Binary file
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
$('.warpper .page-toc ul ul li a').on('click', function () {
|
|
3
|
-
$('.warpper .page-toc ul ul li a').removeClass('my-active')
|
|
4
|
-
$(this).addClass('my-active')
|
|
5
|
-
})
|
|
6
|
-
$('.logo').on('mouseenter', function () {
|
|
7
|
-
$('.nav').height('450px');
|
|
8
|
-
})
|
|
9
|
-
$('.nav').on('mouseleave', function () {
|
|
10
|
-
$('.nav').height('80px');
|
|
11
|
-
})
|
|
12
|
-
$('.logo').on('click', function () {
|
|
13
|
-
$('.nav').css('display', 'none');
|
|
14
|
-
$('.warpper').css('padding', '0px');
|
|
15
|
-
})
|
|
16
|
-
$('#toc-toggle').on('click', function () {
|
|
17
|
-
let width = $('.page-toc').width();
|
|
18
|
-
if (width > 100) {
|
|
19
|
-
$('.page-toc').width(0);
|
|
20
|
-
$('.page-toc').css({
|
|
21
|
-
'width': '0',
|
|
22
|
-
'min-width': '0',
|
|
23
|
-
'padding': '0',
|
|
24
|
-
'border': 'none'
|
|
25
|
-
});
|
|
26
|
-
$('.content').css('margin-left', '0px');
|
|
27
|
-
$(this).css({
|
|
28
|
-
'left': '0px'
|
|
29
|
-
});
|
|
30
|
-
} else {
|
|
31
|
-
$('.page-toc').width(200);
|
|
32
|
-
$('.page-toc').css({
|
|
33
|
-
'width': '200px',
|
|
34
|
-
'min-width': '0',
|
|
35
|
-
'padding': '0',
|
|
36
|
-
'border': 'none'
|
|
37
|
-
});
|
|
38
|
-
$('.content').css('margin-left', '200px');
|
|
39
|
-
$(this).css({
|
|
40
|
-
'left': '200px'
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
// 高亮当前页面菜单
|
|
46
|
-
var pathname = window.location.pathname;
|
|
47
|
-
var hash = window.location.hash;
|
|
48
|
-
var links = document.querySelectorAll('.nav a');
|
|
49
|
-
for (var i = 0; i < links.length; i++) {
|
|
50
|
-
var link = links[i];
|
|
51
|
-
var href = link.getAttribute('href');
|
|
52
|
-
if (href === pathname || href === hash) {
|
|
53
|
-
link.parentNode.classList.add('active');
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
</script>
|
|
57
|
-
</body>
|
|
58
|
-
|
|
1
|
+
<script>
|
|
2
|
+
$('.warpper .page-toc ul ul li a').on('click', function () {
|
|
3
|
+
$('.warpper .page-toc ul ul li a').removeClass('my-active')
|
|
4
|
+
$(this).addClass('my-active')
|
|
5
|
+
})
|
|
6
|
+
$('.logo').on('mouseenter', function () {
|
|
7
|
+
$('.nav').height('450px');
|
|
8
|
+
})
|
|
9
|
+
$('.nav').on('mouseleave', function () {
|
|
10
|
+
$('.nav').height('80px');
|
|
11
|
+
})
|
|
12
|
+
$('.logo').on('click', function () {
|
|
13
|
+
$('.nav').css('display', 'none');
|
|
14
|
+
$('.warpper').css('padding', '0px');
|
|
15
|
+
})
|
|
16
|
+
$('#toc-toggle').on('click', function () {
|
|
17
|
+
let width = $('.page-toc').width();
|
|
18
|
+
if (width > 100) {
|
|
19
|
+
$('.page-toc').width(0);
|
|
20
|
+
$('.page-toc').css({
|
|
21
|
+
'width': '0',
|
|
22
|
+
'min-width': '0',
|
|
23
|
+
'padding': '0',
|
|
24
|
+
'border': 'none'
|
|
25
|
+
});
|
|
26
|
+
$('.content').css('margin-left', '0px');
|
|
27
|
+
$(this).css({
|
|
28
|
+
'left': '0px'
|
|
29
|
+
});
|
|
30
|
+
} else {
|
|
31
|
+
$('.page-toc').width(200);
|
|
32
|
+
$('.page-toc').css({
|
|
33
|
+
'width': '200px',
|
|
34
|
+
'min-width': '0',
|
|
35
|
+
'padding': '0',
|
|
36
|
+
'border': 'none'
|
|
37
|
+
});
|
|
38
|
+
$('.content').css('margin-left', '200px');
|
|
39
|
+
$(this).css({
|
|
40
|
+
'left': '200px'
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// 高亮当前页面菜单
|
|
46
|
+
var pathname = window.location.pathname;
|
|
47
|
+
var hash = window.location.hash;
|
|
48
|
+
var links = document.querySelectorAll('.nav a');
|
|
49
|
+
for (var i = 0; i < links.length; i++) {
|
|
50
|
+
var link = links[i];
|
|
51
|
+
var href = link.getAttribute('href');
|
|
52
|
+
if (href === pathname || href === hash) {
|
|
53
|
+
link.parentNode.classList.add('active');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
</body>
|
|
58
|
+
|
|
59
59
|
</html>
|
package/theme/handbook/gitignore
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
*.iml
|
|
2
|
-
.idea/
|
|
3
|
-
.ipr
|
|
4
|
-
.iws
|
|
5
|
-
*~
|
|
6
|
-
~*
|
|
7
|
-
*.diff
|
|
8
|
-
*.patch
|
|
9
|
-
*.bak
|
|
10
|
-
.DS_Store
|
|
11
|
-
Thumbs.db
|
|
12
|
-
.project
|
|
13
|
-
.*proj
|
|
14
|
-
.svn/
|
|
15
|
-
*.swp
|
|
16
|
-
*.swo
|
|
17
|
-
*.pyc
|
|
18
|
-
*.pyo
|
|
19
|
-
.build
|
|
20
|
-
node_modules
|
|
21
|
-
.cache
|
|
22
|
-
zhangdocs-theme-*/
|
|
1
|
+
*.iml
|
|
2
|
+
.idea/
|
|
3
|
+
.ipr
|
|
4
|
+
.iws
|
|
5
|
+
*~
|
|
6
|
+
~*
|
|
7
|
+
*.diff
|
|
8
|
+
*.patch
|
|
9
|
+
*.bak
|
|
10
|
+
.DS_Store
|
|
11
|
+
Thumbs.db
|
|
12
|
+
.project
|
|
13
|
+
.*proj
|
|
14
|
+
.svn/
|
|
15
|
+
*.swp
|
|
16
|
+
*.swo
|
|
17
|
+
*.pyc
|
|
18
|
+
*.pyo
|
|
19
|
+
.build
|
|
20
|
+
node_modules
|
|
21
|
+
.cache
|
|
22
|
+
zhangdocs-theme-*/
|
package/theme/handbook/head.ejs
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
8
|
-
<title>
|
|
9
|
-
<%=title%>
|
|
10
|
-
</title>
|
|
11
|
-
<link rel="stylesheet" href="<%=relative_path%>static/css/main.css">
|
|
12
|
-
<link rel="stylesheet" href="https://static.docs-hub.com/bootstrapmin_1645176572503.css">
|
|
13
|
-
<!-- MathJax 配置 -->
|
|
14
|
-
<script>
|
|
15
|
-
MathJax = {
|
|
16
|
-
tex: {
|
|
17
|
-
inlineMath: [['$', '$'], ['\\(', '\\)']],
|
|
18
|
-
displayMath: [['$$', '$$'], ['\\[', '\\]']],
|
|
19
|
-
processEscapes: true
|
|
20
|
-
},
|
|
21
|
-
svg: {
|
|
22
|
-
fontCache: 'global'
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
</script>
|
|
26
|
-
<!-- 加载 MathJax -->
|
|
27
|
-
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
|
|
28
|
-
<script src="https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.js"></script>
|
|
29
|
-
<script>
|
|
30
|
-
document.addEventListener('DOMContentLoaded', function () {
|
|
31
|
-
mermaid.initialize({
|
|
32
|
-
startOnLoad: true,
|
|
33
|
-
theme: 'default',
|
|
34
|
-
themeVariables: {
|
|
35
|
-
primaryColor: '#ff6b6b',
|
|
36
|
-
primaryTextColor: '#333',
|
|
37
|
-
primaryBorderColor: '#ff6b6b',
|
|
38
|
-
lineColor: '#333',
|
|
39
|
-
secondaryColor: '#f8f9fa',
|
|
40
|
-
tertiaryColor: '#fff'
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
</script>
|
|
45
|
-
<style>
|
|
46
|
-
.page-toc>ul .red {
|
|
47
|
-
background: #f3f3f3;
|
|
48
|
-
z-index: 1;
|
|
49
|
-
border-left: 3px solid #009a61;
|
|
50
|
-
-webkit-transition: all .2s ease;
|
|
51
|
-
transition: all .2s ease;
|
|
52
|
-
color: #000
|
|
53
|
-
}
|
|
54
|
-
</style>
|
|
55
|
-
</head>
|
|
56
|
-
|
|
57
|
-
<body>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
8
|
+
<title>
|
|
9
|
+
<%=title%>
|
|
10
|
+
</title>
|
|
11
|
+
<link rel="stylesheet" href="<%=relative_path%>static/css/main.css">
|
|
12
|
+
<link rel="stylesheet" href="https://static.docs-hub.com/bootstrapmin_1645176572503.css">
|
|
13
|
+
<!-- MathJax 配置 -->
|
|
14
|
+
<script>
|
|
15
|
+
MathJax = {
|
|
16
|
+
tex: {
|
|
17
|
+
inlineMath: [['$', '$'], ['\\(', '\\)']],
|
|
18
|
+
displayMath: [['$$', '$$'], ['\\[', '\\]']],
|
|
19
|
+
processEscapes: true
|
|
20
|
+
},
|
|
21
|
+
svg: {
|
|
22
|
+
fontCache: 'global'
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
<!-- 加载 MathJax -->
|
|
27
|
+
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"></script>
|
|
28
|
+
<script src="https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.js"></script>
|
|
29
|
+
<script>
|
|
30
|
+
document.addEventListener('DOMContentLoaded', function () {
|
|
31
|
+
mermaid.initialize({
|
|
32
|
+
startOnLoad: true,
|
|
33
|
+
theme: 'default',
|
|
34
|
+
themeVariables: {
|
|
35
|
+
primaryColor: '#ff6b6b',
|
|
36
|
+
primaryTextColor: '#333',
|
|
37
|
+
primaryBorderColor: '#ff6b6b',
|
|
38
|
+
lineColor: '#333',
|
|
39
|
+
secondaryColor: '#f8f9fa',
|
|
40
|
+
tertiaryColor: '#fff'
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
</script>
|
|
45
|
+
<style>
|
|
46
|
+
.page-toc>ul .red {
|
|
47
|
+
background: #f3f3f3;
|
|
48
|
+
z-index: 1;
|
|
49
|
+
border-left: 3px solid #009a61;
|
|
50
|
+
-webkit-transition: all .2s ease;
|
|
51
|
+
transition: all .2s ease;
|
|
52
|
+
color: #000
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
55
|
+
</head>
|
|
56
|
+
|
|
57
|
+
<body>
|
|
58
58
|
<% include header.ejs %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<div class="nav">
|
|
2
|
-
<div class="logo">
|
|
3
|
-
<%= title %>
|
|
4
|
-
</div>
|
|
5
|
-
<%- menu_html -%>
|
|
1
|
+
<div class="nav">
|
|
2
|
+
<div class="logo">
|
|
3
|
+
<%= title %>
|
|
4
|
+
</div>
|
|
5
|
+
<%- menu_html -%>
|
|
6
6
|
</div>
|
|
@@ -1,109 +1,110 @@
|
|
|
1
|
-
<% include head.ejs %>
|
|
2
|
-
<div class="warpper" id="main-container" style="display: none;">
|
|
3
|
-
<div class="page-toc">
|
|
4
|
-
<%- toc_html %>
|
|
5
|
-
</div>
|
|
6
|
-
<div class="content markdown-body">
|
|
7
|
-
<svg id="toc-toggle" class="toc-toggle" stroke="black" fill="none" stroke-width="2" viewBox="0 0 24 24"
|
|
8
|
-
stroke-linecap="round" stroke-linejoin="round" class="h-4 w-4 text-black" xmlns="http://www.w3.org/2000/svg">
|
|
9
|
-
<rect x="3" y="3" width="18" height="18" rx="2" ry="2" />
|
|
10
|
-
<line x1="9" y1="3" x2="9" y2="21" />
|
|
11
|
-
</svg>
|
|
12
|
-
|
|
13
|
-
<%- markdown_html %>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
<!-- Token输入弹窗 -->
|
|
18
|
-
<div id="token-modal"
|
|
19
|
-
style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 9999; display: flex; justify-content: center; align-items: center;">
|
|
20
|
-
<div
|
|
21
|
-
style="background: white; padding: 30px; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); max-width: 400px; width: 90%;">
|
|
22
|
-
<h2 style="margin: 0 0 20px 0; text-align: center; color: #333;">访问验证</h2>
|
|
23
|
-
<p style="margin: 0 0 15px 0; color: #666; text-align: center;">请输入访问令牌</p>
|
|
24
|
-
<input type="password" id="token-input" placeholder="请输入token"
|
|
25
|
-
style="width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 5px; font-size: 16px; margin-bottom: 15px; box-sizing: border-box;">
|
|
26
|
-
<div style="text-align: center;">
|
|
27
|
-
<button id="token-submit"
|
|
28
|
-
style="background: #007bff; color: white; border: none; padding: 12px 30px; border-radius: 5px; font-size: 16px; cursor: pointer; margin-right: 10px;">验证</button>
|
|
29
|
-
<button id="token-cancel"
|
|
30
|
-
style="background: #6c757d; color: white; border: none; padding: 12px 30px; border-radius: 5px; font-size: 16px; cursor: pointer;">取消</button>
|
|
31
|
-
</div>
|
|
32
|
-
<div id="error-message" style="color: red; text-align: center; margin-top: 10px; display: none;">Token不正确,请重新输入
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
<script>
|
|
38
|
-
document.addEventListener('DOMContentLoaded', function () {
|
|
39
|
-
const expectedToken = '
|
|
40
|
-
const mainContainer = document.getElementById('main-container');
|
|
41
|
-
const navElement = document.querySelector('.nav');
|
|
42
|
-
const tokenModal = document.getElementById('token-modal');
|
|
43
|
-
const tokenInput = document.getElementById('token-input');
|
|
44
|
-
const tokenSubmit = document.getElementById('token-submit');
|
|
45
|
-
const tokenCancel = document.getElementById('token-cancel');
|
|
46
|
-
const errorMessage = document.getElementById('error-message');
|
|
47
|
-
|
|
48
|
-
// 检查是否已有正确的token
|
|
49
|
-
const existingToken = localStorage.getItem('token');
|
|
50
|
-
if (existingToken === expectedToken) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
tokenInput.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
<script src="https://static.docs-hub.com/
|
|
1
|
+
<% include head.ejs %>
|
|
2
|
+
<div class="warpper" id="main-container" style="display: none;">
|
|
3
|
+
<div class="page-toc">
|
|
4
|
+
<%- toc_html %>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="content markdown-body">
|
|
7
|
+
<svg id="toc-toggle" class="toc-toggle" stroke="black" fill="none" stroke-width="2" viewBox="0 0 24 24"
|
|
8
|
+
stroke-linecap="round" stroke-linejoin="round" class="h-4 w-4 text-black" xmlns="http://www.w3.org/2000/svg">
|
|
9
|
+
<rect x="3" y="3" width="18" height="18" rx="2" ry="2" />
|
|
10
|
+
<line x1="9" y1="3" x2="9" y2="21" />
|
|
11
|
+
</svg>
|
|
12
|
+
|
|
13
|
+
<%- markdown_html %>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<!-- Token输入弹窗 -->
|
|
18
|
+
<div id="token-modal"
|
|
19
|
+
style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 9999; display: flex; justify-content: center; align-items: center;">
|
|
20
|
+
<div
|
|
21
|
+
style="background: white; padding: 30px; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); max-width: 400px; width: 90%;">
|
|
22
|
+
<h2 style="margin: 0 0 20px 0; text-align: center; color: #333;">访问验证</h2>
|
|
23
|
+
<p style="margin: 0 0 15px 0; color: #666; text-align: center;">请输入访问令牌</p>
|
|
24
|
+
<input type="password" id="token-input" placeholder="请输入token"
|
|
25
|
+
style="width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 5px; font-size: 16px; margin-bottom: 15px; box-sizing: border-box;">
|
|
26
|
+
<div style="text-align: center;">
|
|
27
|
+
<button id="token-submit"
|
|
28
|
+
style="background: #007bff; color: white; border: none; padding: 12px 30px; border-radius: 5px; font-size: 16px; cursor: pointer; margin-right: 10px;">验证</button>
|
|
29
|
+
<button id="token-cancel"
|
|
30
|
+
style="background: #6c757d; color: white; border: none; padding: 12px 30px; border-radius: 5px; font-size: 16px; cursor: pointer;">取消</button>
|
|
31
|
+
</div>
|
|
32
|
+
<div id="error-message" style="color: red; text-align: center; margin-top: 10px; display: none;">Token不正确,请重新输入
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
document.addEventListener('DOMContentLoaded', function () {
|
|
39
|
+
const expectedToken = '83687401';
|
|
40
|
+
const mainContainer = document.getElementById('main-container');
|
|
41
|
+
const navElement = document.querySelector('.nav');
|
|
42
|
+
const tokenModal = document.getElementById('token-modal');
|
|
43
|
+
const tokenInput = document.getElementById('token-input');
|
|
44
|
+
const tokenSubmit = document.getElementById('token-submit');
|
|
45
|
+
const tokenCancel = document.getElementById('token-cancel');
|
|
46
|
+
const errorMessage = document.getElementById('error-message');
|
|
47
|
+
|
|
48
|
+
// 检查是否已有正确的token
|
|
49
|
+
const existingToken = localStorage.getItem('token');
|
|
50
|
+
if (existingToken === expectedToken) {
|
|
51
|
+
tokenModal.style.display = 'none';
|
|
52
|
+
showContent();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 显示token输入弹窗
|
|
57
|
+
tokenModal.style.display = 'flex';
|
|
58
|
+
|
|
59
|
+
// 验证token
|
|
60
|
+
function verifyToken() {
|
|
61
|
+
const inputToken = tokenInput.value.trim();
|
|
62
|
+
if (inputToken === expectedToken) {
|
|
63
|
+
localStorage.setItem('token', inputToken);
|
|
64
|
+
showContent();
|
|
65
|
+
tokenModal.style.display = 'none';
|
|
66
|
+
} else {
|
|
67
|
+
errorMessage.style.display = 'block';
|
|
68
|
+
tokenInput.value = '';
|
|
69
|
+
tokenInput.focus();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// 显示内容
|
|
74
|
+
function showContent() {
|
|
75
|
+
mainContainer.style.display = 'block';
|
|
76
|
+
if (navElement) navElement.style.display = 'block';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// 隐藏内容
|
|
80
|
+
function hideContent() {
|
|
81
|
+
mainContainer.style.display = 'none';
|
|
82
|
+
if (navElement) navElement.style.display = 'none';
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// 事件监听
|
|
86
|
+
tokenSubmit.addEventListener('click', verifyToken);
|
|
87
|
+
tokenCancel.addEventListener('click', function () {
|
|
88
|
+
hideContent();
|
|
89
|
+
tokenModal.style.display = 'none';
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
tokenInput.addEventListener('keypress', function (e) {
|
|
93
|
+
if (e.key === 'Enter') {
|
|
94
|
+
verifyToken();
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
// 点击弹窗外部关闭
|
|
99
|
+
tokenModal.addEventListener('click', function (e) {
|
|
100
|
+
if (e.target === tokenModal) {
|
|
101
|
+
hideContent();
|
|
102
|
+
tokenModal.style.display = 'none';
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<script src="https://static.docs-hub.com/jquerymin_1645176580555.js"></script>
|
|
109
|
+
<script src="https://static.docs-hub.com/bootstrapmin_1645176554753.js"></script>
|
|
109
110
|
<% include footer.ejs %>
|