i18n
xaoxuu 6 years ago
parent 2fa0554edd
commit 34e0db3d75
  1. 2
      layout/_partial/header.ejs
  2. 3
      layout/_partial/loading.ejs
  3. 4
      layout/_widget/categories.ejs
  4. 4
      layout/_widget/links.ejs
  5. 4
      layout/_widget/music.ejs
  6. 4
      layout/_widget/tagcloud.ejs
  7. 4
      layout/_widget/toc.ejs
  8. 43
      source/less/_base.less
  9. 14
      source/less/_defines.less
  10. 171
      source/less/_header.less
  11. 4
      source/less/_toc.less
  12. 38
      source/less/_widget.less

@ -1,4 +1,4 @@
<header class="l_header">
<header class="l_header <%= config.style %>">
<div class='wrapper'>
<div class="nav-main container container--flex">
<a class="logo flat-box" href='<%= url_for("/") %>' ><%- config.title %></a>

@ -1,4 +1,3 @@
<div id="loading-bar-wrapper">
<div id="loading-bar"></div>
<div id="loading-bar" class="<%= config.style %>"></div>
</div>

@ -1,8 +1,8 @@
<section class='m_widget categories'>
<header class='header'>
<header class='header <%= config.style %>'>
<div><i class="fas fa-folder-open fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;分类</div>
</header>
<div class='content'>
<div class='content <%= config.style %>'>
<% if (site.categories.length){ %>
<ul class="entry">
<% site.categories.sort('name').each(function(item){ %>

@ -1,11 +1,11 @@
<section class='m_widget links'>
<header class='header'>
<header class='header <%= config.style %>'>
<div><i class="fas fa-handshake fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;友链</div>
<% if(config.email) { %>
<a class="rightBtn" title="联系博主添加友链" target="_blank" rel="external nofollow noopener noreferrer" href="mailto:<%= config.email %>?subject=交换友链&body=你好,我想和你交换友链,我已经将【<%= config.title %>】添加到我的博客的友链中。我的博客链接是:"><i class="fas fa-plus fa-fw"></i></a>
<%} %>
</header>
<div class='content'>
<div class='content <%= config.style %>'>
<ul class="entry" id="links">
<% (config.widgets.links||[]).forEach(function(item){ %>
<li><a class="flat-box" target="_blank" rel="external nofollow noopener noreferrer" href="<%= url_for(item.url) %>">

@ -1,9 +1,9 @@
<section class='m_widget music'>
<header class='header'>
<header class='header <%= config.style %>'>
<div><i class="fas fa-headphones-alt fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;音乐</div>
<a class="rightBtn" title="打开博主的网易云音乐主页" target="_blank" rel="external nofollow noopener noreferrer" href="https://music.163.com/#/playlist?id=<%= config.widgets.musicid %>"><i class="fas fa-external-link-square-alt fa-fw"></i></a>
</header>
<div class='content'>
<div class='content <%= config.style %>'>
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=100% height=450 src="//music.163.com/outchain/player?type=0&id=<%= config.widgets.musicid %>&auto=0&height=450"></iframe>
</div>
</section>

@ -1,9 +1,9 @@
<% if (site.tags.length){ %>
<section class='m_widget tagcloud'>
<header class="header">
<header class="header <%= config.style %>">
<div><i class="fas fa-tags fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;标签</div>
</header>
<div class='content'>
<div class='content <%= config.style %>'>
<%- tagcloud(site.tags, {
min_font: 14,
max_font: 24,

@ -1,10 +1,10 @@
<% if(page.content && page.toc!==false && toc(page.content).length > 0){ %>
<section class='m_widget toc-wrapper'>
<header class="header">
<header class="header <%= config.style %>">
<div><i class="fas fa-list fa-fw" aria-hidden="true"></i>&nbsp;&nbsp;目录</div>
<div class='wrapper'><a class="s-toc rightBtn" title="固定到顶部" target="_blank" rel="external nofollow noopener noreferrer" href="javascript:void(0)"><i class="fas fa-thumbtack fa-fw"></i></a></div>
</header>
<div class='content'>
<div class='content <%= config.style %>'>
<%- toc(page.content, {list_number: false}) %>
</div>
</section>

@ -11,17 +11,17 @@
/* My Base */
html {
color: @theme_text_main;
width: 100%;
height: 100%;
padding-top: @height_navbar;
font-family: @fontfamily_base;
font-size: @fontsize_base;
line-height: 1.5rem;
color: @theme_text_main;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
text-rendering: optimizelegibility;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
body {
@ -102,12 +102,10 @@ body {
::-moz-selection {
background: fade(lighten(@theme_text_link, 5%), 25%);
// color: @black;
}
::selection {
background: fade(lighten(@theme_text_link, 5%), 25%);
// color: @black;
}
// transition
.enable-trans(@time: 0.25s){
@ -234,35 +232,9 @@ img {
.disable-trans {
-moz-transition: none !important;
-webkit-transition: none !important;
-o-transition: color 0 ease-in !important;
transition: none !important;
}
.dark-btn {
display: inline-block;
background: rgba(0, 0, 0, 0.3);
border: 1px solid black;
padding: 0px 15px;
font-size: 13px;
font-family: @fontfamily_base;
text-align: center;
color: lighten(#8f8f8f, 20%);
&:hover {
color: lighten(#8f8f8f, 40%);
// background-color: @brand-color;
}
.icon {
margin-right: 5px;
font-size: 16px;
vertical-align: middle;
line-height: 44px;
}
.text {
vertical-align: middle;
line-height: 44px;
}
}
.txt-ellipsis {
white-space: nowrap;
overflow: hidden;
@ -281,20 +253,20 @@ li {
.mark {
position: relative;
a {
color: @black;
background: transparent;
display: inline-block;
padding: 0 8px;
color: @black;
border-left: @border_radius_line solid transparent;
background: transparent;
border-radius: @border_radius_code_block;
.enable-trans();
&:hover {
background: fade(@theme_bg_quote, 10%);
border-left: @border_radius_line solid @theme_bg_quote;
padding: 8px;
background: fade(@theme_bg_quote, 10%);
}
&:active {
// border-radius: @border_radius;
border-left: max(@border_radius, @border_radius_line) solid @theme_bg_quote;
}
@ -332,8 +304,11 @@ ul.h-list {
width: 0;
height: 8px;
height: @height_navbar;
background-color: fade(@theme_text_in_header, 20%);
.enable-trans();
background-color: fade(white, 30%);
&.pure{
background-color: fade(@theme_base_tint, 30%);
}
}
.container {

@ -39,9 +39,6 @@
@color_ax_light_red: #FF6868;
@color_ax_red: #F24E32;
@color_ax_blue: #52A1F8;
// 主题色
@theme_base_main: #EFEFEF;
@theme_base_tint: @color_mac_maximize;
// 阴影
@boxshadow_base_1: 0 1px 2px 0px rgba(0, 0, 0, 0.1);
@boxshadow_base_2: 0 2px 4px 0px rgba(0, 0, 0, 0.1);
@ -136,11 +133,18 @@
// start: 自定义主题色 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// 如果你只想简单地换个风格,可以只改这里的几项:
// 主题色
@theme_base_main: #EFEFEF;
@theme_base_tint: @color_mac_maximize;
@theme_base_bg: #efefef;
@theme_base_card_bg: white;
// 背景色 ----------------
// 网页背景
@theme_bg_main: @theme_base_main;
// 导航栏背景
@theme_bg_navbar: white;
@theme_bg_navbar: @color_mac_maximize;
// 卡片背景
@theme_bg_card: white;
// 卡片标题栏背景
@ -159,7 +163,7 @@
// 链接高亮颜色
@theme_text_highlight: @theme_base_tint;
// 在主题色中显示的文本(一般为白或深灰)
@theme_text_in_header: @theme_base_tint;
@theme_text_in_header: white;
// 正文文字颜色
@theme_text_main: @dark;
// end: 自定义主题色 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

@ -31,14 +31,15 @@
height: @height_navbar;
}
background: @theme_bg_navbar;
&, a{
.txt-ellipsis;
height: @height_navbar;
line-height: @height_navbar;
color: @theme_text_in_header;
}
// &:extend(.z-depth-nav); // 适合深色导航栏背景
box-shadow: @boxshadow_card_normal; // 适合白色导航栏背景
&:extend(.z-depth-nav); // 适合深色导航栏背景
.enable-trans();
&:hover {
// &:extend(.z-depth-nav-raised);
@ -129,7 +130,105 @@
.nav-sub .switcher{
display: flex;
}
.m_search {
position: relative;
height: @height_navbar - @gap;
width: @width_sidebar;
line-height: @height_navbar - @gap;
margin-top: @gap/2;
margin-bottom: @gap/2;
vertical-align: middle;
.form {
position: relative;
display: block;
width: 100%;
}
.icon,.input{
.enable-trans(.1s);
}
.icon {
position: absolute;
display:block;
height: @height_navbar - @gap;
width: @height_navbar - @gap;
line-height: @height_navbar - @gap;
top: 0;
left: @gap/2;
font-size: @fontsize_small;
}
.input {
display:block;
font-size: @fontsize_small;
line-height: @height_navbar - @gap;
margin: 0;
width: 100%;
color: fade(@theme_text_in_header, 60%);
padding-left: @fontsize_base + @gap - 2px;
@media(max-width: @on_phone){
padding-left: @fontsize_base + @gap - 2px;
}
height: @height_navbar - @gap;
line-height: @height_navbar - @gap;
font-family: @fontfamily_base;
border: none;
border-radius: @border_radius;
background: fade(@theme_text_in_header,15%);
box-sizing: border-box;
-webkit-appearance: none;
box-shadow: none;
border: 1px dashed transparent;
.enable-trans();
~ .icon{
color: fade(@theme_text_in_header, 60%);
}
.set-placeholder({color: fade(@theme_text_in_header, 60%)});
&:hover{
border: 1px dashed fade(@theme_text_in_header, 60%);
}
&:focus {
// color:@black;
border: 1px solid fade(@theme_text_in_header, 60%);
// .set-placeholder({color: @black});
}
&:focus ~ .icon{
// color: @black;
}
}
}
&.pure{
background: @theme_base_card_bg;
&, a{
color: @theme_base_tint;
}
box-shadow: @boxshadow_card_normal; // 适合白色导航栏背景
.menu{
ul > li > a{
color: fade(@theme_base_tint,60%);
&:hover,&.active{
color: @theme_base_tint;
}
}
.underline{
background: @theme_base_tint;
}
}
.m_search {
.input {
color: fade(@theme_base_tint, 60%);
background: fade(@theme_base_tint,15%);
~ .icon{
color: fade(@theme_base_tint, 60%);
}
.set-placeholder({color: fade(@theme_base_tint, 60%)});
&:hover{
border: 1px dashed fade(@theme_base_tint, 60%);
}
&:focus {
border: 1px solid fade(@theme_base_tint, 60%);
}
}
}
}
@media (max-width: @on_phone) {
.m_search{
width:0;
@ -149,71 +248,7 @@
}
}
.m_search {
position: relative;
height: @height_navbar - @gap;
width: @width_sidebar;
line-height: @height_navbar - @gap;
margin-top: @gap/2;
margin-bottom: @gap/2;
vertical-align: middle;
.form {
position: relative;
display: block;
width: 100%;
}
.icon,.input{
.enable-trans(.1s);
}
.icon {
position: absolute;
display:block;
height: @height_navbar - @gap;
width: @height_navbar - @gap;
line-height: @height_navbar - @gap;
top: 0;
left: @gap/2;
font-size: @fontsize_small;
}
.input {
display:block;
font-size: @fontsize_small;
line-height: @height_navbar - @gap;
margin: 0;
width: 100%;
color: fade(@theme_text_in_header, 60%);
padding-left: @fontsize_base + @gap - 2px;
@media(max-width: @on_phone){
padding-left: @fontsize_base + @gap - 2px;
}
height: @height_navbar - @gap;
line-height: @height_navbar - @gap;
font-family: @fontfamily_base;
border: none;
border-radius: @border_radius;
background: fade(@theme_text_in_header,15%);
box-sizing: border-box;
-webkit-appearance: none;
box-shadow: none;
border: 1px dashed transparent;
.enable-trans();
~ .icon{
color: fade(@theme_text_in_header, 60%);
}
.set-placeholder({color: fade(@theme_text_in_header, 60%)});
&:hover{
border: 1px dashed fade(@theme_text_in_header, 60%);
}
&:focus {
// color:@black;
border: 1px solid fade(@theme_text_in_header, 60%);
// .set-placeholder({color: @black});
}
&:focus ~ .icon{
// color: @black;
}
}
}
.menu-phone{
.header{

@ -15,7 +15,9 @@
}
.content{
padding: @gap/2 0;
padding-top: 0; // 适合白色导航栏背景
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
a {
border-left: 4px solid transparent;
&:hover{

@ -40,19 +40,28 @@
font-weight: bold;
line-height: 1.5em;
padding: 8px @gap;
padding-top: 14px; // 适合白色导航栏背景
padding-bottom: 14px; // 适合白色导航栏背景
.rightBtn{
color: @theme_text_in_header;
&:hover {
color: darken(@theme_text_highlight, 25%);
}
}
&.pure{
background-color: @theme_bg_card;
color: @theme_base_tint;
padding-top: 14px; // 适合白色导航栏背景
padding-bottom: 14px; // 适合白色导航栏背景
.rightBtn{
color: @theme_base_tint;
&:hover {
color: darken(@theme_text_highlight, 25%);
}
}
}
}
.content{
text-align: justify;
padding: @gap/2;
// padding-top: 0; // 适合白色导航栏背景
max-height: ~"calc(100% - @{height_navbar} - 12.5 * @{gap})";
ul.entry > li > a{
padding: 0 @gap;
@ -157,7 +166,9 @@
.m_widget.categories{
.content{
padding: @gap/2 0;
padding-top: 0; // 适合白色导航栏背景
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
}
}
@ -165,7 +176,9 @@
.content{
text-align: justify;
padding: @gap/2 @gap;
padding-top: 0; // 适合白色导航栏背景
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
a{
display:inline-block;
.enable-trans(.1s);
@ -180,22 +193,31 @@
.m_widget.contacts{
.content{
padding: @gap/2 0;
padding-top: 0; // 适合白色导航栏背景
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
}
}
.m_widget.music{
.header{
&.pure{
padding-bottom: @gap/4; // 适合白色导航栏背景
}
}
.content{
padding: @gap/2;
padding-top: 0; // 适合白色导航栏背景
&.pure{
padding-top: @gap/4; // 适合白色导航栏背景
}
}
}
.m_widget.links{
.content{
padding: @gap/2 0;
padding-top: 0; // 适合白色导航栏背景
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
.name{
img{
display: inline;

Loading…
Cancel
Save