diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 34d01d9d7adb133d6e54befa8ff5b9034736e185..62d5b2c0d6f27d0cd5ade908749adfc93c6e0998 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -30,8 +30,8 @@
- {{ i18n "current_lang" }} - + +
{{ .Site.Params.languageZh }} {{ .Site.Params.languageEn }} diff --git a/static/css/common.css b/static/css/common.css index 55d5bc9f2645d9fff5798668eab832739466a730..e880ad7cba2a3740a7b139d9c6c834a339befc30 100644 --- a/static/css/common.css +++ b/static/css/common.css @@ -281,6 +281,32 @@ i { background-image: url("../img/common/icon-down-dark.svg"); } +.icon-locale { + display: block; + width: 26px; + height: 26px; + background-image: url("../img/common/icon-locale-light.svg"); +} +.light .icon-locale { + background-image: url("../img/common/icon-locale-light.svg"); +} +.dark .icon-locale { + background-image: url("../img/common/icon-locale-dark.svg"); +} + +.locale-tag { + position: absolute; + font-size: 10px; + height: 12px; + width: 12px; + display: flex; + justify-content: center; + align-items: center; + left: 12px; + top: 28px; + background: var(--e-color-bg1); +} + .web-lang { margin-left: 20px; } diff --git a/static/css/revision_new.css b/static/css/revision_new.css index a6e8b93c595abecfca8837f7afa691063fd1b4ac..be8fbfedec45704e135f24e87654b58556853230 100644 --- a/static/css/revision_new.css +++ b/static/css/revision_new.css @@ -219,7 +219,7 @@ width: 84px; position: absolute; top: 46px; - left: -40px; + left: -50px; background: var(--e-color-bg2); padding: 0 var(--o-spacing-h5); cursor: pointer; diff --git a/static/img/common/icon-locale-dark.svg b/static/img/common/icon-locale-dark.svg new file mode 100644 index 0000000000000000000000000000000000000000..edebc679d3743f1f83a013fed6f3a4f8ee485f74 --- /dev/null +++ b/static/img/common/icon-locale-dark.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/static/img/common/icon-locale-light.svg b/static/img/common/icon-locale-light.svg new file mode 100644 index 0000000000000000000000000000000000000000..77ff3099316a0e2d0d35e85c993ff1fc34211832 --- /dev/null +++ b/static/img/common/icon-locale-light.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/static/js/common.js b/static/js/common.js index d2161208033a7c905ef67b61a711361544a2b2d7..f79a36858140bb20adb28a6481462cb62e7e908b 100644 --- a/static/js/common.js +++ b/static/js/common.js @@ -238,5 +238,7 @@ $(function ($) { $(".nav-box .docs-a .home-bread,.h5-docs-a .home-bread").click(() => { window.open(`/${lang}/`, "_self"); }); + // 设置语言图标 + $(".locale-tag").text(window.location.href.indexOf('/zh/') > -1 ? "中" : "EN"); }); });