From 03df5688ebde7a3d1fd4b81211b66ec28c7641db 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: Sat, 18 May 2019 16:18:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8C=89=E5=B9=B4=E6=9C=88?= =?UTF-8?q?=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/yilia/layout/_partial/tools.ejs | 13 +++------ themes/yilia/source-src/config/waifu-tip.json | 3 +- .../yilia/source-src/css/core/_animation.scss | 28 +++++++++---------- themes/yilia/source-src/js/slider.js | 9 ++++-- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/themes/yilia/layout/_partial/tools.ejs b/themes/yilia/layout/_partial/tools.ejs index 09cff4e..1daa169 100644 --- a/themes/yilia/layout/_partial/tools.ejs +++ b/themes/yilia/layout/_partial/tools.ejs @@ -5,14 +5,8 @@ %>
- <% - var count = 0 - for(let menu_name in theme.smart_menu) { - if(theme.smart_menu[menu_name]) count++ - } - %>
    - <% var divide = 100 / count + '%' + <% var divide = 100 / Object.keys(theme.smart_menu).length + '%' for (let menu_name in theme.smart_menu){ if(theme.smart_menu[menu_name]){ %>
  • <%= __(theme.smart_menu[menu_name]) %>
  • @@ -27,6 +21,7 @@ + {{searchItem.query}} @@ -68,9 +63,9 @@ -

    +

    - +

    diff --git a/themes/yilia/source-src/config/waifu-tip.json b/themes/yilia/source-src/config/waifu-tip.json index cd8a2c6..5dd7cc5 100644 --- a/themes/yilia/source-src/config/waifu-tip.json +++ b/themes/yilia/source-src/config/waifu-tip.json @@ -7,7 +7,8 @@ "aboutme": "想听听关于主人的故事吗", "github": "发现主人出没地点!", "weibo": "发现主人出没地点!", - "mail" : "这里是主人的联系方式", + "rss": "订阅就可以看到最新的文章啦", + "mail": "这里是主人的联系方式", "tools.eye": "深夜时要爱护眼睛呀", "tools.chart": "猜猜我要说些什么", "tools.photo": "你要给我拍照呀,一二三~茄子~~", diff --git a/themes/yilia/source-src/css/core/_animation.scss b/themes/yilia/source-src/css/core/_animation.scss index 9fe54f9..619816e 100644 --- a/themes/yilia/source-src/css/core/_animation.scss +++ b/themes/yilia/source-src/css/core/_animation.scss @@ -248,22 +248,15 @@ } } - -/*弹性动画*/ -@keyframes leftIn { - from {transform: translate3d(0, 0, 0);} - to {transform: translate3d(333px, 0, 0);} -} - %anmCommon { animation-duration: .5s; animation-fill-mode: both; animation-timing-function: ease-in-out; } -%anmLeftIn { - @extend %anmCommon; - animation-name: leftIn; +@keyframes leftIn { + from {transform: translate3d(0, 0, 0);} + to {transform: translate3d(333px, 0, 0);} } @keyframes leftOut { @@ -271,6 +264,11 @@ to {transform: translate3d(0, 0, 0);} } +%anmLeftIn { + @extend %anmCommon; + animation-name: leftIn; +} + %anmLeftOut { @extend %anmCommon; animation-name: leftOut; @@ -281,16 +279,16 @@ to {transform: translate3d(300px, 0, 0);} } -%anmSmallLeftIn { - @extend %anmCommon; - animation-name: smallLeftIn; -} - @keyframes smallleftOut { from {transform: translate3d(300px, 0, 0);} to {transform: translate3d(0, 0, 0);} } +%anmSmallLeftIn { + @extend %anmCommon; + animation-name: smallLeftIn; +} + %anmSmallLeftOut { @extend %anmCommon; animation-name: smallleftOut; diff --git a/themes/yilia/source-src/js/slider.js b/themes/yilia/source-src/js/slider.js index bfaba8b..12f7e91 100644 --- a/themes/yilia/source-src/js/slider.js +++ b/themes/yilia/source-src/js/slider.js @@ -64,6 +64,9 @@ new Vue({ } }, addSearchItem(query, type='title') { + if(query) { + query = query.trim() + } // 如果已存在相同的查询条件, 则不加入 var isExist = Array.prototype.some.call(this.searchItems, searchItem => { return searchItem.query === query && searchItem.type === type @@ -74,7 +77,6 @@ new Vue({ this.search = null }, searchKeydown(event) { - console.log(event.keyCode) if(event.keyCode == 13){ // 回车键 this.addSearchItem(this.search) } else if(event.keyCode == 8 && !this.search) { // 退格键 @@ -97,13 +99,12 @@ new Vue({ } }, filters: { - urlformat: (str) => { + urlformat (str) { return (window.themeConfig && window.themeConfig.root) ? window.themeConfig.root + str : '/' + str } }, watch: { searchItems (newVal, oldVal) { - console.log(newVal) if(newVal && newVal.length) { handleSearch.call(this, newVal) } else { @@ -148,6 +149,8 @@ function handleSearch(searchItems) { return Array.prototype.some.call(articleItem.categories, category => { return category.name === searchItem.query }) + case 'date' : + return articleItem.date && ( articleItem.date.substr(0,7) === searchItem.query ) } }) })