布局优化替换CDN

This commit is contained in:
结发受长生 2019-06-13 23:08:29 +08:00
parent 46d2216d53
commit 4f5f3c2b2d
10 changed files with 17 additions and 14 deletions

View File

@ -93,7 +93,7 @@ pagination_dir: page
theme: yilia
# 图片存储仓库地址
picture_cdn: https://blog-cdn.nos-eastchina1.126.net
picture_cdn: https://cdn.colorfulsweet.site
# ICP备案号
ICP: 鲁ICP备19028444号

View File

@ -33,7 +33,8 @@ gulp.task('compressHtml', () => {
unprotect: /<script [^>]*\btype="text\/x-handlebars-template"[\s\S]+?<\/script>/ig //特殊处理
}
const minOption = {
collapseWhitespace: true, //压缩HTML
collapseWhitespace: true, //删除html中的空白
conservativeCollapse: true, //将多个空白折叠为1空白(永远不要完全移除), 必须与 collapseWhitespace=true 一起使用
collapseBooleanAttributes: true, //省略布尔属性的值 <input checked="true"/> ==> <input />
removeEmptyAttributes: true, //删除所有空属性值 <input id="" /> ==> <input />
removeScriptTypeAttributes: true, //删除<script>的type="text/javascript"
@ -41,7 +42,7 @@ gulp.task('compressHtml', () => {
removeComments: true, //清除HTML注释
minifyJS: true, //压缩页面JS
minifyCSS: true, //压缩页面CSS
minifyURLs: true //替换页面URL
minifyURLs: false //替换页面URL
}
return gulp.src('./public/**/*.html')
.pipe(plumber())

View File

@ -71,7 +71,7 @@ google_analytics: ''
favicon: /favicon.ico
#你的头像url
avatar: https://blog-cdn.nos-eastchina1.126.net/resources/avatar.jpg
avatar: https://cdn.colorfulsweet.site/resources/avatar.jpg
#是否开启分享
share_jia: true

View File

@ -1,7 +1,7 @@
<div class="waifu" @mouseover="waifu.showTools=true" @mouseout="waifu.showTools=false">
<div class="waifu-tips" v-text="waifu.tip" v-bind:style="{opacity: waifu.tipOpacity}"></div>
<div style="width: 250px;overflow: hidden;">
<canvas id="live2d" width="650" height="600" @mouseover="linkMouseover('waifu')" style="width: 325px;height: 300px;"></canvas>
<div>
<canvas id="live2d" width="520" height="480" @mouseover="linkMouseover('waifu')" style="width: 260px;height: 240px;"></canvas>
</div>
<div class="waifu-tool" v-show="waifu.showTools">
<span class="icon icon-eye" @mouseover="linkMouseover('tools.eye')" @click="toolsClick('tools.eye')"></span>

View File

@ -3,16 +3,14 @@
<% if (post.prev){ %>
<a href="<%- url_for(post.prev.path) %>" id="article-nav-newer" class="article-nav-link-wrap">
<div class="article-nav-title">
<i class="icon icon-arrow-circle-o-left"></i>
<%= post.prev.title %>
<i class="icon icon-arrow-circle-o-left"></i>&nbsp;<%= post.prev.title %>
</div>
</a>
<% } %>
<% if (post.next){ %>
<a href="<%- url_for(post.next.path) %>" id="article-nav-older" class="article-nav-link-wrap">
<div class="article-nav-title">
<%= post.next.title %>
<i class="icon icon-arrow-circle-o-right"></i>
<%= post.next.title %>&nbsp;<i class="icon icon-arrow-circle-o-right"></i>
</div>
</a>
<% } %>

View File

@ -11,7 +11,7 @@
}
.overlay{
width: 100%;
height: 150px;
height: 130px;
position: absolute;
background: #4d4d4d;
@extend %trans;
@ -20,7 +20,7 @@
.intrude-less {
width: 76%;
text-align: center;
margin: 82px auto 0;
margin: 62px auto 0;
}
#header{

View File

@ -87,6 +87,9 @@ body.night {
}
#mobile-nav {
background: none;
.overlay {
display: none;
}
}
.overlay {
background: none;

View File

@ -57,7 +57,7 @@
.waifu-tool {
color: $colorA;
top: 100px;
right: 10px;
right: 60px;
font-size: 14px;
position: absolute;
span {

View File

@ -59,6 +59,7 @@ new Vue({
}
},
linkMouseover(name) {
if(name === 'waifu' && waifuTipTimer) return
this.showMessage(waifuTips.mouseover[name], 3000)
},
toolsClick(name) {

View File

@ -16,7 +16,7 @@ export default {
init() {
if(!isMobile && isSupportWebGL()) {
// 加载live2d模型
loadlive2d('live2d', 'https://blog-cdn.nos-eastchina1.126.net/live2D/Kesshouban/model.json')
loadlive2d('live2d', window.themeConfig.pictureCdn + '/live2D/Kesshouban/model.json')
document.querySelector('.waifu').style.display = 'block'
}
}