diff --git a/themes/yilia/layout/_partial/left-col.ejs b/themes/yilia/layout/_partial/left-col.ejs index 2f7357f..19dd6a2 100644 --- a/themes/yilia/layout/_partial/left-col.ejs +++ b/themes/yilia/layout/_partial/left-col.ejs @@ -1,5 +1,4 @@ <% var defaultBg = '#4d4d4d'; %> -
\ No newline at end of file diff --git a/themes/yilia/source-src/css/grid.scss b/themes/yilia/source-src/css/grid.scss index 87ef19d..eaa1b41 100644 --- a/themes/yilia/source-src/css/grid.scss +++ b/themes/yilia/source-src/css/grid.scss @@ -27,10 +27,13 @@ html, body, #container { .anm-canvas { display: none; } - &.show .anm-canvas { - display: block; - position: fixed; - } + &.show { + overflow-y: hidden; + .anm-canvas { + display: block; + position: fixed; + } + } } .body-wrap{ padding-top: 30px; diff --git a/themes/yilia/source-src/css/img/left_bg.jpg b/themes/yilia/source-src/css/img/left_bg.jpg new file mode 100644 index 0000000..d5b3b30 Binary files /dev/null and b/themes/yilia/source-src/css/img/left_bg.jpg differ diff --git a/themes/yilia/source-src/css/left.scss b/themes/yilia/source-src/css/left.scss index 4d06dd8..da07e81 100644 --- a/themes/yilia/source-src/css/left.scss +++ b/themes/yilia/source-src/css/left.scss @@ -1,21 +1,13 @@ .left-col { - background: $colorBg; + background: $colorBg url(./img/left_bg.jpg) no-repeat; + background-size: cover; width: 300px; position:fixed; opacity:1; @extend %trans; height:100%; - z-index: 999; - &.show { - @extend %shadow; - } - .overlay{ - width: 100%; - height: 130px; - position: absolute; - background: #4d4d4d; - @extend %trans; - } + z-index: 999; + @extend %shadow; .intrude-less { width: 76%; diff --git a/themes/yilia/source-src/css/night.scss b/themes/yilia/source-src/css/night.scss index 5f43093..1fda0d6 100644 --- a/themes/yilia/source-src/css/night.scss +++ b/themes/yilia/source-src/css/night.scss @@ -105,9 +105,6 @@ body.night { display: none; } } - .overlay { - background: none; - } // 头像 看板娘 图标 -> 降低亮度滤镜 .profilepic, .waifu, #header .header-nav .social a { filter: brightness(30%); diff --git a/themes/yilia/source-src/js/aside.js b/themes/yilia/source-src/js/aside.js index 7eeafec..5d1f4a1 100644 --- a/themes/yilia/source-src/js/aside.js +++ b/themes/yilia/source-src/js/aside.js @@ -1,13 +1,12 @@ var backTop = function (domE, ctn, distance) { if (!domE) return - var timer = null - var _onscroll = ctn.onscroll - ctn.onscroll = throttle(function () { // 滚动到一定高度才显示"回到顶部"按钮 - typeof _onscroll === 'function' && _onscroll.apply(this, arguments) - toggleDomE() - }, 100) + ctn.addEventListener('scroll', function(){ + // 滚动到一定高度才显示"回到顶部"按钮 + throttle(toggleDomE, 200)(domE, ctn, distance) + }) if(!window.getComputedStyle || window.getComputedStyle(ctn).scrollBehavior === undefined) { // 浏览器不支持scroll-behavior属性 + let timer = null domE.querySelector('a[href="#top"]').addEventListener('click', function (event) { event.preventDefault() timer = setInterval(function () { //设置一个计时器 @@ -26,16 +25,15 @@ var backTop = function (domE, ctn, distance) { }) } - function toggleDomE() { - domE.style.display = (ctn.scrollTop || document.documentElement.scrollTop || document.body.scrollTop) > distance ? 'block' : 'none' + function toggleDomE(targetDom, containerDom, distance) { + targetDom.style.display = (containerDom.scrollTop || document.documentElement.scrollTop || document.body.scrollTop) > distance ? 'block' : 'none' } function throttle(func, wait) { var timer = null - return function () { - var self = this, args = arguments + return function (...args) { if (timer) clearTimeout(timer) - timer = setTimeout(function () { - return typeof func === 'function' && func.apply(self, args) + timer = setTimeout(() => { + return typeof func === 'function' && func.apply(this, args) }, wait) } } diff --git a/themes/yilia/source-src/js/main.js b/themes/yilia/source-src/js/main.js index f472775..c6657ac 100644 --- a/themes/yilia/source-src/js/main.js +++ b/themes/yilia/source-src/js/main.js @@ -27,17 +27,17 @@ Util.addLoadEvent(function() { },{ // 放大 scale: 0.8 },{ // 缩小 - scale: 1.2 + scale: 1.1 },{ // 绕X轴旋转 rotate: { x: 30 } },{ // 绕Y轴旋转 - rotate: { y: 30 } + rotate: { y: 20 } }] import(/* webpackChunkName: "scrollreveal" */ 'scrollreveal').then(ScrollReveal => { let index = Math.floor(Math.random() * animateTypes.length) ScrollReveal.default().reveal('.article-index', Object.assign({ delay: 200, - container: document.querySelector('#container') + container: document.getElementById('container') }, animateTypes[index])) }) } diff --git a/themes/yilia/source-src/js/photo-wall.js b/themes/yilia/source-src/js/photo-wall.js index 5ff497b..dd3aebd 100644 --- a/themes/yilia/source-src/js/photo-wall.js +++ b/themes/yilia/source-src/js/photo-wall.js @@ -92,11 +92,8 @@ function checkScrollSlide(){ } function init() { - var _onscroll = scrollDom.onscroll var timer = null - scrollDom.onscroll = function () { - // 保留已有的滚动事件回调函数并在新的回调函数中进行调用 - typeof _onscroll === 'function' && _onscroll.apply(this, arguments) + scrollDom.addEventListener('scroll', function(){ if(scrollLock) return if(timer) clearTimeout(timer) timer = setTimeout(()=>{ @@ -105,7 +102,7 @@ function init() { } timer = null }, 200) - } + }) loadMoreItems(defaultStep) } export default { init } \ No newline at end of file diff --git a/themes/yilia/source-src/js/util.js b/themes/yilia/source-src/js/util.js index 3e7ae42..0f48f4f 100644 --- a/themes/yilia/source-src/js/util.js +++ b/themes/yilia/source-src/js/util.js @@ -8,22 +8,23 @@ const Util = (function(){ var t = /"|<|>|&| |'|(\d+);|(\d+)/g , o = /['<> "&]/g , u = { - """: '"', - "<": "<", - ">": ">", - "&": "&", - " ": " " - } + """: '"', + "<": "<", + ">": ">", + "&": "&", + " ": " " + } , c = /\u00a0/g , a = /