You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/04/14 06:59:15 UTC
[shardingsphere] branch master updated: feat: document && community Add skins (#16813)
This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 99260a5d3db feat: document && community Add skins (#16813)
99260a5d3db is described below
commit 99260a5d3db2001ea61fdfdc4ad8c1040cde77a2
Author: davidChan3000 <ch...@163.com>
AuthorDate: Thu Apr 14 14:58:58 2022 +0800
feat: document && community Add skins (#16813)
* feat:add skins
* feat:community add skins
* feat:modify eyehelp -> eye care
* feat:add a blank line in the end of css file
---
docs/community/.hugo_build.lock | 0
docs/community/static/css/theme-white.css | 253 +++++++++++++++++++-
docs/community/static/image/theme.svg | 2 +
.../layouts/partials/change-theme.html | 57 +++++
.../hugo-theme-learn/layouts/partials/header.html | 1 +
.../themes/hugo-theme-learn/static/js/learn.js | 35 ++-
docs/document/static/css/theme-white.css | 263 ++++++++++++++++++++-
docs/document/static/img/theme.svg | 2 +
.../layouts/partials/change-theme.html | 57 +++++
.../hugo-theme-learn/layouts/partials/header.html | 1 +
.../themes/hugo-theme-learn/static/js/learn.js | 35 ++-
11 files changed, 700 insertions(+), 6 deletions(-)
diff --git a/docs/community/.hugo_build.lock b/docs/community/.hugo_build.lock
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/docs/community/static/css/theme-white.css b/docs/community/static/css/theme-white.css
index cb2e819adb3..fdab19f7ef3 100644
--- a/docs/community/static/css/theme-white.css
+++ b/docs/community/static/css/theme-white.css
@@ -185,7 +185,7 @@ header .select-style select{
width: 230px;
transform: translateX(calc(85% + 280px));
transition: top .1s ease;
- top:160px;
+ top:192px;
padding-left: 20px!important;
}
@@ -357,6 +357,55 @@ table td,table td code{
animation: mymove3 5s ease 1s infinite;
}
+.change-theme{
+ height: 32px;
+ background:#111;
+ color: #fff;
+ line-height: 32px;
+}
+.change-theme .wrap{
+ justify-content: right;
+}
+.change-theme span{
+ margin:0 16px;
+ cursor: pointer;
+ font-size: 14px;
+}
+.change-theme span svg{
+ display: none;
+ vertical-align: middle;
+}
+.change-theme span.active{
+ position:relative;
+}
+.change-theme span.active svg{
+ display: inline-block;
+}
+.change-theme span.active.retro{
+ color:#F2EFDD;
+}
+.change-theme span.active.retro svg path{
+ fill: #F2EFDD;
+}
+.change-theme span.active.eyehelp{
+ color:#C7EBC9;
+}
+.change-theme span.active.eyehelp svg path{
+ fill: #C7EBC9;
+}
+.change-theme span.active.haitian{
+ color:#E5EDFF;
+}
+.change-theme span.active.haitian svg path{
+ fill: #E5EDFF;
+}
+.change-theme span.active.deep,.change-theme span.active.dark{
+ color:#65A4FF;
+}
+.change-theme span.active.deep svg path,.change-theme span.active.dark svg path{
+ fill: #65A4FF;
+}
+
@media only all and (min-width: 48em) and (max-width: 89.99em) {
#TableOfContents{
right: 1rem;
@@ -383,6 +432,12 @@ table td,table td code{
header .wrap{
padding: 0 20px;
}
+ header .wrap ul{
+ padding-left:30px;
+ }
+ .change-theme span{
+ margin:0 7px;
+ }
body #chapter h1 {
font-size: 2rem;
}
@@ -443,4 +498,198 @@ table td,table td code{
100%{
transform: translate(525px, 0);
}
-}
\ No newline at end of file
+}
+
+/*change theme*/
+/*retro*/
+.retro-theme{
+ background-color: #F2EFDD;
+}
+.retro-theme header{
+ background-color: #F8F5EA;
+}
+.retro-theme #header-wrapper, .retro-theme .searchbox{
+ background-color: #F8F5EA;
+ border-radius: 8px;
+ border-color: #F8F5EA;
+}
+.retro-theme #sidebar ul.topics > li.parent,.retro-theme #sidebar ul.topics > li.active{
+ background-color: #F2EFDD;
+}
+.retro-theme #sidebar ul li.active > a{
+ background-color: #F2EFDD;
+}
+.retro-theme #top-bar{
+ background-color: #F8F5EA;
+}
+.retro-theme #TableOfContents>ul>li>ul>li>a::before{
+ background-color: #F8F5EA;
+}
+.retro-theme th{
+ background-color: #F8F5EA;
+}
+.eyehelp-theme table,.retro-theme td,.retro-theme blockquote{
+ border-color: #dfdcdc;
+}
+/*eyehelp*/
+.eyehelp-theme{
+ background-color: #C7EBC9;
+}
+.eyehelp-theme header{
+ background-color: #D6F6D7;
+}
+.eyehelp-theme #header-wrapper, .eyehelp-theme .searchbox{
+ background-color: #D6F6D7;
+ border-radius: 8px;
+ border-color: #D6F6D7;
+}
+.eyehelp-theme #sidebar ul.topics > li.parent,.eyehelp-theme #sidebar ul.topics > li.active{
+ background-color: #C7EBC9;
+}
+.eyehelp-theme #sidebar ul li.active > a{
+ background-color: #C7EBC9;
+}
+.eyehelp-theme #top-bar{
+ background-color: #D6F6D7;
+}
+.eyehelp-theme #TableOfContents>ul>li>ul>li>a::before{
+ background-color: #D6F6D7;
+}
+.eyehelp-theme th{
+ background-color: #D6F6D7;
+}
+.eyehelp-theme table,.eyehelp-theme td,.eyehelp-theme blockquote{
+ border-color: #c1c1c1;
+}
+/*haitian*/
+.haitian-theme{
+ background-color: #E5EDFF;
+}
+.haitian-theme header{
+ background-color: #EDF2FF;
+}
+.haitian-theme #header-wrapper, .haitian-theme .searchbox{
+ background-color: #EDF2FF;
+ border-radius: 8px;
+ border-color: #EDF2FF;
+}
+.haitian-theme #sidebar ul.topics > li.parent,.haitian-theme #sidebar ul.topics > li.active{
+ background-color: #E5EDFF;
+}
+.haitian-theme #sidebar ul li.active > a{
+ background-color: #E5EDFF;
+}
+.haitian-theme #top-bar{
+ background-color: #EDF2FF;
+}
+.haitian-theme #TableOfContents>ul>li>ul>li>a::before{
+ background-color: #EDF2FF;
+}
+.haitian-theme th{
+ background-color: #EDF2FF;
+}
+.haitian-theme table,.haitian-theme td,.haitian-theme blockquote{
+ border-color: #c1c1c1;
+}
+/*Deep*/
+.deep-theme{
+ background-color: #15202F;
+ color: #b8c5d9 !important;
+}
+.deep-theme header{
+ background-color: #1B283B;
+}
+.deep-theme header img{
+ height: 50px;
+}
+.deep-theme #header-wrapper, .deep-theme .searchbox{
+ background-color: #1B283B;
+ border-radius: 8px;
+ border-color: #1B283B;
+}
+.deep-theme #sidebar ul.topics > li.parent,.deep-theme #sidebar ul.topics > li.active{
+ background-color: #15202F;
+}
+.deep-theme #sidebar ul li.active > a{
+ background-color: #15202F;
+}
+.deep-theme #top-bar{
+ background-color: #1B283B;
+}
+.deep-theme #TableOfContents>ul>li>ul>li>a::before{
+ background-color: #1B283B;
+}
+.deep-theme th{
+ background-color: #1B283B;
+}
+.deep-theme table,.deep-theme td,.deep-theme blockquote{
+ border-color: #c1c1c1;
+}
+.deep-theme #body img{
+ background-color: #EDF2FF;
+ border-radius: 20px;
+}
+.deep-theme h1,
+.deep-theme h2,
+.deep-theme h3,
+.deep-theme h4,
+.deep-theme h5,
+.deep-theme h6,
+.deep-theme #sidebar a,
+.deep-theme a,
+.deep-theme .searchbox input,
+.deep-theme .select-style select{
+ color: #b8c5d9
+}
+/*Dark*/
+.dark-theme{
+ background-color: #171717;
+ color: #B1B1B1 !important;
+}
+.dark-theme header{
+ background-color: #202020;
+}
+.dark-theme header img{
+ height: 50px;
+}
+.dark-theme #header-wrapper, .dark-theme .searchbox{
+ background-color: #202020;
+ border-radius: 8px;
+ border-color: #202020;
+}
+.dark-theme #sidebar ul.topics > li.parent,.dark-theme #sidebar ul.topics > li.active{
+ background-color: #171717;
+}
+.dark-theme #sidebar ul li.active > a{
+ background-color: #171717;
+}
+.dark-theme #top-bar{
+ background-color: #202020;
+}
+.dark-theme #TableOfContents>ul>li>ul>li>a::before{
+ background-color: #202020;
+}
+.dark-theme th{
+ background-color: #202020;
+}
+.dark-theme table,.dark-theme td,.dark-theme blockquote{
+ border-color: #c1c1c1;
+}
+.dark-theme #body img{
+ background-color: #EDF2FF;
+ border-radius: 20px;
+}
+.dark-theme h1,
+.dark-theme h2,
+.dark-theme h3,
+.dark-theme h4,
+.dark-theme h5,
+.dark-theme h6,
+.dark-theme #sidebar a,
+.dark-theme a,
+.dark-theme .searchbox input,
+.dark-theme .select-style select{
+ color: #B1B1B1
+}
+
+
diff --git a/docs/community/static/image/theme.svg b/docs/community/static/image/theme.svg
new file mode 100644
index 00000000000..6c454247663
--- /dev/null
+++ b/docs/community/static/image/theme.svg
@@ -0,0 +1,2 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1649761066916" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1910" xmlns:xlink="http://www.w3.org/1999/xlink" width="19.421875" height="16"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2 [...]
+</style></defs><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#F6651C" p-id="1911"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.649567-476.574007 69.335813 84.987568z" fill="#F6651C" p-id="1912"></path></svg>
\ No newline at end of file
diff --git a/docs/community/themes/hugo-theme-learn/layouts/partials/change-theme.html b/docs/community/themes/hugo-theme-learn/layouts/partials/change-theme.html
new file mode 100644
index 00000000000..3c22b25ee48
--- /dev/null
+++ b/docs/community/themes/hugo-theme-learn/layouts/partials/change-theme.html
@@ -0,0 +1,57 @@
+<div class="change-theme">
+ <div class="wrap">
+ {{ if eq .Lang "en"}}
+ <span data-item="retro">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ Retro
+ </span>
+ <span data-item="eyehelp">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ Eye care
+ </span>
+ <span data-item="haitian">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ Haitian
+ </span>
+ <span data-item="deep">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ Deep
+ </span>
+ <span data-item="dark">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ Dark
+ </span>
+ <span class="active">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ Default
+ </span>
+ {{ else }}
+ <span data-item="retro">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ 复古
+ </span>
+ <span data-item="eyehelp">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ 护眼
+ </span>
+ <span data-item="haitian">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ 海天
+ </span>
+ <span data-item="deep">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ 深邃
+ </span>
+ <span data-item="dark">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ 暗黑
+ </span>
+ <span class="active">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ 默认
+ </span>
+ {{ end }}
+ </div>
+</div>
+
+
diff --git a/docs/community/themes/hugo-theme-learn/layouts/partials/header.html b/docs/community/themes/hugo-theme-learn/layouts/partials/header.html
index 8de63c79c3e..806f715c0f1 100644
--- a/docs/community/themes/hugo-theme-learn/layouts/partials/header.html
+++ b/docs/community/themes/hugo-theme-learn/layouts/partials/header.html
@@ -87,6 +87,7 @@
{{ partial "custom-header.html" . }}
</head>
<body class="" data-url="{{ .RelPermalink }}">
+ {{ partial "change-theme.html" . }}
<header>
<div class="wrap">
{{ partial "logo.html" . }}
diff --git a/docs/community/themes/hugo-theme-learn/static/js/learn.js b/docs/community/themes/hugo-theme-learn/static/js/learn.js
index 9d371ced4f6..733b2a4addf 100644
--- a/docs/community/themes/hugo-theme-learn/static/js/learn.js
+++ b/docs/community/themes/hugo-theme-learn/static/js/learn.js
@@ -376,7 +376,40 @@ $(function() {
root: 'section#body'
});
-
+ var logo = $('header img')
+ var logosrc = logo.attr('src')
+ var loadTheme = localStorage.getItem('ss-theme')
+ if(loadTheme){
+ $('body').attr("class", loadTheme+'-theme');
+ $('.change-theme span').removeClass('active')
+ $('.change-theme span[data-item='+loadTheme+']').addClass('active')
+ $('.change-theme span[data-item='+loadTheme+']').addClass(loadTheme)
+ }
+ if(/dark|deep/.test(loadTheme)){
+ logo.attr('src', logosrc.replace('logo_v3','logo_v2'))
+ }else{
+ logo.attr('src', logosrc.replace('logo_v2','logo_v3'))
+ }
+
+ $('.change-theme span').click(function(){
+ var _this = $(this),
+ theme = _this.data('item')
+ if(theme){
+ $('body').attr("class", theme+'-theme');
+ localStorage.setItem('ss-theme', theme)
+ }else{
+ $('body').attr("class", '');
+ localStorage.setItem('ss-theme', '')
+ }
+ if(/dark|deep/.test(theme)){
+ logo.attr('src', logosrc.replace('logo_v3','logo_v2'))
+ }else{
+ logo.attr('src', logosrc.replace('logo_v2','logo_v3'))
+ }
+ _this.addClass('active')
+ _this.addClass(theme)
+ _this.siblings().attr('class','')
+ })
});
window.onload = function(){
diff --git a/docs/document/static/css/theme-white.css b/docs/document/static/css/theme-white.css
index 9ae2064816b..71116ab7686 100644
--- a/docs/document/static/css/theme-white.css
+++ b/docs/document/static/css/theme-white.css
@@ -185,7 +185,7 @@ header .select-style select{
width: 230px;
transform: translateX(calc(85% + 280px));
transition: top .1s ease;
- top:160px;
+ top:192px;
padding-left: 20px!important;
}
@@ -359,6 +359,64 @@ table td,p,code{
animation: mymove3 5s ease 1s infinite;
}
+.change-theme{
+ height: 32px;
+ background:#111;
+ color: #fff;
+ line-height: 32px;
+}
+.change-theme .wrap{
+ justify-content: right;
+}
+.change-theme span{
+ margin:0 16px;
+ cursor: pointer;
+ font-size: 14px;
+}
+.change-theme span svg{
+ display: none;
+ vertical-align: middle;
+}
+.change-theme span.active{
+ position:relative;
+}
+.change-theme span.active svg{
+ display: inline-block;
+}
+.change-theme span.active.retro{
+ color:#F2EFDD;
+}
+.change-theme span.active.retro svg path{
+ fill: #F2EFDD;
+}
+.change-theme span.active.eyehelp{
+ color:#C7EBC9;
+}
+.change-theme span.active.eyehelp svg path{
+ fill: #C7EBC9;
+}
+.change-theme span.active.haitian{
+ color:#E5EDFF;
+}
+.change-theme span.active.haitian svg path{
+ fill: #E5EDFF;
+}
+.change-theme span.active.deep,.change-theme span.active.dark{
+ color:#65A4FF;
+}
+.change-theme span.active.deep svg path,.change-theme span.active.dark svg path{
+ fill: #65A4FF;
+}
+/* .change-theme span.active::before{
+ content: ' ';
+ width: 16px;
+ height: 16px;
+ position: absolute;
+ left:0;
+ top:7px;
+ background-image: url('../img/theme.svg');
+} */
+
@media only all and (min-width: 48em) and (max-width: 89.99em) {
#TableOfContents{
right: 1rem;
@@ -385,6 +443,12 @@ table td,p,code{
header .wrap{
padding: 0 20px;
}
+ header .wrap ul{
+ padding-left:30px;
+ }
+ .change-theme span{
+ margin:0 7px;
+ }
body #chapter h1 {
font-size: 2rem;
}
@@ -409,6 +473,7 @@ table td,p,code{
transform: translateX(0);
}
.icon-3,.icon-2,.icon-1{display: none;}
+
}
@keyframes mymove {
@@ -445,4 +510,198 @@ table td,p,code{
100%{
transform: translate(525px, 0);
}
-}
\ No newline at end of file
+}
+
+/*change theme*/
+/*retro*/
+.retro-theme{
+ background-color: #F2EFDD;
+}
+.retro-theme header{
+ background-color: #F8F5EA;
+}
+.retro-theme #header-wrapper, .retro-theme .searchbox{
+ background-color: #F8F5EA;
+ border-radius: 8px;
+ border-color: #F8F5EA;
+}
+.retro-theme #sidebar ul.topics > li.parent,.retro-theme #sidebar ul.topics > li.active{
+ background-color: #F2EFDD;
+}
+.retro-theme #sidebar ul li.active > a{
+ background-color: #F2EFDD;
+}
+.retro-theme #top-bar{
+ background-color: #F8F5EA;
+}
+.retro-theme #TableOfContents>ul>li>ul>li>a::before{
+ background-color: #F8F5EA;
+}
+.retro-theme th{
+ background-color: #F8F5EA;
+}
+.eyehelp-theme table,.retro-theme td,.retro-theme blockquote{
+ border-color: #dfdcdc;
+}
+/*eyehelp*/
+.eyehelp-theme{
+ background-color: #C7EBC9;
+}
+.eyehelp-theme header{
+ background-color: #D6F6D7;
+}
+.eyehelp-theme #header-wrapper, .eyehelp-theme .searchbox{
+ background-color: #D6F6D7;
+ border-radius: 8px;
+ border-color: #D6F6D7;
+}
+.eyehelp-theme #sidebar ul.topics > li.parent,.eyehelp-theme #sidebar ul.topics > li.active{
+ background-color: #C7EBC9;
+}
+.eyehelp-theme #sidebar ul li.active > a{
+ background-color: #C7EBC9;
+}
+.eyehelp-theme #top-bar{
+ background-color: #D6F6D7;
+}
+.eyehelp-theme #TableOfContents>ul>li>ul>li>a::before{
+ background-color: #D6F6D7;
+}
+.eyehelp-theme th{
+ background-color: #D6F6D7;
+}
+.eyehelp-theme table,.eyehelp-theme td,.eyehelp-theme blockquote{
+ border-color: #c1c1c1;
+}
+/*haitian*/
+.haitian-theme{
+ background-color: #E5EDFF;
+}
+.haitian-theme header{
+ background-color: #EDF2FF;
+}
+.haitian-theme #header-wrapper, .haitian-theme .searchbox{
+ background-color: #EDF2FF;
+ border-radius: 8px;
+ border-color: #EDF2FF;
+}
+.haitian-theme #sidebar ul.topics > li.parent,.haitian-theme #sidebar ul.topics > li.active{
+ background-color: #E5EDFF;
+}
+.haitian-theme #sidebar ul li.active > a{
+ background-color: #E5EDFF;
+}
+.haitian-theme #top-bar{
+ background-color: #EDF2FF;
+}
+.haitian-theme #TableOfContents>ul>li>ul>li>a::before{
+ background-color: #EDF2FF;
+}
+.haitian-theme th{
+ background-color: #EDF2FF;
+}
+.haitian-theme table,.haitian-theme td,.haitian-theme blockquote{
+ border-color: #c1c1c1;
+}
+/*Deep*/
+.deep-theme{
+ background-color: #15202F;
+ color: #b8c5d9 !important;
+}
+.deep-theme header{
+ background-color: #1B283B;
+}
+.deep-theme header img{
+ height: 50px;
+}
+.deep-theme #header-wrapper, .deep-theme .searchbox{
+ background-color: #1B283B;
+ border-radius: 8px;
+ border-color: #1B283B;
+}
+.deep-theme #sidebar ul.topics > li.parent,.deep-theme #sidebar ul.topics > li.active{
+ background-color: #15202F;
+}
+.deep-theme #sidebar ul li.active > a{
+ background-color: #15202F;
+}
+.deep-theme #top-bar{
+ background-color: #1B283B;
+}
+.deep-theme #TableOfContents>ul>li>ul>li>a::before{
+ background-color: #1B283B;
+}
+.deep-theme th{
+ background-color: #1B283B;
+}
+.deep-theme table,.deep-theme td,.deep-theme blockquote{
+ border-color: #c1c1c1;
+}
+.deep-theme #body img{
+ background-color: #EDF2FF;
+ border-radius: 20px;
+}
+.deep-theme h1,
+.deep-theme h2,
+.deep-theme h3,
+.deep-theme h4,
+.deep-theme h5,
+.deep-theme h6,
+.deep-theme #sidebar a,
+.deep-theme a,
+.deep-theme .searchbox input,
+.deep-theme .select-style select{
+ color: #b8c5d9
+}
+/*Dark*/
+.dark-theme{
+ background-color: #171717;
+ color: #B1B1B1 !important;
+}
+.dark-theme header{
+ background-color: #202020;
+}
+.dark-theme header img{
+ height: 50px;
+}
+.dark-theme #header-wrapper, .dark-theme .searchbox{
+ background-color: #202020;
+ border-radius: 8px;
+ border-color: #202020;
+}
+.dark-theme #sidebar ul.topics > li.parent,.dark-theme #sidebar ul.topics > li.active{
+ background-color: #171717;
+}
+.dark-theme #sidebar ul li.active > a{
+ background-color: #171717;
+}
+.dark-theme #top-bar{
+ background-color: #202020;
+}
+.dark-theme #TableOfContents>ul>li>ul>li>a::before{
+ background-color: #202020;
+}
+.dark-theme th{
+ background-color: #202020;
+}
+.dark-theme table,.dark-theme td,.dark-theme blockquote{
+ border-color: #c1c1c1;
+}
+.dark-theme #body img{
+ background-color: #EDF2FF;
+ border-radius: 20px;
+}
+.dark-theme h1,
+.dark-theme h2,
+.dark-theme h3,
+.dark-theme h4,
+.dark-theme h5,
+.dark-theme h6,
+.dark-theme #sidebar a,
+.dark-theme a,
+.dark-theme .searchbox input,
+.dark-theme .select-style select{
+ color: #B1B1B1
+}
+
+
diff --git a/docs/document/static/img/theme.svg b/docs/document/static/img/theme.svg
new file mode 100644
index 00000000000..6c454247663
--- /dev/null
+++ b/docs/document/static/img/theme.svg
@@ -0,0 +1,2 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1649761066916" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1910" xmlns:xlink="http://www.w3.org/1999/xlink" width="19.421875" height="16"><defs><style type="text/css">@font-face { font-family: feedback-iconfont; src: url("//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944") format("woff2 [...]
+</style></defs><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#F6651C" p-id="1911"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.649567-476.574007 69.335813 84.987568z" fill="#F6651C" p-id="1912"></path></svg>
\ No newline at end of file
diff --git a/docs/document/themes/hugo-theme-learn/layouts/partials/change-theme.html b/docs/document/themes/hugo-theme-learn/layouts/partials/change-theme.html
new file mode 100644
index 00000000000..3c22b25ee48
--- /dev/null
+++ b/docs/document/themes/hugo-theme-learn/layouts/partials/change-theme.html
@@ -0,0 +1,57 @@
+<div class="change-theme">
+ <div class="wrap">
+ {{ if eq .Lang "en"}}
+ <span data-item="retro">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ Retro
+ </span>
+ <span data-item="eyehelp">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ Eye care
+ </span>
+ <span data-item="haitian">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ Haitian
+ </span>
+ <span data-item="deep">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ Deep
+ </span>
+ <span data-item="dark">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ Dark
+ </span>
+ <span class="active">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ Default
+ </span>
+ {{ else }}
+ <span data-item="retro">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ 复古
+ </span>
+ <span data-item="eyehelp">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ 护眼
+ </span>
+ <span data-item="haitian">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ 海天
+ </span>
+ <span data-item="deep">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ 深邃
+ </span>
+ <span data-item="dark">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ 暗黑
+ </span>
+ <span class="active">
+ <svg t="1649761460834" class="icon" viewBox="0 0 1243 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2052" width="16" height="16"><path d="M755.093336 61.436797a511.973304 511.973304 0 1 0 207.495466 693.650688l-99.615377-53.757197a398.827204 398.827204 0 1 1-161.637286-540.351253l53.757197-99.615378z" fill="#ffffff" p-id="2053"></path><path d="M1204.971593 188.84501L534.652259 736.217612l-285.242269-364.086159 86.304071-67.653615 216.199012 275.953611 583.64956 [...]
+ 默认
+ </span>
+ {{ end }}
+ </div>
+</div>
+
+
diff --git a/docs/document/themes/hugo-theme-learn/layouts/partials/header.html b/docs/document/themes/hugo-theme-learn/layouts/partials/header.html
index 83327b47eb8..f5ee119ff34 100644
--- a/docs/document/themes/hugo-theme-learn/layouts/partials/header.html
+++ b/docs/document/themes/hugo-theme-learn/layouts/partials/header.html
@@ -87,6 +87,7 @@
{{ partial "custom-header.html" . }}
</head>
<body class="" data-url="{{ .RelPermalink }}">
+ {{ partial "change-theme.html" . }}
<header>
<div class="wrap">
{{ partial "logo.html" . }}
diff --git a/docs/document/themes/hugo-theme-learn/static/js/learn.js b/docs/document/themes/hugo-theme-learn/static/js/learn.js
index 9d371ced4f6..733b2a4addf 100644
--- a/docs/document/themes/hugo-theme-learn/static/js/learn.js
+++ b/docs/document/themes/hugo-theme-learn/static/js/learn.js
@@ -376,7 +376,40 @@ $(function() {
root: 'section#body'
});
-
+ var logo = $('header img')
+ var logosrc = logo.attr('src')
+ var loadTheme = localStorage.getItem('ss-theme')
+ if(loadTheme){
+ $('body').attr("class", loadTheme+'-theme');
+ $('.change-theme span').removeClass('active')
+ $('.change-theme span[data-item='+loadTheme+']').addClass('active')
+ $('.change-theme span[data-item='+loadTheme+']').addClass(loadTheme)
+ }
+ if(/dark|deep/.test(loadTheme)){
+ logo.attr('src', logosrc.replace('logo_v3','logo_v2'))
+ }else{
+ logo.attr('src', logosrc.replace('logo_v2','logo_v3'))
+ }
+
+ $('.change-theme span').click(function(){
+ var _this = $(this),
+ theme = _this.data('item')
+ if(theme){
+ $('body').attr("class", theme+'-theme');
+ localStorage.setItem('ss-theme', theme)
+ }else{
+ $('body').attr("class", '');
+ localStorage.setItem('ss-theme', '')
+ }
+ if(/dark|deep/.test(theme)){
+ logo.attr('src', logosrc.replace('logo_v3','logo_v2'))
+ }else{
+ logo.attr('src', logosrc.replace('logo_v2','logo_v3'))
+ }
+ _this.addClass('active')
+ _this.addClass(theme)
+ _this.siblings().attr('class','')
+ })
});
window.onload = function(){