Skip to content

Commit 34deedc

Browse files
committed
add index.html
1 parent 15ca6cd commit 34deedc

File tree

371 files changed

+146
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

371 files changed

+146
-0
lines changed

_model_images/bilibili.jpg

79.1 KB

asserts/js/live2dv3.init.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
document.write('<div class="Canvas" style="position: fixed; right: -120px; bottom: 5px;z-index: 99999999" id="L2dCanvas"></div>');
2+
// 依赖js
3+
// 兼容低版本浏览器
4+
document.write('<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"> </script>');
5+
// 音频播放
6+
document.write('<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/howler.min.js"></script>');
7+
// 必需
8+
document.write('<script src="https://cubism.live2d.com/sdk-web/cubismcore/live2dcubismcore.min.js"></script>');
9+
document.write('<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/pixi.min.js"></script>');
10+
// live2dv3.js
11+
document.write('<script src="https://cdn.jsdelivr.net/npm/[email protected]/live2dv3.min.js"></script>');
12+
var l2dv
13+
window.onload = () => {
14+
l2dv = new l2dViewer({
15+
el: document.getElementById('L2dCanvas'), // 要添加Live2d的元素
16+
basePath: 'https://cdn.jsdelivr.net/gh/alg-wiki/AzurLaneL2DViewer@gh-pages/assets', // 模型根目录
17+
modelName: 'dujiaoshou_6', // 模型名称
18+
sounds: [ // 触摸播放声音
19+
'sounds/demo.mp3', // 相对路径是相对于模型文件夹
20+
'https://cdn.jsdelivr.net/npm/live2dv3@latest/assets/biaoqiang_3/sounds/demo.mp3' // 也可以是网址
21+
]
22+
})
23+
}
24+
25+
function loadModel() {
26+
var modelName = document.getElementById('modelName').value
27+
console.info(modelName + ' loading....' )
28+
l2dv.loadModel(modelName)
29+
}
30+
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)