布局优化替换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 theme: yilia
# 图片存储仓库地址 # 图片存储仓库地址
picture_cdn: https://blog-cdn.nos-eastchina1.126.net picture_cdn: https://cdn.colorfulsweet.site
# ICP备案号 # ICP备案号
ICP: 鲁ICP备19028444号 ICP: 鲁ICP备19028444号

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,7 +16,7 @@ export default {
init() { init() {
if(!isMobile && isSupportWebGL()) { if(!isMobile && isSupportWebGL()) {
// 加载live2d模型 // 加载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' document.querySelector('.waifu').style.display = 'block'
} }
} }