From 2d5c88044c9f744b620050d44c984bd16e9ed645 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Sun, 2 Sep 2018 15:06:27 +0800 Subject: [PATCH] update --- source/js/app.js | 4 ++-- source/less/_article.less | 10 +++++----- source/less/_defines.less | 5 +++-- source/less/_main.less | 11 +++++++---- source/less/_toc.less | 2 +- source/less/_widget.less | 17 ++++++++++------- 6 files changed, 28 insertions(+), 21 deletions(-) diff --git a/source/js/app.js b/source/js/app.js index 06651d3..675026c 100755 --- a/source/js/app.js +++ b/source/js/app.js @@ -22,10 +22,10 @@ var customSearch; $(document, window).scroll(() => { const scrollTop = $(window).scrollTop(); const del = scrollTop - pos; - if (del >= 80 && scrollTop > 100) { + if (del >= 50 && scrollTop > 100) { pos = scrollTop; $wrapper.addClass('sub'); - } else if (del <= -80) { + } else if (del <= -50) { pos = scrollTop; $wrapper.removeClass('sub'); } diff --git a/source/less/_article.less b/source/less/_article.less index a9b6625..5a464ce 100755 --- a/source/less/_article.less +++ b/source/less/_article.less @@ -195,7 +195,7 @@ -moz-box-sizing: border-box; box-sizing: border-box; font-family: @code-font-family; - color: fade(@theme-text-main, 75%); + color: fade(@theme-text-main, 90%); } code { font-family: @code-font-family; @@ -398,7 +398,7 @@ font-size: @small-font-size * .95; font-family:@code-font-family; line-height: @base-line-height; - border-radius: @border-radius; + border-radius: @border-code-block; .enable-trans(); table{ @@ -427,8 +427,8 @@ } &::-webkit-scrollbar { - height: 8px; - width: 8px; + height: @border-code-block; + width: @border-code-block; } // /* Track */ @@ -442,7 +442,7 @@ &::-webkit-scrollbar-thumb { background: darken(@theme-bg-code-block, 5%); cursor: pointer; - border-radius: @border-radius; + border-radius: @border-code-block; .enable-trans(); &:hover { background: darken(@theme-bg-code-block, 12%); diff --git a/source/less/_defines.less b/source/less/_defines.less index d8b375c..e911733 100755 --- a/source/less/_defines.less +++ b/source/less/_defines.less @@ -124,9 +124,10 @@ // start: 圆角 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -// 圆角半径,可以根据心情随时调整风格 -@border-radius: 8px; // 0px: 极端,2px:硬朗,4px:常规,8px:温柔,16px:圆润 +// 0px: 极端,2px:硬朗,4px:常规,8px:圆润,16px:温柔 +@border-radius: 4px; // 圆角半径,可以根据心情随时调整风格 @border-left-radius: 4px; // 左边的竖线的宽度 +@border-code-block: 4px; // 代码块的圆角及其滚动条的宽度 // end: 圆角 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< diff --git a/source/less/_main.less b/source/less/_main.less index d66daff..1e86fa8 100755 --- a/source/less/_main.less +++ b/source/less/_main.less @@ -164,9 +164,6 @@ //max-width: 768px; background: @theme-bg-card; border-radius: @border-radius; - @media(max-width: @on-phone) { - border-radius: 0; - } h1{ font-weight: normal; font-size: @article-title-size; @@ -176,11 +173,17 @@ &:extend(.z-depth-main); .enable-trans(); &:hover { - &:extend(.z-depth-main-raised); + box-shadow: @box-shadow-card-raised; } &:active { box-shadow: @box-shadow-card-normal; } + @media(max-width: @on-phone) { + border-radius: 0; + &:hover { + box-shadow: @box-shadow-card-normal; + } + } .meta { margin-bottom: 2*@gap; .title { diff --git a/source/less/_toc.less b/source/less/_toc.less index daca0d5..17e43e3 100755 --- a/source/less/_toc.less +++ b/source/less/_toc.less @@ -2,7 +2,7 @@ overflow: auto; border-radius: @border-radius; position: fixed; - top: @header-height + @gap; + top: @header-height + 2*@gap; display: none; .content{ padding: @gap/2 0; diff --git a/source/less/_widget.less b/source/less/_widget.less index 4618174..fa7dade 100755 --- a/source/less/_widget.less +++ b/source/less/_widget.less @@ -3,19 +3,22 @@ background: @theme-bg-card; margin-bottom: @gap; border-radius: @border-radius; - @media(max-width: @on-phone) { - border-radius: 0; - width: 100%; - } - width: @side-width; - max-height: ~"calc(100% - @{header-height} - 4 * @{gap})"; .enable-trans(); &:hover { - &:extend(.z-depth-main-raised); + box-shadow: @box-shadow-card-raised; } &:active { box-shadow: @box-shadow-card-normal; } + @media(max-width: @on-phone) { + border-radius: 0; + width: 100%; + &:hover { + box-shadow: @box-shadow-card-normal; + } + } + width: @side-width; + max-height: ~"calc(100% - @{header-height} - 4 * @{gap})"; .header{ border-top-left-radius: @border-radius;