打包方式调整

This commit is contained in:
结发受长生
2019-04-28 15:05:11 +08:00
parent 4ee641975c
commit 17c18eb256
16 changed files with 39 additions and 19 deletions
+1 -1
View File
@@ -185,7 +185,7 @@ const waifuTools = {
"tools.chart"() {
// 一言
axios.get('https://api.imjad.cn/hitokoto/?cat=&charset=utf-8&length=55&encode=json').then(res => {
this.showMessage(`${res.data.hitokoto}  --${res.data.source}`)
this.showMessage(res.data.hitokoto + res.data.source?`  ——${res.data.source}`:'')
})
}
}
+12 -2
View File
@@ -2,8 +2,18 @@ import '../lib/live2d'
// 浏览器判断
import Browser from './browser'
const isMobile = (Browser.versions.mobile && window.screen.width < 800)
// 加载live2d模型
if(!isMobile) {
/**
* 判断浏览器是否支持WebGL
*/
function isSupportWebGL() {
var canvas = document.createElement("canvas");
var webGL = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
return webGL && webGL instanceof WebGLRenderingContext
}
if(!isMobile && isSupportWebGL()) {
// 加载live2d模型
loadlive2d('live2d', 'https://blog-cdn.nos-eastchina1.126.net/live2D/Kesshouban/model.json')
document.querySelector('.waifu').style.display = 'block'
}