From 816c5dcd40588dcf8aadef5b131036368a7d18cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=93=E5=8F=91=E5=8F=97=E9=95=BF=E7=94=9F?= Date: Wed, 22 May 2019 23:04:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=A8=E7=94=BB=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E7=9A=84fix=E5=85=83=E7=B4=A0=E5=AE=9A=E4=BD=8D?= =?UTF-8?q?=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/yilia/layout/_partial/article.ejs | 2 +- themes/yilia/layout/_partial/aside.ejs | 2 +- themes/yilia/layout/_partial/mobile-nav.ejs | 5 +---- themes/yilia/layout/layout.ejs | 3 +++ themes/yilia/source-src/css/article-inner.scss | 1 + themes/yilia/source-src/css/grid.scss | 2 +- themes/yilia/source-src/css/mobile.scss | 11 ++++------- themes/yilia/source-src/js/fix.js | 6 +++++- themes/yilia/source-src/js/slider.js | 6 +++++- 9 files changed, 22 insertions(+), 16 deletions(-) diff --git a/themes/yilia/layout/_partial/article.ejs b/themes/yilia/layout/_partial/article.ejs index 9f00f97..1b5fdb5 100644 --- a/themes/yilia/layout/_partial/article.ejs +++ b/themes/yilia/layout/_partial/article.ejs @@ -19,7 +19,7 @@ 总字数 <%= wordcount(post.content) %> - | +
预计阅读时间 diff --git a/themes/yilia/layout/_partial/aside.ejs b/themes/yilia/layout/_partial/aside.ejs index e54061b..870a544 100644 --- a/themes/yilia/layout/_partial/aside.ejs +++ b/themes/yilia/layout/_partial/aside.ejs @@ -10,7 +10,7 @@
<% } %> - <% if (!index && ((theme.toc === 1 && post.toc) || theme.toc === 2)){ %> + <% if (is_post() && ((theme.toc === 1 && post.toc) || theme.toc === 2)){ %>
diff --git a/themes/yilia/layout/_partial/mobile-nav.ejs b/themes/yilia/layout/_partial/mobile-nav.ejs index 0ec33be..eed5dcc 100644 --- a/themes/yilia/layout/_partial/mobile-nav.ejs +++ b/themes/yilia/layout/_partial/mobile-nav.ejs @@ -1,8 +1,5 @@ diff --git a/themes/yilia/layout/layout.ejs b/themes/yilia/layout/layout.ejs index 8065c97..8a6dd20 100644 --- a/themes/yilia/layout/layout.ejs +++ b/themes/yilia/layout/layout.ejs @@ -6,6 +6,9 @@ <%- partial('_partial/left-col', null, {cache: !config.relative_link}) %> <%- partial('_partial/live2d') %>
+
+
+
<%- partial('_partial/mobile-nav', null, {cache: !config.relative_link}) %>
diff --git a/themes/yilia/source-src/css/article-inner.scss b/themes/yilia/source-src/css/article-inner.scss index afe4a98..9400445 100644 --- a/themes/yilia/source-src/css/article-inner.scss +++ b/themes/yilia/source-src/css/article-inner.scss @@ -46,6 +46,7 @@ font-size: 14px; .count-item { display: inline-block; + padding-right: 10px; span { font-weight: bold; } diff --git a/themes/yilia/source-src/css/grid.scss b/themes/yilia/source-src/css/grid.scss index 96fc4e2..4a07dcf 100644 --- a/themes/yilia/source-src/css/grid.scss +++ b/themes/yilia/source-src/css/grid.scss @@ -14,7 +14,7 @@ html, body, #container { overflow-x: hidden; overflow-y: auto; } -#mobile-nav { +#mobile-nav,.js-mobile-btnctn { display: none; } #container{ diff --git a/themes/yilia/source-src/css/mobile.scss b/themes/yilia/source-src/css/mobile.scss index cf93965..e55e5e2 100644 --- a/themes/yilia/source-src/css/mobile.scss +++ b/themes/yilia/source-src/css/mobile.scss @@ -1,6 +1,3 @@ -#mobile-nav { - display: block; -} .body-wrap { margin-bottom: 0; } @@ -75,9 +72,6 @@ &.list { background-color: rgba(100,100,100,0.7) } - &:hover{ - background: #444; - } .icon{ font-size: 24px; color: #fff; @@ -275,6 +269,7 @@ } #mobile-nav{ + display: block; .header-author{ margin: 0; position: relative; @@ -297,7 +292,9 @@ } } } - +.js-mobile-btnctn { + display: block; +} .header-menu{ height: auto; margin: 10px 0 20px; diff --git a/themes/yilia/source-src/js/fix.js b/themes/yilia/source-src/js/fix.js index 2e5e004..48f7345 100644 --- a/themes/yilia/source-src/js/fix.js +++ b/themes/yilia/source-src/js/fix.js @@ -14,7 +14,11 @@ function init() { Array.prototype.forEach.call($a, function($em){ $em.style.display = 'none' }) - } + } + + // 避免由于动画带来的fix元素定位失效, 移到动画元素外层 + var sideOpt = document.querySelector('.wrap-side-operation') + document.getElementById('container').appendChild(sideOpt) } export default { init } \ No newline at end of file diff --git a/themes/yilia/source-src/js/slider.js b/themes/yilia/source-src/js/slider.js index ecefe4d..0224a74 100644 --- a/themes/yilia/source-src/js/slider.js +++ b/themes/yilia/source-src/js/slider.js @@ -38,7 +38,11 @@ new Vue({ stop (event) { event.stopPropagation() }, - openSlider (event, type) { + openSlider (event, type, isMobile) { + if(isMobile && this.isShow) { + this.hideSlider() + return + } event.stopPropagation() this.innerArchive = false this.friends = false