精简风格

i18n
xaoxuu 4 years ago
parent 4c76a98f3f
commit 73dea5256b
  1. 10
      _config.yml
  2. 2
      layout/_partial/article.ejs
  3. 4
      layout/_partial/header.ejs
  4. 2
      layout/_widget/blogger.ejs
  5. 2
      layout/_widget/category.ejs
  6. 2
      layout/_widget/copyright.ejs
  7. 2
      layout/_widget/donate.ejs
  8. 2
      layout/_widget/grid.ejs
  9. 2
      layout/_widget/list.ejs
  10. 2
      layout/_widget/music.ejs
  11. 2
      layout/_widget/related_posts.ejs
  12. 2
      layout/_widget/tagcloud.ejs
  13. 2
      layout/_widget/text.ejs
  14. 2
      layout/_widget/toc.ejs
  15. 5
      source/less/_base.less
  16. 5
      source/less/_color.less
  17. 110
      source/less/_header.less
  18. 66
      source/less/_side.less
  19. 12
      source/less/_toc.less

@ -15,8 +15,6 @@ info:
############################### 主题风格 ############################### ############################### 主题风格 ###############################
# style: material # material: 导航栏和标题栏背景是主题色
style: pure # pure: 导航栏和标题栏背景是白色
# 毛玻璃效果 具体效果调整在: source/less/_color.less # 毛玻璃效果 具体效果调整在: source/less/_color.less
blur: blur:
@ -44,10 +42,10 @@ backstretch:
duration: 6000 # 持续时间(毫秒) duration: 6000 # 持续时间(毫秒)
fade: 2500 # 渐变(毫秒) fade: 2500 # 渐变(毫秒)
images: images:
- https://i.loli.net/2020/02/08/HNuVoted2mUxILl.jpg # - https://i.loli.net/2020/02/08/HNuVoted2mUxILl.jpg
- https://i.loli.net/2020/02/08/dNJyR4LHtarTqPu.jpg # - https://i.loli.net/2020/02/08/dNJyR4LHtarTqPu.jpg
- https://i.loli.net/2020/02/08/yXx4GwgZYdi81Qs.jpg # - https://i.loli.net/2020/02/08/yXx4GwgZYdi81Qs.jpg
- https://i.loli.net/2020/02/08/RP7JpGvWaCYfuB6.jpg # - https://i.loli.net/2020/02/08/RP7JpGvWaCYfuB6.jpg
# page的封面 # page的封面

@ -20,7 +20,7 @@
<% }) %> <% }) %>
<% } %> <% } %>
</div> </div>
<% if(post.layout == 'post'){ %> <% if(post.layout == 'post' || post.layout == 'page'){ %>
<br> <br>
<%- partial('meta', {post: post, position: 'footer'}) %> <%- partial('meta', {post: post, position: 'footer'}) %>
<% } %> <% } %>

@ -1,6 +1,6 @@
<header class="l_header<%- page.sidebar == false ? ' no_sidebar' : '' %> <%= theme.style %> <%- theme.blur.nav ? 'nav-blur' : '' %>"> <header class="l_header<%- page.sidebar == false ? ' no_sidebar' : '' %> <%- theme.blur.nav ? 'nav-blur' : '' %>">
<div id="loading-bar-wrapper"> <div id="loading-bar-wrapper">
<div id="loading-bar" class="<%= theme.style %>"></div> <div id="loading-bar"></div>
</div> </div>
<div class='wrapper'> <div class='wrapper'>

@ -1,5 +1,5 @@
<section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'> <section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'>
<div class='content <%= theme.style %>'> <div class='content'>
<% if(item.avatar) { %> <% if(item.avatar) { %>
<div class='avatar'> <div class='avatar'>
<img class='avatar' src='<%- item.avatar %>'/> <img class='avatar' src='<%- item.avatar %>'/>

@ -1,7 +1,7 @@
<% if (site.categories.length){ %> <% if (site.categories.length){ %>
<section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'> <section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'>
<%- partial('header', {item: item}) %> <%- partial('header', {item: item}) %>
<div class='content <%= theme.style %>'> <div class='content'>
<ul class="entry"> <ul class="entry">
<% site.categories.sort('path').each(function(category){ %> <% site.categories.sort('path').each(function(category){ %>
<li><a class="flat-box<%= category.parent ? ' child' : ''%>" title="<%- url_for(category.path) %>" href="<%- url_for(category.path) %>"><div class='name'><%- category.name %></div><div class='badge'>(<%- category.posts.length %>)</div></a></li> <li><a class="flat-box<%= category.parent ? ' child' : ''%>" title="<%- url_for(category.path) %>" href="<%- url_for(category.path) %>"><div class='name'><%- category.name %></div><div class='badge'>(<%- category.posts.length %>)</div></a></li>

@ -1,5 +1,5 @@
<section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'> <section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'>
<div class='content <%= theme.style %>'> <div class='content'>
<% if (item.blockquote == true) { %> <% if (item.blockquote == true) { %>
<blockquote> <blockquote>
<% (item.content||[]).forEach(function(row){ %> <% (item.content||[]).forEach(function(row){ %>

@ -1,6 +1,6 @@
<section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'> <section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'>
<%- partial('header', {item: item}) %> <%- partial('header', {item: item}) %>
<div class='content <%= theme.style %>'> <div class='content'>
<% if (item.fancybox == true) { %> <% if (item.fancybox == true) { %>
<fancybox> <fancybox>
<% (item.images||[]).forEach(function(url){ %> <% (item.images||[]).forEach(function(url){ %>

@ -1,6 +1,6 @@
<section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'> <section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'>
<%- partial('header', {item: item}) %> <%- partial('header', {item: item}) %>
<div class='content <%= theme.style %>'> <div class='content'>
<ul class="grid navgation"> <ul class="grid navgation">
<% (item.rows||[]).forEach(function(row){ %> <% (item.rows||[]).forEach(function(row){ %>
<li><a class="flat-box" title="<%- url_for(row.url) %>" href="<%- url_for(row.url) %>" <li><a class="flat-box" title="<%- url_for(row.url) %>" href="<%- url_for(row.url) %>"

@ -1,6 +1,6 @@
<section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'> <section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'>
<%- partial('header', {item: item}) %> <%- partial('header', {item: item}) %>
<div class='content <%= theme.style %>'> <div class='content'>
<ul class="entry"> <ul class="entry">
<% (item.rows||[]).forEach(function(row){ %> <% (item.rows||[]).forEach(function(row){ %>
<li><a class="flat-box" title="<%- url_for(row.url) %>" href="<%- url_for(row.url) %>" <li><a class="flat-box" title="<%- url_for(row.url) %>" href="<%- url_for(row.url) %>"

@ -1,7 +1,7 @@
<% if (theme.aplayer.enable == true) { %> <% if (theme.aplayer.enable == true) { %>
<section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'> <section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'>
<%- partial('header', {item: item}) %> <%- partial('header', {item: item}) %>
<div class='content <%= theme.style %>'> <div class='content'>
<%- partial('../_third-party/aplayer', {post: null, where: 'widget'}) %> <%- partial('../_third-party/aplayer', {post: null, where: 'widget'}) %>
</div> </div>
</section> </section>

@ -1,7 +1,7 @@
<% if(page.layout == 'post' && page.content && page.path != undefined){ %> <% if(page.layout == 'post' && page.content && page.path != undefined){ %>
<section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'> <section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'>
<%- partial('header', {item: item}) %> <%- partial('header', {item: item}) %>
<div class="content <%= theme.style %>"> <div class="content">
<%- popular_posts( { maxCount: 10 , ulClass: 'popular-posts' , PPMixingRate: 0.2 } , page ) %> <%- popular_posts( { maxCount: 10 , ulClass: 'popular-posts' , PPMixingRate: 0.2 } , page ) %>
</div> </div>
</section> </section>

@ -1,7 +1,7 @@
<% if (site.tags.length){ %> <% if (site.tags.length){ %>
<section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'> <section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class %>'>
<%- partial('header', {item: item}) %> <%- partial('header', {item: item}) %>
<div class='content <%= theme.style %>'> <div class='content'>
<%- tagcloud(site.tags, { <%- tagcloud(site.tags, {
min_font: item.min_font, min_font: item.min_font,
max_font: item.max_font, max_font: item.max_font,

@ -1,6 +1,6 @@
<section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class?item.class:'text' %>'> <section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> <%- item.class?item.class:'text' %>'>
<%- partial('header', {item: item}) %> <%- partial('header', {item: item}) %>
<div class='content <%= theme.style %>'> <div class='content'>
<% (item.content||[]).forEach(function(row){ %> <% (item.content||[]).forEach(function(row){ %>
<p> <p>
<%- markdown(row) %> <%- markdown(row) %>

@ -1,7 +1,7 @@
<% if(page.content && page.toc != false && toc(page.content).length > 0){ %> <% if(page.content && page.toc != false && toc(page.content).length > 0){ %>
<section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> toc-wrapper'> <section class='widget <%- theme.blur.widget ? 'widget-blur' : '' %> toc-wrapper'>
<%- partial('header', {item: item}) %> <%- partial('header', {item: item}) %>
<div class='content <%= theme.style %>'> <div class='content'>
<%- toc(page.content, {list_number: item.list_number, min_depth: item.min_depth, max_depth: item.max_depth}) %> <%- toc(page.content, {list_number: item.list_number, min_depth: item.min_depth, max_depth: item.max_depth}) %>
</div> </div>
</section> </section>

@ -467,10 +467,7 @@ ul.h-list {
height: @loading_height; height: @loading_height;
// height: @height_navbar; // height: @height_navbar;
.enable-trans(); .enable-trans();
background-color: fade(white, 50%); background-color: fade(@theme_main, 50%);
&.pure{
background-color: fade(@theme_main, 50%);
}
} }
.body-wrapper { .body-wrapper {

@ -43,10 +43,7 @@
// 导航栏毛玻璃效果 // 导航栏毛玻璃效果
.nav-blur { .nav-blur {
background: fade(@color_bg_navbar, 75%); background: fade(@theme_cardbg, 75%);
&.pure {
background: fade(@theme_cardbg, 75%);
}
backdrop-filter: blur(60px); backdrop-filter: blur(60px);
} }

@ -13,13 +13,14 @@
font-family: @fontfamily_base; font-family: @fontfamily_base;
padding: 0 @gap; padding: 0 @gap;
margin-bottom: @gap; margin-bottom: @gap;
box-shadow: @boxshadow_card_normal;
.wrapper{ .wrapper{
padding: auto @gap; padding: auto @gap;
max-width: @width_container; max-width: @width_container;
margin: auto; margin: auto;
.enable-trans(); .enable-trans();
a.logo { a.logo {
color: @color_text_in_header; color: @color_text_header;
} }
} }
&.no_sidebar{ &.no_sidebar{
@ -44,7 +45,7 @@
.nav--main,.nav-sub{ .nav--main,.nav-sub{
height: @height_navbar; height: @height_navbar;
} }
background: @color_bg_navbar; background: @theme_cardbg;
&.hide{ &.hide{
transform: translateY(100px) scale(0); transform: translateY(100px) scale(0);
} }
@ -55,7 +56,7 @@
.txt-ellipsis; .txt-ellipsis;
height: @height_navbar; height: @height_navbar;
line-height: @height_navbar; line-height: @height_navbar;
color: @color_text_in_header; color: @theme_main;
} }
&:extend(.z-depth-nav); // 适合深色导航栏背景 &:extend(.z-depth-nav); // 适合深色导航栏背景
@ -106,17 +107,19 @@
ul > li > a{ ul > li > a{
.enable-trans(); .enable-trans();
display: block; display: block;
font-size: @fontsize_base;
color: fade(@color_text_in_header, 70%);
padding: 0 8px; padding: 0 8px;
color: fade(@color_text_main, 85%);
&.current{
border-bottom: @loading_height solid fade(@theme_main, 80%);
}
&:hover{ &:hover{
color: @color_text_in_header; color: @theme_main;
border-bottom: @loading_height solid @theme_cardbg; border-bottom: @loading_height solid @theme_main;
background: fade(@theme_cardbg, 10%); background: fade(@theme_main, 10%);
} }
&:active,&.active{ &:active,&.active{
color: @color_text_in_header; color: @theme_main;
border-bottom: @loading_height solid @theme_cardbg; border-bottom: @loading_height solid @theme_main;
} }
} }
@media(max-width: @on_phone){ @media(max-width: @on_phone){
@ -153,7 +156,7 @@
border-radius: 100px; border-radius: 100px;
.enable-trans(); .enable-trans();
&:hover { &:hover {
background: fade(@theme_cardbg, 30%); background: fade(@theme_main, 15%);
} }
@media(max-width: @on_phone){ @media(max-width: @on_phone){
width: @iconW; width: @iconW;
@ -196,7 +199,7 @@
top: 0; top: 0;
left: @iconMargin+1px; left: @iconMargin+1px;
font-size: @fontsize_base; font-size: @fontsize_base;
color: fade(@color_text_in_header, 60%); color: fade(@color_text_main, 60%);
} }
.input { .input {
display: block; display: block;
@ -204,7 +207,8 @@
line-height: @fontsize_base; line-height: @fontsize_base;
height: @height_searchbar; height: @height_searchbar;
width: 100%; width: 100%;
color: fade(@color_text_in_header, 60%); color: @color_text_main;
background: @theme_background;
box-shadow: none; box-shadow: none;
box-sizing: border-box; box-sizing: border-box;
-webkit-appearance: none; -webkit-appearance: none;
@ -213,91 +217,25 @@
padding-left: @iconW + @iconMargin; padding-left: @iconW + @iconMargin;
} }
border-radius: @border_radius_searchbar; border-radius: @border_radius_searchbar;
background: fade(@theme_cardbg, 15%);
border: 1px dashed transparent; border: 1px dashed transparent;
.set-placeholder({ .set-placeholder({
padding-top: 2px; padding-top: 2px;
color: fade(@color_text_in_header, 60%); color: fade(@color_text_main, 60%);
}); });
&:hover{ &:hover{
color: @color_text_in_header; color: @color_text_in_header;
border: 1px solid fade(@color_text_in_header, 60%);
}
&:focus {
~.icon{ ~.icon{
color: @color_text_in_header; color: fade(@theme_main, 80%);
} }
color: @color_text_in_header; border: 1px solid fade(@theme_main, 60%);
border: 1px solid @color_text_in_header;
}
}
}
&.pure{
background: @theme_cardbg;
&, a{
color: @theme_main;
}
box-shadow: @boxshadow_card_normal; // 适合白色导航栏背景
// box-shadow: none;
// background: transparent;
.wrapper{
a.logo {
color: @color_text_header;
} }
// background: @theme_cardbg; &:focus {
// box-shadow: @boxshadow_card_normal; // 适合白色导航栏背景 ~.icon{
}
.menu{
ul > li > a{
.enable-trans();
color: fade(@color_text_main, 85%);
&.current{
border-bottom: @loading_height solid fade(@theme_main, 80%);
}
&:hover{
color: @theme_main;
border-bottom: @loading_height solid @theme_main;
background: fade(@theme_main, 10%);
}
&:active,&.active{
color: @theme_main; color: @theme_main;
border-bottom: @loading_height solid @theme_main;
}
}
}
.switcher{
& > li{
a{
&:hover {
background: fade(@theme_main, 15%);
}
} }
}
}
.m_search {
.icon{
color: fade(@color_text_main, 60%);
}
.input {
color: @color_text_main; color: @color_text_main;
background: @theme_background; background: fade(@theme_main, 15%);
.set-placeholder({ border: 1px solid @theme_main;
color: fade(@color_text_main, 60%);
});
&:hover{
~.icon{
color: fade(@theme_main, 80%);
}
border: 1px solid fade(@theme_main, 60%);
}
&:focus {
~.icon{
color: @theme_main;
}
color: @color_text_main;
background: fade(@theme_main, 15%);
border: 1px solid @theme_main;
}
} }
} }
} }

@ -43,13 +43,13 @@
justify-content: space-between; justify-content: space-between;
border-top-left-radius: @border_radius; border-top-left-radius: @border_radius;
border-top-right-radius: @border_radius; border-top-right-radius: @border_radius;
background-color: @color_bg_navbar; color: @theme_main;
color: @color_text_in_header;
font-weight: bold; font-weight: bold;
line-height: 1.5em; line-height: 1.5em;
padding: 8px @gap; padding: ~"calc(@{gap} - 2px)";
padding-bottom: 0;
.rightBtn{ .rightBtn{
color: @color_text_in_header; color: @theme_main;
&:hover { &:hover {
color: darken(@theme_main, 25%); color: darken(@theme_main, 25%);
&.rotate90{ &.rotate90{
@ -57,22 +57,10 @@
} }
} }
} }
&.pure{
background-color: transparent;
color: @theme_main;
padding-top: 14px; // 适合白色导航栏背景
padding-bottom: 14px; // 适合白色导航栏背景
.rightBtn{
color: @theme_main;
&:hover {
color: darken(@theme_main, 25%);
}
}
}
} }
.content{ .content{
text-align: justify; text-align: justify;
padding: @gap/2; padding: @gap/2 0;
max-height: ~"calc(100% - @{height_navbar} - 12.5 * @{gap})"; max-height: ~"calc(100% - @{height_navbar} - 12.5 * @{gap})";
ul > li{ ul > li{
a{ a{
@ -164,7 +152,7 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
flex-wrap: wrap; flex-wrap: wrap;
margin: 4px @gap/2; margin: 4px @gap/4;
a{ a{
color: fade(@color_text_main, 70%); color: fade(@color_text_main, 70%);
padding: 0; padding: 0;
@ -204,11 +192,9 @@
font-size: @fontsize_small; font-size: @fontsize_small;
font-weight: bold; font-weight: bold;
word-break: break-all; word-break: break-all;
padding: @gap/2 @gap; padding: @gap;
line-height: @fontsize_small + 8px; line-height: @fontsize_small + 8px;
&.pure{
padding: 0 @gap @gap @gap; // 适合白色导航栏背景
}
a{ a{
color: @color_text_link; color: @color_text_link;
.enable-trans(); .enable-trans();
@ -226,9 +212,6 @@
&.list{ &.list{
.content{ .content{
padding: @gap/2 0; padding: @gap/2 0;
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
a{ a{
font-size: @fontsize_small; font-size: @fontsize_small;
font-weight: bold; font-weight: bold;
@ -255,10 +238,6 @@
} }
&.grid{ &.grid{
.content{ .content{
padding: @gap/2 0;
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
ul.grid{ ul.grid{
border: none; border: none;
display: flex; display: flex;
@ -309,12 +288,8 @@
} }
&.category{ &.category{
.content{ .content{
padding: @gap/2 0;
font-size: @fontsize_small; font-size: @fontsize_small;
font-weight: bold; font-weight: bold;
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
} }
} }
@ -322,9 +297,6 @@
.content{ .content{
text-align: justify; text-align: justify;
padding: @gap/2 @gap; padding: @gap/2 @gap;
&.pure{
padding: 0 @gap @gap @gap; // 适合白色导航栏背景
}
a{ a{
display:inline-block; display:inline-block;
.enable-trans(.1s); .enable-trans(.1s);
@ -337,29 +309,10 @@
} }
} }
&.music{
header{
&.pure{
padding-bottom: @gap/4; // 适合白色导航栏背景
}
}
.content{
padding: @gap/2+4px;
padding-top: @gap/2;
&.pure{
padding-top: @gap/4; // 适合白色导航栏背景
}
}
}
&.related_posts{ &.related_posts{
.content{ .content{
padding: @gap/2 0;
font-size: @fontsize_small; font-size: @fontsize_small;
font-weight: bold; font-weight: bold;
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
h3{ h3{
font-size: @fontsize_small; font-size: @fontsize_small;
font-weight: bold; font-weight: bold;
@ -380,9 +333,6 @@
flex-wrap: wrap; flex-wrap: wrap;
align-items: center; align-items: center;
justify-content: space-around; justify-content: space-around;
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
img{ img{
margin-bottom: 4px; margin-bottom: 4px;
} }

@ -11,25 +11,19 @@
top: 0; top: 0;
} }
.content{ .content{
padding: @gap/2 0 @gap 0;
max-height: 500px; max-height: 500px;
overflow: auto; overflow: auto;
&.pure{
padding-top: 0; // 适合白色导航栏背景
}
a { a {
border-left: 4px solid transparent; border-left: 4px solid transparent;
&:hover{ &:hover{
color: fade(@color_text_main, 100%); background: fade(@theme_main, 10%);
border-left: 4px solid @theme_main;
} }
&:active{ &:active{
border-left: 8px solid @theme_main; border-left: 8px solid @theme_main;
} }
&.active{ &.active{
color: fade(@color_text_main, 100%); color: @theme_main;
border-left: 4px solid @theme_main; border-left: 4px solid @theme_main;
background: fade(@theme_main, 10%);
} }
} }
} }
@ -71,7 +65,7 @@
a { a {
padding-left: 8px; padding-left: 8px;
color: fade(@color_text_main, 60%); color: fade(@color_text_main, 70%);
font-size: @fontsize_small; font-size: @fontsize_small;
display: inline-block; display: inline-block;
} }

Loading…
Cancel
Save