工具栏弹出隐藏效果优化

This commit is contained in:
结发受长生 2019-05-19 08:08:20 +08:00
parent 83a464b2c2
commit ea0d83d9fa
9 changed files with 63 additions and 34 deletions

View File

@ -6,7 +6,7 @@
<%- partial('_partial/left-col', null, {cache: !config.relative_link}) %> <%- partial('_partial/left-col', null, {cache: !config.relative_link}) %>
<%- partial('_partial/live2d') %> <%- partial('_partial/live2d') %>
</div> </div>
<div class="mid-col" :class="{show:isShow,hide:!isShow}"> <div class="mid-col" :class="{show: isShow,hide: isShow!==undefined && !isShow}">
<%- partial('_partial/mobile-nav', null, {cache: !config.relative_link}) %> <%- partial('_partial/mobile-nav', null, {cache: !config.relative_link}) %>
<div id="wrapper" class="body-wrap" v-pre> <div id="wrapper" class="body-wrap" v-pre>
<div class="menu-l"> <div class="menu-l">

View File

@ -255,13 +255,25 @@
} }
@keyframes leftIn { @keyframes leftIn {
from {transform: translate3d(0, 0, 0);} from {
to {transform: translate3d(333px, 0, 0);} transform: translate3d(0, 0, 0);
background:$colorBodyBg;
}
to {
transform: translate3d(333px, 0, 0);
background: none;
}
} }
@keyframes leftOut { @keyframes leftOut {
from {transform: translate3d(333px, 0, 0);} from {
to {transform: translate3d(0, 0, 0);} transform: translate3d(333px, 0, 0);
background: none;
}
to {
transform: translate3d(0, 0, 0);
background:$colorBodyBg;
}
} }
%anmLeftIn { %anmLeftIn {
@ -275,13 +287,25 @@
} }
@keyframes smallLeftIn { @keyframes smallLeftIn {
from {transform: translate3d(0, 0, 0);} from {
to {transform: translate3d(300px, 0, 0);} transform: translate3d(0, 0, 0);
opacity: 0;
}
to {
transform: translate3d(300px, 0, 0);
opacity: 1;
}
} }
@keyframes smallleftOut { @keyframes smallleftOut {
from {transform: translate3d(300px, 0, 0);} from {
to {transform: translate3d(0, 0, 0);} transform: translate3d(300px, 0, 0);
opacity: 1;
}
to {
transform: translate3d(0, 0, 0);
opacity: 0;
}
} }
%anmSmallLeftIn { %anmSmallLeftIn {

View File

@ -43,12 +43,11 @@ html, body, #container {
width: auto; width: auto;
@extend %trans; @extend %trans;
&.show { &.show {
background: none;
opacity: .9;
@extend %anmLeftIn; @extend %anmLeftIn;
.article { .article {
transition: opacity .5s ease-in, background-color .2s ease-in; transition: opacity .5s ease-in, background-color .2s ease-in;
opacity: 0.6; opacity: 0.6;
pointer-events: none;
} }
} }
&.hide { &.hide {

View File

@ -11,12 +11,10 @@
overflow-scrolling: touch; overflow-scrolling: touch;
@extend %trans; @extend %trans;
&.show { &.show {
opacity: 1;
@extend %anmSmallLeftIn; @extend %anmSmallLeftIn;
} }
&.hide { &.hide {
@extend %anmSmallLeftOut; @extend %anmSmallLeftOut;
z-index: 0;
} }
.tools-nav { .tools-nav {
display: none; display: none;

View File

@ -7,7 +7,7 @@ window.AV = require('leancloud-storage')
* 但是缺少一些新功能 * 但是缺少一些新功能
*/ */
// 评论配置 // 评论配置
const commentConfig = require("../config/comment.json") const commentConfig = require('../config/comment.json')
import(/* webpackChunkName: "valine" */ '../lib/Valine.min').then(({default: Valine }) => { import(/* webpackChunkName: "valine" */ '../lib/Valine.min').then(({default: Valine }) => {
commentConfig.valine.config.path = window.location.pathname commentConfig.valine.config.path = window.location.pathname

View File

@ -21,8 +21,23 @@ Util.addLoadEvent(function() {
} }
}) })
const commentConfig = require("../config/comment.json") const commentConfig = require('../config/comment.json')
if(window.themeConfig.isPost && commentConfig.valine.enable) { if(window.themeConfig.isPost && commentConfig.valine.enable) {
// 文章详情页面, 并且启用了评论, 则加载评论相关代码 // 文章详情页面, 并且启用了评论, 则加载评论相关代码
import(/* webpackChunkName: "comment" */ './comment') import(/* webpackChunkName: "comment" */ './comment')
} }
var hideWaifu = localStorage.getItem('hideWaifu')
if(!hideWaifu || !eval(hideWaifu)) {
import(/* webpackChunkName: "waifu" */ './waifu').then(waifuInit => {
waifuInit.default.init()
})
}
// 控制台
console.log(
'\n %c Silence %c https://www.colorfulsweet.site \n',
'color:#FFFFFB;background:#ffa628;padding:5px 0;border-radius:.5rem 0 0 .5rem;',
'background: #efefef;padding:5px 0;border-radius:0 .5rem .5rem 0;'
)
console.log(`页面加载消耗了 ${(Math.round(performance.now()*100)/100/1000).toFixed(2)}s`)

View File

@ -19,7 +19,7 @@ new Vue({
el: '#container', el: '#container',
data: { data: {
isCtnShow: false, isCtnShow: false,
isShow: false, isShow: undefined,
items: [], items: [],
innerArchive: false, innerArchive: false,
friends: false, friends: false,
@ -191,6 +191,7 @@ const waifuTools = {
// 隐藏看板娘 // 隐藏看板娘
setTimeout(function() { setTimeout(function() {
document.querySelector('.waifu').style.display = 'none' document.querySelector('.waifu').style.display = 'none'
localStorage.setItem('hideWaifu', true)
}, 1300) }, 1300)
}, },
"tools.eye"() { "tools.eye"() {

View File

@ -12,19 +12,12 @@ function isSupportWebGL() {
return webGL && webGL instanceof WebGLRenderingContext return webGL && webGL instanceof WebGLRenderingContext
} }
if(!isMobile && isSupportWebGL()) { export default {
// 加载live2d模型 init() {
loadlive2d('live2d', 'https://blog-cdn.nos-eastchina1.126.net/live2D/Kesshouban/model.json') if(!isMobile && isSupportWebGL()) {
document.querySelector('.waifu').style.display = 'block' // 加载live2d模型
loadlive2d('live2d', 'https://blog-cdn.nos-eastchina1.126.net/live2D/Kesshouban/model.json')
document.querySelector('.waifu').style.display = 'block'
}
}
} }
// 控制台
console.log(
'\n %c Silence %c https://www.colorfulsweet.site \n',
'color:#FFFFFB;background:#ffa628;padding:5px 0;border-radius:.5rem 0 0 .5rem;',
'background: #efefef;padding:5px 0;border-radius:0 .5rem .5rem 0;'
)
console.log(`页面加载消耗了 ${(Math.round(performance.now()*100)/100/1000).toFixed(2)}s`)

View File

@ -18,8 +18,7 @@ module.exports = function(env, argv) {
main: './source-src/js/main.js', main: './source-src/js/main.js',
slider: './source-src/js/slider.js', slider: './source-src/js/slider.js',
mobile: ['babel-polyfill', './source-src/js/mobile.js'], mobile: ['babel-polyfill', './source-src/js/mobile.js'],
viewer: './source-src/js/viewer.js', viewer: './source-src/js/viewer.js'
waifu: './source-src/js/waifu.js'
}, },
output: { output: {
publicPath: '/', publicPath: '/',