Skip to content

Commit 273b578

Browse files
committed
add lib
1 parent 2398b08 commit 273b578

File tree

4 files changed

+160
-138
lines changed

4 files changed

+160
-138
lines changed

assets/js/charData.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,24 @@ var charData = {
3232
// "Z46 (First Summer)": "z46_2",
3333

3434
"Eldridge (New Year's Handholding)": "aierdeliqi_4",
35-
"Centaur (Undine of the Beach)": "banrenma_2",
35+
// "Centaur (Undine of the Beach)": "banrenma_2",
3636
"Javelin": "biaoqiang",
3737
"Javelin (Beach Picnic!)": "biaoqiang_3",
3838
"Fubuki (Music Pixy)": "chuixue_3",
3939
"Cleveland (Gentry Knight)": "kelifulan_3",
4040
"Laffey": "lafei",
4141
"Laffey (New Year Rabbit)": "lafei_4",
4242
"Yukikaze": "xuefeng",
43-
"Ibuki (Wish of a Snow Goddess)": "yichui_2",
43+
// "Ibuki (Wish of a Snow Goddess)": "yichui_2",
4444

45-
"dujiaoshou_6": "dujiaoshou_6",
45+
// "dujiaoshou_6": "dujiaoshou_6",
4646
"edu_3": "edu_3",
4747
"xuefeng_3": "xuefeng_3",
4848

49-
"1014100aqua": "1014100aqua",
50-
"1024100": "1024100",
51-
"1033113": "1033113",
52-
"1044100": "1044100"
49+
// "1014100aqua": "1014100aqua",
50+
// "1024100": "1024100",
51+
// "1033113": "1033113",
52+
// "1044100": "1044100"
5353

5454

5555
};

assets/js/lib/live2dcubismcore.min.js

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/live2dv3.init.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
// 兼容低版本浏览器
33
document.write('<script src="https://unpkg.com/[email protected]/minified.js"></script>');
44
// 音频播放
5-
document.write('<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/howler.min.js"></script>');
5+
// document.write('<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/howler.min.js"></script>');
66
// 必需
7-
document.write('<script src="https://cubism.live2d.com/sdk-web/cubismcore/live2dcubismcore.min.js"></script>');
7+
// document.write('<script src="https://cubism.live2d.com/sdk-web/cubismcore/live2dcubismcore.min.js"></script>');
8+
document.write('<script src="https://cdn.jsdelivr.net/gh/jianchengwang/live2d_models@main/assets/js/lib/live2dcubismcore.min.js"></script>');
89
// live2dv3.js
910
document.write('<script src="https://cdn.jsdelivr.net/gh/jianchengwang/live2d_models@main/assets/js/live2dv3.js"></script>');
1011
// 内置角色
@@ -14,7 +15,7 @@ document.write('<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-a
1415
document.write('<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jianchengwang/live2d_models@main/assets/css/live2dv3.init.css">');
1516

1617
// 创建看板娘div
17-
document.write(
18+
document.write(
1819
`<div id="l2d-toggle" class="" style="visibility:hidden;">
1920
<span>看版娘</span>
2021
</div>
@@ -41,7 +42,7 @@ window.onload = () => {
4142
// 创建l2dv
4243
var l2dv
4344
function createL2dv() {
44-
if(!l2dv) {
45+
if (!l2dv) {
4546
l2dv = new L2dViewer({
4647
el: document.getElementById('L2dCanvas'),
4748
// modelHomePath: './assets/model/',
@@ -60,7 +61,7 @@ function createL2dv() {
6061
}, 2000);
6162
}
6263
// 注册事件
63-
registerEventListener();
64+
registerEventListener();
6465
}
6566

6667
// 监听事件
@@ -89,7 +90,7 @@ function registerEventListener() {
8990
document.getElementById("l2d-toggle").addEventListener("click", showModel);
9091

9192
// other
92-
const devtools = () => {};
93+
const devtools = () => { };
9394
console.log("%c", devtools);
9495
devtools.toString = () => {
9596
showMessage("哈哈,你打开了控制台,是想要看看我的小秘密吗?", 4000, 9);
@@ -126,16 +127,16 @@ function showModel() {
126127
// 加载model
127128
function loadModel(modelName) {
128129
showMessage("正在切换看板娘...", 6000, 1);
129-
if(modelName instanceof MouseEvent) {
130+
if (modelName instanceof MouseEvent) {
130131
modelName = randomChar();
131-
} else if(!modelName) {
132-
if(document.getElementById('modelName')) {
132+
} else if (!modelName) {
133+
if (document.getElementById('modelName')) {
133134
modelName = document.getElementById('modelName').value
134135
} else {
135136
modelName = randomChar();
136137
}
137138
}
138-
console.info(modelName + ' loading....' )
139+
console.info(modelName + ' loading....')
139140
l2dv.loadModel(modelName)
140141
}
141142

@@ -162,7 +163,7 @@ function showHitokoto() {
162163
// 显示tip消息
163164
function showMessage(text, timeout, priority) {
164165
if (!text) return;
165-
if(!timeout) timeout = 1000;
166+
if (!timeout) timeout = 1000;
166167
const tips = document.getElementById("l2d-tips");
167168
tips.innerHTML = text;
168169
tips.classList.add("l2d-tips-active");
@@ -171,4 +172,3 @@ function showMessage(text, timeout, priority) {
171172
tips.classList.remove("l2d-tips-active");
172173
}, timeout);
173174
}
174-

0 commit comments

Comments
 (0)