mirror of
https://github.com/Buriburizaem0n/live2d.git
synced 2025-12-15 07:31:06 +00:00
final edition
This commit is contained in:
81
live2d/dist/auto.js
vendored
Normal file
81
live2d/dist/auto.js
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
const live2d_path = "https://www.luoyangdonghui.de/wp-content/uploads/live2d_test34/live2d/";
|
||||
<meting-js server="netease" type="playlist" id="2142063878" theme="#339981" fixed="true" preload="none" autoplay="false" loop="all" volume="0.3" order="random" mutex="true"></meting-js>;
|
||||
|
||||
//封装异步加载资源的方法
|
||||
function loadExternalResource(url, type) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let tag;
|
||||
if (type === "css") {
|
||||
tag = document.createElement("link");
|
||||
tag.rel = "stylesheet";
|
||||
tag.href = url;
|
||||
} else if (type === "js") {
|
||||
tag = document.createElement("script");
|
||||
tag.src = url;
|
||||
tag.async = true; // 确保脚本是异步加载的
|
||||
}
|
||||
if (tag) {
|
||||
tag.onload = () => {
|
||||
resolve(`Resource loaded: ${url}`);
|
||||
};
|
||||
|
||||
tag.onerror = (error) => {
|
||||
reject(new Error(`Failed to load resource: ${url} - ${error.message}`));
|
||||
};
|
||||
|
||||
// 确保只在没有相同资源的情况下加载,避免重复加载
|
||||
if (!document.head.querySelector(`[src="${url}"]`) && !document.head.querySelector(`[href="${url}"]`)) {
|
||||
document.head.appendChild(tag);
|
||||
} else {
|
||||
resolve(`Resource already loaded: ${url}`);
|
||||
}
|
||||
} else {
|
||||
reject(new Error(`Invalid resource type: ${type}`));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (screen.width >= 768) {
|
||||
Promise.all([
|
||||
loadExternalResource(live2d_path + "waifu.css", "css"),
|
||||
loadExternalResource(live2d_path + "live2d.min.js", "js"),
|
||||
loadExternalResource(live2d_path + "/dist/waifu-tips.js", "js"),
|
||||
loadExternalResource("https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css", "css"),
|
||||
loadExternalResource("https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js", "js"),
|
||||
loadExternalResource("https://cdn.jsdelivr.net/npm/live2dcubismcore@1.0.2/live2dcubismcore.min.js", "js"),
|
||||
]).then(() => {
|
||||
loadExternalResource("https://cdn.jsdelivr.net/npm/meting@2.0.1/dist/Meting.min.js", "js");
|
||||
});
|
||||
ap = null;
|
||||
Object.defineProperty(document.querySelector('meting-js'), "aplayer", {
|
||||
set: function(aplayer) {
|
||||
ap = aplayer;
|
||||
ap_init();
|
||||
initWidget();
|
||||
}
|
||||
});
|
||||
}
|
||||
console.log(`
|
||||
く__,.ヘヽ. / ,ー、 〉
|
||||
\ ', !-─‐-i / /´
|
||||
/`ー' L//`ヽ、
|
||||
/ /, /| , , ',
|
||||
イ / /-‐/ i L_ ハ ヽ! i
|
||||
レ ヘ 7イ`ト レ'ァ-ト、!ハ| |
|
||||
!,/7 '0' ´0iソ| |
|
||||
|.从" _ ,,,, / |./ |
|
||||
レ'| i>.、,,__ _,.イ / .i |
|
||||
レ'| | / k_7_/レ'ヽ, ハ. |
|
||||
| |/i 〈|/ i ,.ヘ | i |
|
||||
.|/ / i: ヘ! \ |
|
||||
kヽ>、ハ _,.ヘ、 /、!
|
||||
!'〈//`T´', \ `'7'ーr'
|
||||
レ'ヽL__|___i,___,ンレ|ノ
|
||||
ト-,/ |___./
|
||||
'ー' !_,.:
|
||||
|
||||
等待的结果呢?
|
||||
等待就是结果。
|
||||
那,不是悲剧吗?
|
||||
不,是秋天。
|
||||
`);
|
||||
2
live2d/dist/waifu-tips.js
vendored
2
live2d/dist/waifu-tips.js
vendored
@@ -44800,6 +44800,6 @@
|
||||
window.initWidget = initWidget;
|
||||
|
||||
|
||||
console.log('\n' + ' %c Live2D with Music Player' + ' %c https://github.com/crowya/live2d ' + '\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');
|
||||
console.log('\n' + ' %c Live2D with Music Player (reedited by Buriburi)' + ' %c https://github.com/buriburizaem0n/live2d ' + '\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');
|
||||
|
||||
})();
|
||||
|
||||
@@ -280,4 +280,4 @@ window.ap_init = ap_init;
|
||||
window.initWidget = initWidget;
|
||||
|
||||
|
||||
console.log('\n' + ' %c Live2D with Music Player' + ' %c https://github.com/buriburizaem0n/live2d ' + '\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');
|
||||
console.log('\n' + ' %c Live2D with Music Player (reedited by Buriburi)' + ' %c https://github.com/buriburizaem0n/live2d ' + '\n', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #fadfa3; padding:5px 0;');
|
||||
|
||||
Reference in New Issue
Block a user