公告管理
This commit is contained in:
1 parent
374ce74e2d
commit
c0621ff48b
15 files changed
+4641
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,336 @@
|
||||
<style>
|
||||
/* doc sidebar */
|
||||
.jianghu-doc-sidebar{
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: var(--vp-z-index-sidebar);
|
||||
padding: 0 32px 96px;
|
||||
width: calc(100vw - 64px);
|
||||
max-width: var(--vp-sidebar-width-mobile);
|
||||
opacity: 0;
|
||||
background-color: var(--vt-c-bg);
|
||||
box-shadow: var(--vt-c-shadow-3);
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
transform: translate(-100%);
|
||||
transition: background-color .5s,opacity .5s,transform .3s ease;
|
||||
-webkit-transition: background-color .5s,opacity .5s,transform .3s ease;
|
||||
-moz-transition: background-color .5s,opacity .5s,transform .3s ease;
|
||||
-ms-transition: background-color .5s,opacity .5s,transform .3s ease;
|
||||
-o-transition: background-color .5s,opacity .5s,transform .3s ease;
|
||||
}
|
||||
.jianghu-doc-sidebar::-webkit-scrollbar {
|
||||
display: none; /* Chrome Safari */
|
||||
scrollbar-width: none; /* firefox */
|
||||
-ms-overflow-style: none; /* IE 10+ */
|
||||
}
|
||||
.jianghu-doc-sidebar.open{
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transform: translate(0);
|
||||
transition: background-color .5s,opacity .25s,transform .5s cubic-bezier(.19,1,.22,1);
|
||||
}
|
||||
.jianghu-doc-sidebar-nav{
|
||||
padding-top: 24px;
|
||||
outline: 0;
|
||||
}
|
||||
.jianghu-doc-sidebar-group+.jianghu-doc-sidebar-group{
|
||||
padding-top: 24px;
|
||||
}
|
||||
.jianghu-doc-sidebar-group+.jianghu-doc-sidebar-group.no-group{
|
||||
padding-top: 0;
|
||||
}
|
||||
.jianghu-doc-sidebar-group-title{
|
||||
padding: 6px 0;
|
||||
}
|
||||
.jianghu-doc-sidebar-group-title-text{
|
||||
line-height: 20px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--vt-c-text-1);
|
||||
transition: color .5s;
|
||||
}
|
||||
.jianghu-doc-sidebar-group-link{
|
||||
display: block;
|
||||
padding: 6px 0;
|
||||
}
|
||||
.jianghu-doc-sidebar-group-link-text{
|
||||
line-height: 20px;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: var(--vt-c-text-2);
|
||||
transition: color .5s;
|
||||
}
|
||||
.jianghu-doc-sidebar-group-link-active .jianghu-doc-sidebar-group-link-text{
|
||||
font-weight: 600;
|
||||
color: var(--vt-c-brand);
|
||||
transition: color .25s;
|
||||
}
|
||||
.jianghu-doc-sidebar-group-link:hover .jianghu-doc-sidebar-group-link-text{
|
||||
color: var(--vt-c-text-light-1);
|
||||
transition: color .25s;
|
||||
}
|
||||
.jianghu-doc-sidebar-group-link-active:hover .jianghu-doc-sidebar-group-link-text{
|
||||
color: var(--vt-c-brand);
|
||||
}
|
||||
@media (min-width: 960px){
|
||||
.jianghu-doc-sidebar {
|
||||
/* top: calc(var(--vt-nav-height) + var(--vt-banner-height, 0px)); */
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
border-right: 1px solid var(--vt-c-divider-light);
|
||||
width: var(--vp-sidebar-width-small);
|
||||
max-width: 100%;
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
box-shadow: none;
|
||||
transform: translate(0);
|
||||
transition: border-color .5s,background-color .5s;
|
||||
}
|
||||
.jianghu-doc-sidebar-group+.jianghu-doc-sidebar-group{
|
||||
padding-top: 16px;
|
||||
}
|
||||
.jianghu-doc-sidebar-group-title{
|
||||
padding: 4px 0;
|
||||
}
|
||||
.jianghu-doc-sidebar-group-link{
|
||||
padding: 4px 0;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1440px){
|
||||
.jianghu-doc-sidebar {
|
||||
padding: 0 32px 96px calc((100% - var(--vp-screen-max-width)) / 2);
|
||||
width: calc((100% - var(--vp-screen-max-width)) / 2 + var(--vp-sidebar-width-small));
|
||||
}
|
||||
}
|
||||
|
||||
/* doc content */
|
||||
.jianghu-doc-contentDoc {
|
||||
padding: 32px 24px 96px;
|
||||
min-height: calc(100vh - var(--vt-nav-height));
|
||||
}
|
||||
.jianghu-doc-contentDoc-aside {
|
||||
position: relative;
|
||||
display: none;
|
||||
flex-shrink: 0;
|
||||
padding-left: 64px;
|
||||
width: 320px;
|
||||
}
|
||||
.jianghu-doc-contentDoc-aside-container {
|
||||
position: sticky;
|
||||
width: 224px;
|
||||
/* top: calc(var(--vt-nav-height) + var(--vt-banner-height, 0px) + 24px); */
|
||||
top: 24px;
|
||||
bottom: 0;
|
||||
}
|
||||
.jianghu-doc-contentDoc-aside-outline {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
position: relative;
|
||||
}
|
||||
.jianghu-doc-contentDoc-aside-outline-title{
|
||||
font-weight: 700;
|
||||
margin-bottom: 4px;
|
||||
text-transform: uppercase;
|
||||
font-size: 11px;
|
||||
letter-spacing: .4px;
|
||||
}
|
||||
.jianghu-doc-contentDoc-aside-outline-link{
|
||||
color: var(--vt-c-text-2) !important;
|
||||
line-height: 28px !important;
|
||||
display: block !important;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
white-space: nowrap !important;
|
||||
margin: 0 !important;
|
||||
font-weight: 500 !important;
|
||||
padding: 0 8px !important;
|
||||
position: relative;
|
||||
}
|
||||
.jianghu-doc-contentDoc-aside-outline-link:before{
|
||||
content: '';
|
||||
position: absolute;
|
||||
background-color: var(--vt-c-green);
|
||||
border-radius: 4px;
|
||||
width: 4px;
|
||||
height: 20px;
|
||||
opacity: 0;
|
||||
top: 5px;
|
||||
left: 0;
|
||||
z-index: 0;
|
||||
transition: top .25s cubic-bezier(0,1,.5,1),opacity .3s,background-color .5s;
|
||||
-webkit-transition: top .25s cubic-bezier(0,1,.5,1),opacity .3s,background-color .5s;
|
||||
-moz-transition: top .25s cubic-bezier(0,1,.5,1),opacity .3s,background-color .5s;
|
||||
-ms-transition: top .25s cubic-bezier(0,1,.5,1),opacity .3s,background-color .5s;
|
||||
-o-transition: top .25s cubic-bezier(0,1,.5,1),opacity .3s,background-color .5s;
|
||||
}
|
||||
.jianghu-doc-contentDoc-aside-outline-link.active{
|
||||
border-left: none !important;
|
||||
}
|
||||
.jianghu-doc-contentDoc-aside-outline-link.active:before{
|
||||
opacity: 1;
|
||||
transition: top .25s cubic-bezier(0,1,.5,1),opacity .25s,background-color .5s;
|
||||
}
|
||||
.jianghu-doc-contentDoc-aside-outline-link:hover, .jianghu-doc-contentDoc-aside-outline-link.active{
|
||||
color: var(--vt-c-text-1) !important;
|
||||
}
|
||||
.jianghu-doc-contentDoc-aside-menu .nav-item{
|
||||
width: 100%;
|
||||
}
|
||||
.jianghu-doc-contentDoc-content {
|
||||
margin: 0 auto;
|
||||
max-width: 750px;
|
||||
position: relative;
|
||||
}
|
||||
.jianghu-doc-contentDoc-main-doc{
|
||||
font-size: 16px;
|
||||
line-height: 1.7;
|
||||
--vt-doc-code-font-size: 14px;
|
||||
--vt-doc-code-line-height: 1.5;
|
||||
margin-bottom: 54px;
|
||||
position: relative;
|
||||
}
|
||||
.jianghu-doc-contentDoc-main-edit-links{
|
||||
margin: 0 0 32px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.jianghu-doc-contentDoc-main-edit-icon{
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
color: var(--vt-c-brand);
|
||||
display: inline-block;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
}
|
||||
.jianghu-doc-contentDoc-main-edit-link{
|
||||
font-size: 14px;
|
||||
color: var(--vt-c-brand);
|
||||
font-weight: 500;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.jianghu-doc-contentDoc-main-edit-link:hover{
|
||||
color: var(--vt-c-brand);
|
||||
}
|
||||
.jianghu-doc-contentDoc-main-update-time{
|
||||
font-size: 11px;
|
||||
color: var(--vt-c-text-2);
|
||||
}
|
||||
.jianghu-doc-contentDoc-footer {
|
||||
border-top: 1px solid var(--vt-c-divider-light);
|
||||
padding-top: 1rem;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.jianghu-doc-contentDoc-footer-link {
|
||||
display: inline-block;
|
||||
font-weight: 500;
|
||||
font-size: 16px;
|
||||
max-width: 48%;
|
||||
}
|
||||
.jianghu-doc-contentDoc-footer-link .jianghu-doc-contentDoc-footer-next-link {
|
||||
margin-left: auto;
|
||||
text-align: right;
|
||||
}
|
||||
.jianghu-doc-contentDoc-footer-desc {
|
||||
font-size: 11px;
|
||||
color: var(--vt-c-text-2);
|
||||
display: block;
|
||||
}
|
||||
.jianghu-doc-contentDoc-footer-title {
|
||||
color: var(--vt-c-brand);
|
||||
transition: color .25s;
|
||||
}
|
||||
.jianghu-doc-contentDoc-footer-icon{
|
||||
display: inline-block;
|
||||
margin-top: -2px;
|
||||
margin-left: 4px;
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
fill: var(--vt-c-text-3);
|
||||
transition: fill .25s;
|
||||
margin: -2px 0 0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.jianghu-doc-contentDoc-footer-link:hover .jianghu-doc-contentDoc-footer-title {
|
||||
color: var(--vt-c-brand-highlight);
|
||||
}
|
||||
@media (min-width: 768px){
|
||||
.jianghu-doc-contentDoc {
|
||||
padding: 48px 32px 96px;
|
||||
}
|
||||
}
|
||||
@media (min-width: 960px){
|
||||
.jianghu-doc-content{
|
||||
/* padding-top: var(--vt-nav-height); */
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.jianghu-doc-contentDoc {
|
||||
padding: 64px 64px 96px;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1280px){
|
||||
.jianghu-doc-contentDoc {
|
||||
padding: 64px 0 96px 64px;
|
||||
}
|
||||
.jianghu-doc-contentDoc-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.jianghu-doc-contentDoc-aside {
|
||||
display: block;
|
||||
order: 2;
|
||||
}
|
||||
.jianghu-doc-contentDoc-content {
|
||||
min-width: 750px;
|
||||
margin: 0;
|
||||
order: 1;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1440px){
|
||||
|
||||
.jianghu-doc-contentDoc {
|
||||
padding: 64px 0 96px 96px;
|
||||
}
|
||||
.jianghu-doc-contentDoc-aside {
|
||||
padding-left: 96px;
|
||||
}
|
||||
}
|
||||
@media (max-width: 960px){
|
||||
.jianghu-doc-contentDoc-aside{
|
||||
display: block;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
z-index: var(--vp-z-index-sidebar);
|
||||
padding: 0 32px 96px;
|
||||
width: calc(100vw - 64px);
|
||||
max-width: var(--vp-sidebar-width-mobile);
|
||||
opacity: 0;
|
||||
background-color: var(--vt-c-bg);
|
||||
box-shadow: var(--vt-c-shadow-3);
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
transform: translate(100%);
|
||||
transition: background-color .5s,opacity .5s,transform .3s ease;
|
||||
-webkit-transition: background-color .5s,opacity .5s,transform .3s ease;
|
||||
-moz-transition: background-color .5s,opacity .5s,transform .3s ease;
|
||||
-ms-transition: background-color .5s,opacity .5s,transform .3s ease;
|
||||
-o-transition: background-color .5s,opacity .5s,transform .3s ease;
|
||||
-webkit-transform: translate(100%);
|
||||
-moz-transform: translate(100%);
|
||||
-ms-transform: translate(100%);
|
||||
-o-transform: translate(100%);
|
||||
}
|
||||
.jianghu-doc-contentDoc-aside.open{
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transform: translate(0);
|
||||
transition: background-color .5s,opacity .25s,transform .5s cubic-bezier(.19,1,.22,1);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,286 @@
|
||||
<style>
|
||||
/* docs */
|
||||
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 {
|
||||
position: relative;
|
||||
font-weight: 600;
|
||||
line-height: 1.5;
|
||||
outline: none;
|
||||
}
|
||||
.markdown-body h1 {
|
||||
margin: 0 0 3rem;
|
||||
font-size: 38px;
|
||||
line-height: 1.4;
|
||||
letter-spacing: -.02em;
|
||||
}
|
||||
.markdown-body h2 {
|
||||
margin: 4rem 0 1.8rem;
|
||||
border-top: 1px solid var(--vt-c-divider-light);
|
||||
padding-top: 1.8rem;
|
||||
font-size: 24px;
|
||||
letter-spacing: -.02em;
|
||||
}
|
||||
.markdown-body h3 {
|
||||
font-size: 19px;
|
||||
letter-spacing: -.01em;
|
||||
margin: 3rem 0 1.25rem;
|
||||
}
|
||||
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body summary {
|
||||
margin-bottom: 1.2em;
|
||||
}
|
||||
.markdown-body ul {
|
||||
padding-left: 1.25rem;
|
||||
}
|
||||
.markdown-body ul>li:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
border-radius: 50%;
|
||||
background-color: var(--vt-c-text-3);
|
||||
transition: background-color .5s;
|
||||
left: -1.25rem;
|
||||
top: 0.75rem;
|
||||
}
|
||||
.markdown-body li {
|
||||
position: relative;
|
||||
margin: 1px 0;
|
||||
}
|
||||
.markdown-body a {
|
||||
font-weight: 500;
|
||||
color: var(--vt-c-brand);
|
||||
transition: color .25s;
|
||||
text-decoration-style: dotted;
|
||||
}
|
||||
.markdown-body>blockquote {
|
||||
margin: 28px 0;
|
||||
padding: 20px 24px 4px 42px;
|
||||
border-radius: 8px;
|
||||
overflow-x: auto;
|
||||
transition: color .5s,background-color .5s;
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
font-weight: 500;
|
||||
color: #0000008c;
|
||||
background-color: var(--vt-c-bg-soft);
|
||||
}
|
||||
.markdown-body>blockquote[class="default"] {
|
||||
border: 1px solid var(--vt-c-brand);
|
||||
}
|
||||
.markdown-body>blockquote p {
|
||||
margin-bottom: 8px;
|
||||
font-size: 15px;
|
||||
font-weight: 500;
|
||||
color: var(--vt-c-text-1);
|
||||
transition: color .5s;
|
||||
}
|
||||
.markdown-body>blockquote[class="default"]:before {
|
||||
color: var(--vt-c-brand);
|
||||
}
|
||||
.markdown-body>blockquote:before {
|
||||
content: "\24d8";
|
||||
position: absolute;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
top: 20px;
|
||||
left: 17px;
|
||||
}
|
||||
.markdown-body :not(pre,h1,h2,h3,h4,h5,h6,li)>code{
|
||||
font-size: var(--vt-doc-code-font-size);
|
||||
}
|
||||
.markdown-body :not(pre,li)>code{
|
||||
background-color: var(--vt-c-bg-mute);
|
||||
padding: 0.15em 0.5em;
|
||||
border-radius: 4px;
|
||||
color: var(--vt-c-text-code);
|
||||
transition: color .5s,background-color .5s;
|
||||
}
|
||||
.markdown-body pre {
|
||||
position: relative;
|
||||
margin: 28px -24px;
|
||||
background-color: #292d3e;
|
||||
overflow-x: auto;
|
||||
transition: background-color .5s;
|
||||
}
|
||||
.markdown-body pre ol, .markdown-body pre code {
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
.markdown-body pre ol{
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin: 0;
|
||||
padding: 14px 24px;
|
||||
background: transparent;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.markdown-body pre code {
|
||||
display: inline-block;
|
||||
padding: 0;
|
||||
line-height: var(--vt-doc-code-line-height);
|
||||
font-size: var(--vt-doc-code-font-size);
|
||||
color: #a6accd;
|
||||
transition: color .5s;
|
||||
}
|
||||
@media (min-width: 640px){
|
||||
.markdown-body pre {
|
||||
margin: 28px 0;
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
@media (min-width: 768px){
|
||||
.markdown-body :not(pre,li)>code{
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
@media (max-width: 768px){
|
||||
.markdown-body h1 {
|
||||
font-size: 32px;
|
||||
margin-bottom: 1.8rem;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* table */
|
||||
.markdown-body table {
|
||||
display: block;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
word-break: normal;
|
||||
word-break: keep-all;
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
.editormd-preview-container table thead tr, .editormd-html-preview table thead tr {
|
||||
background-color: #F8F8F8;
|
||||
}
|
||||
.markdown-body table tr {
|
||||
background-color: #fff;
|
||||
border-top: 1px solid #ccc;
|
||||
}
|
||||
.markdown-body table th, .markdown-body table td {
|
||||
padding: 6px 13px;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
.markdown-body table th {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* 字体颜色 */
|
||||
.pln {
|
||||
color: #a6accd;
|
||||
}
|
||||
|
||||
/* plain text */
|
||||
@media screen {
|
||||
.str {
|
||||
color: #C3E88D;
|
||||
}
|
||||
|
||||
/* string content */
|
||||
.kwd {
|
||||
color: #82AAFF;
|
||||
}
|
||||
|
||||
/* a keyword */
|
||||
.com {
|
||||
color: #676E95;
|
||||
}
|
||||
|
||||
/* a comment */
|
||||
.typ {
|
||||
color: #C792EA;
|
||||
}
|
||||
|
||||
/* a type name */
|
||||
.lit {
|
||||
color: #89DDFF;
|
||||
}
|
||||
|
||||
/* a literal value */
|
||||
/* punctuation, lisp open bracket, lisp close bracket */
|
||||
.pun, .opn, .clo {
|
||||
color: #FFCB6B;
|
||||
}
|
||||
|
||||
.tag {
|
||||
color: #F07178;
|
||||
}
|
||||
|
||||
/* a markup tag name */
|
||||
.atn {
|
||||
color: #C792EA;
|
||||
}
|
||||
|
||||
/* a markup attribute name */
|
||||
.atv {
|
||||
color: #C3E88D;
|
||||
}
|
||||
|
||||
/* a markup attribute value */
|
||||
.dec, .var {
|
||||
color: #606;
|
||||
}
|
||||
|
||||
/* a declaration; a variable name */
|
||||
.fun {
|
||||
color: red;
|
||||
}
|
||||
|
||||
/* a function name */
|
||||
}
|
||||
/* Use higher contrast and text-weight for printable form. */
|
||||
@media print, projection {
|
||||
.str {
|
||||
color: #C3E88D;
|
||||
}
|
||||
|
||||
.kwd {
|
||||
color: #82AAFF;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.com {
|
||||
color: #676E95;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.typ {
|
||||
color: #C792EA;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.lit {
|
||||
color: #89DDFF;
|
||||
}
|
||||
|
||||
.pun, .opn, .clo {
|
||||
color: #FFCB6B;
|
||||
}
|
||||
|
||||
.tag {
|
||||
color: #F07178;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.atn {
|
||||
color: #404;
|
||||
}
|
||||
|
||||
.atv {
|
||||
color: #C3E88D;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
<script type="text/javascript">
|
||||
/*
|
||||
########################################################
|
||||
### 页面js ###
|
||||
########################################################
|
||||
*/
|
||||
|
||||
// Ajax默认配置
|
||||
$.ajaxSetup({
|
||||
data: {csrfmiddlewaretoken: '{{ csrf_token }}' },
|
||||
});
|
||||
|
||||
// 视频iframe域名白名单
|
||||
var iframe_whitelist = '{{ iframe_whitelist }}'.split(',')
|
||||
|
||||
// 展开文档页左边菜单
|
||||
function openDocMenu(){
|
||||
$(".vt-backdrop").addClass("open");
|
||||
$(".jianghu-doc-sidebar").addClass('open');
|
||||
};
|
||||
// 收起文档页左边菜单
|
||||
function closeDocMenu(){
|
||||
$(".jianghu-doc-sidebar").removeClass('open');
|
||||
};
|
||||
// 展开文档页大纲
|
||||
function openDocAside(){
|
||||
$(".vt-backdrop").addClass("open");
|
||||
$(".jianghu-doc-contentDoc-aside").addClass('open');
|
||||
};
|
||||
// 收起文档页大纲
|
||||
function closeDocAside(){
|
||||
$(".jianghu-doc-contentDoc-aside").removeClass('open');
|
||||
};
|
||||
// 关闭遮罩
|
||||
function closeBackdrop(){
|
||||
$(".vt-backdrop").removeClass("open");
|
||||
closeDocMenu()
|
||||
closeDocAside()
|
||||
};
|
||||
// 展开mobile navBarMenus
|
||||
function openNavBarMenus(){
|
||||
closeUserCenter()
|
||||
$("html").css("overflow","hidden");
|
||||
$(".jianghu-toggleNavBarMenus-closeIcon").css("display","block");
|
||||
$(".jianghu-toggleNavBarMenus-menuIcon").css("display","none");
|
||||
$("#jianghu-header-mobile-navBarMenus").addClass('open');
|
||||
$("#jianghu-mobile-toggle-navBarMenus").addClass('is-active');
|
||||
};
|
||||
// 收起mobile navBarMenus
|
||||
function closeNavBarMenus(){
|
||||
$("html").css("overflow","auto");
|
||||
$(".jianghu-toggleNavBarMenus-closeIcon").css("display","none");
|
||||
$(".jianghu-toggleNavBarMenus-menuIcon").css("display","block");
|
||||
$("#jianghu-header-mobile-navBarMenus").removeClass('open');
|
||||
$("#jianghu-mobile-toggle-navBarMenus").removeClass('is-active');
|
||||
};
|
||||
// 展开mobile userCenter
|
||||
function openUserCenter(){
|
||||
closeNavBarMenus()
|
||||
$("html").css("overflow","hidden");
|
||||
$(".jianghu-toggleUserCenter-closeIcon").css("display","block");
|
||||
$(".jianghu-toggleUserCenter-userIcon").css("display","none");
|
||||
$("#jianghu-header-mobile-userCenter").addClass('open');
|
||||
$("#jianghu-mobile-toggle-userCenter").addClass('is-active');
|
||||
};
|
||||
// 收起mobile userCenter
|
||||
function closeUserCenter(){
|
||||
$("html").css("overflow","auto");
|
||||
$(".jianghu-toggleUserCenter-closeIcon").css("display","none");
|
||||
$(".jianghu-toggleUserCenter-userIcon").css("display","block");
|
||||
$("#jianghu-header-mobile-userCenter").removeClass('open');
|
||||
$("#jianghu-mobile-toggle-userCenter").removeClass('is-active');
|
||||
};
|
||||
// 生成文档大纲
|
||||
function generateSidebar(){
|
||||
// 遍历文章中的所有标题
|
||||
const allHeaders = []
|
||||
Array.from(document.getElementById('doc-content').children).forEach((item, i) => {
|
||||
if (item.tagName.length === 2 && item.tagName !== 'HR' && item.tagName.indexOf('H') === 0) {
|
||||
if(item.id){
|
||||
const newId = 'links-' + i;
|
||||
item.id = newId;
|
||||
}
|
||||
allHeaders.push(item)
|
||||
}
|
||||
})
|
||||
// 标题分组
|
||||
let groupAllHeaders = []
|
||||
allHeaders.forEach(h => {
|
||||
if(h.localName === 'h1' || h.localName === 'h2'){
|
||||
groupAllHeaders.push(h);
|
||||
}else if(h.localName === 'h3'){
|
||||
let parentH = groupAllHeaders[groupAllHeaders.length - 1];
|
||||
if(parentH){
|
||||
parentH.childH = parentH.childH ? parentH.childH.concat(h) : [h]
|
||||
}
|
||||
}
|
||||
})
|
||||
// 生成html
|
||||
var sidebar = ''
|
||||
groupAllHeaders.forEach(h => {
|
||||
sidebar += ' <li class="nav-item">'
|
||||
sidebar += ' <a class="nav-link jianghu-doc-contentDoc-aside-outline-link" href="#' + h.id + '">' + h.innerText + '</a>'
|
||||
if(h.childH){
|
||||
sidebar += '<ul class="nav flex-column ps-3">'
|
||||
h.childH.forEach(childH => {
|
||||
sidebar += '<li class="nav-item">'
|
||||
sidebar += '<a class="nav-link jianghu-doc-contentDoc-aside-outline-link" href="#' + childH.id + '">' + childH.innerText + '</a>'
|
||||
sidebar += '</li>'
|
||||
})
|
||||
sidebar += '</ul>'
|
||||
}
|
||||
sidebar += ' </li>'
|
||||
})
|
||||
$('#jianghu-doc-contentDoc-aside-menu').empty().html(sidebar)
|
||||
//body绑定的scroll事件(需大于一个标题,否则scrollspy.js会报错)
|
||||
if(groupAllHeaders.length > 1){
|
||||
$('body').attr('data-mdb-spy', 'scroll');
|
||||
}
|
||||
}
|
||||
// 显示success alert
|
||||
function showSuccessAlert(msg){
|
||||
var temp = '<div class="alert alert-success fade alert-fixed show" role="alert">'
|
||||
temp += '<i class="fas fa-check-circle me-3"></i>'
|
||||
temp += msg
|
||||
temp += '</div>'
|
||||
$('body').append(temp);
|
||||
setTimeout(()=>{
|
||||
$('.alert-success').remove()
|
||||
}, 2000)
|
||||
}
|
||||
// 显示fail alert
|
||||
function showFailAlert(msg){
|
||||
var temp = '<div class="alert alert-danger fade alert-fixed show" role="alert">'
|
||||
temp += '<i class="fas fa-times-circle me-3"></i>'
|
||||
temp += msg
|
||||
temp += '</div>'
|
||||
$('body').append(temp);
|
||||
setTimeout(()=>{
|
||||
$('.alert-danger').remove()
|
||||
}, 2000)
|
||||
}
|
||||
// 显示loading
|
||||
function showLoading(){
|
||||
var temp = '<div class="spinner-border" role="status"><span class="visually-hidden">Loading...</span></div>'
|
||||
$('body').append(temp);
|
||||
$(".vt-backdrop").addClass("open light");
|
||||
$(".vt-backdrop").attr("closeable", "false");
|
||||
}
|
||||
// 删除loading
|
||||
function hideLoading(){
|
||||
$('.spinner-border').remove()
|
||||
$(".vt-backdrop").removeClass("open light");
|
||||
$(".vt-backdrop").removeAttr("closeable");
|
||||
}
|
||||
$(function(){
|
||||
// 生成当前网页链接
|
||||
$("input[name=current_url]").val(document.URL)
|
||||
// 切换侧边栏
|
||||
$("#jianghu-mobile-toggle-docMenu").click(openDocMenu);
|
||||
// 切换大纲
|
||||
$("#jianghu-mobile-toggle-docAside").click(openDocAside);
|
||||
// 切换mobile navBarMenus
|
||||
$("#jianghu-mobile-toggle-navBarMenus").click(function(){
|
||||
if($(this).hasClass('is-active')){
|
||||
closeNavBarMenus()
|
||||
}else{
|
||||
openNavBarMenus()
|
||||
}
|
||||
});
|
||||
// 切换mobile userCenter
|
||||
$("#jianghu-mobile-toggle-userCenter").click(function(){
|
||||
if($(this).hasClass('is-active')){
|
||||
closeUserCenter()
|
||||
}else{
|
||||
openUserCenter()
|
||||
}
|
||||
});
|
||||
// 关闭遮罩
|
||||
$(".vt-backdrop").click(() => {
|
||||
if($(".vt-backdrop").attr("closeable") !== "false"){
|
||||
closeBackdrop()
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,289 @@
|
||||
<style>
|
||||
:root {
|
||||
--vt-c-white: #ffffff;
|
||||
--vt-c-white-soft: #f9f9f9;
|
||||
--vt-c-white-mute: #f1f1f1;
|
||||
--vt-c-black: #1a1a1a;
|
||||
--vt-c-black-pure: #000000;
|
||||
--vt-c-black-soft: #242424;
|
||||
--vt-c-black-mute: #2f2f2f;
|
||||
--vt-c-indigo: #213547;
|
||||
--vt-c-indigo-soft: #476582;
|
||||
--vt-c-indigo-light: #aac8e4;
|
||||
--vt-c-gray: #8e8e8e;
|
||||
--vt-c-gray-light-1: #aeaeae;
|
||||
--vt-c-gray-light-2: #c7c7c7;
|
||||
--vt-c-gray-light-3: #d1d1d1;
|
||||
--vt-c-gray-light-4: #e5e5e5;
|
||||
--vt-c-gray-light-5: #f2f2f2;
|
||||
--vt-c-gray-dark-1: #636363;
|
||||
--vt-c-gray-dark-2: #484848;
|
||||
--vt-c-gray-dark-3: #3a3a3a;
|
||||
--vt-c-gray-dark-4: #282828;
|
||||
--vt-c-gray-dark-5: #202020;
|
||||
--vt-c-divider-light-1: rgba(60, 60, 60, .29);
|
||||
--vt-c-divider-light-2: rgba(60, 60, 60, .12);
|
||||
--vt-c-divider-light-3: #e7e7e7;
|
||||
--vt-c-divider-dark-1: rgba(84, 84, 84, .65);
|
||||
--vt-c-divider-dark-2: rgba(84, 84, 84, .48);
|
||||
--vt-c-text-light-1: var(--vt-c-indigo);
|
||||
--vt-c-text-light-2: rgba(60, 60, 60, .7);
|
||||
--vt-c-text-light-3: rgba(60, 60, 60, .33);
|
||||
--vt-c-text-light-4: rgba(60, 60, 60, .18);
|
||||
--vt-c-text-light-code: var(--vt-c-indigo-soft);
|
||||
--vt-c-text-dark-1: rgba(255, 255, 255, .87);
|
||||
--vt-c-text-dark-2: rgba(235, 235, 235, .6);
|
||||
--vt-c-text-dark-3: rgba(235, 235, 235, .38);
|
||||
--vt-c-text-dark-4: rgba(235, 235, 235, .18);
|
||||
--vt-c-text-dark-code: var(--vt-c-indigo-light);
|
||||
--vt-c-green: #42b883;
|
||||
--vt-c-green-light: #42d392;
|
||||
--vt-c-green-lighter: #35eb9a;
|
||||
--vt-c-green-dark: #33a06f;
|
||||
--vt-c-green-darker: #155f3e;
|
||||
--vt-c-blue: #3b8eed;
|
||||
--vt-c-blue-light: #549ced;
|
||||
--vt-c-blue-lighter: #50a2ff;
|
||||
--vt-c-blue-dark: #3468a3;
|
||||
--vt-c-blue-darker: #255489;
|
||||
--vt-c-yellow: #ffc517;
|
||||
--vt-c-yellow-light: #ffe417;
|
||||
--vt-c-yellow-lighter: #ffff17;
|
||||
--vt-c-yellow-dark: #e0ad15;
|
||||
--vt-c-yellow-darker: #bc9112;
|
||||
--vt-c-red: #ed3c50;
|
||||
--vt-c-red-light: #f43771;
|
||||
--vt-c-red-lighter: #fd1d7c;
|
||||
--vt-c-red-dark: #cd2d3f;
|
||||
--vt-c-red-darker: #ab2131;
|
||||
--vt-c-purple: #de41e0;
|
||||
--vt-c-purple-light: #e936eb;
|
||||
--vt-c-purple-lighter: #f616f8;
|
||||
--vt-c-purple-dark: #823c83;
|
||||
--vt-c-purple-darker: #602960;
|
||||
}
|
||||
|
||||
:root {
|
||||
--vt-c-bg: var(--vt-c-white);
|
||||
--vt-c-bg-soft: var(--vt-c-white-soft);
|
||||
--vt-c-bg-mute: var(--vt-c-white-mute);
|
||||
--vt-c-divider: var(--vt-c-divider-light-1);
|
||||
--vt-c-divider-light: var(--vt-c-divider-light-2);
|
||||
--vt-c-divider-inverse: var(--vt-c-divider-dark-1);
|
||||
--vt-c-divider-inverse-light: var(--vt-c-divider-dark-2);
|
||||
--vt-c-text-1: var(--vt-c-text-light-1);
|
||||
--vt-c-text-2: var(--vt-c-text-light-2);
|
||||
--vt-c-text-3: var(--vt-c-text-light-3);
|
||||
--vt-c-text-4: var(--vt-c-text-light-4);
|
||||
--vt-c-text-code: var(--vt-c-text-light-code);
|
||||
--vt-c-text-inverse-1: var(--vt-c-text-dark-1);
|
||||
--vt-c-text-inverse-2: var(--vt-c-text-dark-2);
|
||||
--vt-c-text-inverse-3: var(--vt-c-text-dark-3);
|
||||
--vt-c-text-inverse-4: var(--vt-c-text-dark-4);
|
||||
--vt-c-brand: var(--vt-c-green);
|
||||
--vt-c-brand-light: var(--vt-c-green-light);
|
||||
--vt-c-brand-dark: var(--vt-c-green-dark);
|
||||
--vt-c-brand-highlight: var(--vt-c-brand-dark);
|
||||
--docsearch-searchbox-focus-background: transparent;
|
||||
--docsearch-searchbox-shadow: none;
|
||||
--docsearch-highlight-color: var(--vt-c-green);
|
||||
--docsearch-text-color: var(--vt-c-indigo);
|
||||
--docsearch-muted-color: var(--vt-c-text-light-2);
|
||||
}
|
||||
|
||||
.dark {
|
||||
--vt-c-bg: var(--vt-c-black);
|
||||
--vt-c-bg-soft: var(--vt-c-black-soft);
|
||||
--vt-c-bg-mute: var(--vt-c-black-mute);
|
||||
--vt-c-divider: var(--vt-c-divider-dark-1);
|
||||
--vt-c-divider-light: var(--vt-c-divider-dark-2);
|
||||
--vt-c-divider-inverse: var(--vt-c-divider-light-1);
|
||||
--vt-c-divider-inverse-light: var(--vt-c-divider-light-2);
|
||||
--vt-c-text-1: var(--vt-c-text-dark-1);
|
||||
--vt-c-text-2: var(--vt-c-text-dark-2);
|
||||
--vt-c-text-3: var(--vt-c-text-dark-3);
|
||||
--vt-c-text-4: var(--vt-c-text-dark-4);
|
||||
--vt-c-text-code: var(--vt-c-text-dark-code);
|
||||
--vt-c-text-inverse-1: var(--vt-c-text-light-1);
|
||||
--vt-c-text-inverse-2: var(--vt-c-text-light-2);
|
||||
--vt-c-text-inverse-3: var(--vt-c-text-light-3);
|
||||
--vt-c-text-inverse-4: var(--vt-c-text-light-4);
|
||||
--vt-c-brand-highlight: var(--vt-c-brand-light);
|
||||
--docsearch-text-color: var(--vt-c-indigo);
|
||||
}
|
||||
|
||||
:root {
|
||||
--vt-font-family-base: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
|
||||
--vt-font-family-mono: Menlo, Monaco, Consolas, "Courier New", monospace
|
||||
}
|
||||
|
||||
:root {
|
||||
--vt-shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .06);
|
||||
--vt-shadow-2: 0 3px 12px rgba(0, 0, 0, .07), 0 1px 4px rgba(0, 0, 0, .07);
|
||||
--vt-shadow-3: 0 12px 32px rgba(0, 0, 0, .1), 0 2px 6px rgba(0, 0, 0, .08);
|
||||
--vt-shadow-4: 0 14px 44px rgba(0, 0, 0, .12), 0 3px 9px rgba(0, 0, 0, .12);
|
||||
--vt-shadow-5: 0 18px 56px rgba(0, 0, 0, .16), 0 4px 12px rgba(0, 0, 0, .16)
|
||||
}
|
||||
|
||||
:root {
|
||||
--vt-nav-height: 55px;
|
||||
--vp-screen-max-width: 1376px;
|
||||
--vp-sidebar-width-small: 272px;
|
||||
--vp-z-index-sidebar: 50px;
|
||||
--vp-sidebar-width-mobile: 320px;
|
||||
--vp-z-index-nav: 20;
|
||||
--vp-z-index-local-nav: 10;
|
||||
--vp-z-index-sidebar: 99;
|
||||
--vp-z-index-backdrop: 40;
|
||||
--vp-z-index-loading: 99;
|
||||
--docsearch-searchbox-height: 56px;
|
||||
--docsearch-spacing: 12px;
|
||||
}
|
||||
|
||||
*, :before, :after {
|
||||
box-sizing: border-box
|
||||
}
|
||||
|
||||
html {
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
:root {
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
:root body {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
body {
|
||||
width: 100vw;
|
||||
min-width: 320px;
|
||||
min-height: 100vh;
|
||||
font-family: var(--vt-font-family-base);
|
||||
letter-spacing: .2px;
|
||||
line-height: 24px;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
color: var(--vt-c-text-1);
|
||||
background-color: var(--vt-c-bg);
|
||||
direction: ltr;
|
||||
font-synthesis: none;
|
||||
text-rendering: optimizeLegibility;
|
||||
transition: color .5s, background-color .5s;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
/* overflow-x: hidden; */
|
||||
}
|
||||
|
||||
blockquote, dl, dd, h1, h2, h3, h4, h5, h6, hr, figure, p, pre {
|
||||
margin: 0
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-size: inherit;
|
||||
font-weight: inherit
|
||||
}
|
||||
|
||||
a, area, button, [role=button], input, label, select, summary, textarea {
|
||||
touch-action: manipulation
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: inherit
|
||||
}
|
||||
|
||||
ol, ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0
|
||||
}
|
||||
|
||||
pre, code, kbd, samp {
|
||||
font-family: var(--vt-font-family-mono)
|
||||
}
|
||||
|
||||
img, svg, video, canvas, audio, iframe, embed, object {
|
||||
display: block;
|
||||
vertical-align: middle
|
||||
}
|
||||
|
||||
img, video {
|
||||
max-width: 100%;
|
||||
height: auto
|
||||
}
|
||||
|
||||
button, input, optgroup, select, textarea {
|
||||
border: 0;
|
||||
padding: 0;
|
||||
line-height: inherit;
|
||||
color: inherit
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 0;
|
||||
background-color: transparent;
|
||||
background-image: none
|
||||
}
|
||||
|
||||
button, [role=button] {
|
||||
cursor: pointer
|
||||
}
|
||||
|
||||
button:focus, button:focus-visible {
|
||||
outline: 1px dotted;
|
||||
outline: 5px auto -webkit-focus-ring-color
|
||||
}
|
||||
|
||||
button:focus:not(:focus-visible) {
|
||||
outline: none !important
|
||||
}
|
||||
|
||||
input:focus, textarea:focus, select:focus {
|
||||
outline: none
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse
|
||||
}
|
||||
|
||||
input {
|
||||
background-color: transparent
|
||||
}
|
||||
|
||||
input:-ms-input-placeholder, textarea:-ms-input-placeholder {
|
||||
color: var(--vt-c-text-3)
|
||||
}
|
||||
|
||||
input::-ms-input-placeholder, textarea::-ms-input-placeholder {
|
||||
color: var(--vt-c-text-3)
|
||||
}
|
||||
|
||||
input::placeholder, textarea::placeholder {
|
||||
color: var(--vt-c-text-3)
|
||||
}
|
||||
|
||||
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none;
|
||||
margin: 0
|
||||
}
|
||||
|
||||
input[type=number] {
|
||||
-moz-appearance: textfield
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: vertical
|
||||
}
|
||||
|
||||
select {
|
||||
-webkit-appearance: none
|
||||
}
|
||||
|
||||
fieldset {
|
||||
margin: 0;
|
||||
padding: 0
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user