PageSourceSearch

https://xia0ji233.pro/live2d-widget/dist/autoload.js

js xia0ji233.pro collected 2026-10-03 23:19:19 UTC 2,088 bytes, 63 lines download raw bytes

1// live2d_path 参数建议使用绝对路径
2// const live2d_path = "https://fastly.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/";
3const live2d_path = "/live2d-widget/dist/";
4
5// 封装异步加载资源的方法
6function loadExternalResource(url, type) {
7	return new Promise((resolve, reject) => {
8		let tag;
9
10		if (type === "css") {
11			tag = document.createElement("link");
12			tag.rel = "stylesheet";
13			tag.href = url;
14		}
15		else if (type === "js") {
16			tag = document.createElement("script");
17			tag.src = url;
18		}
19		if (tag) {
20			tag.onload = () => resolve(url);
21			tag.onerror = () => reject(url);
22			document.head.appendChild(tag);
23		}
24	});
25}
26
27// 加载 waifu.css live2d.min.js waifu-tips.js
28if (screen.width >= 768) {
29	Promise.all([
30		loadExternalResource(live2d_path + "waifu.css", "css"),
31		loadExternalResource(live2d_path + "live2d.min.js", "js"),
32		loadExternalResource(live2d_path + "waifu-tips.js", "js")
33	]).then(() => {
34		// 配置选项的具体用法见 README.md
35		initWidget({
36			waifuPath: live2d_path + "waifu-tips.json",
37			//apiPath: "https://live2d.fghrsh.net/api/",
38			//cdnPath: "https://fastly.jsdelivr.net/gh/fghrsh/live2d_api/",
39            cdnPath: "https://xia0ji233.pro/live2d-widget/api/",
40			tools: ["hitokoto", "asteroids", "switch-model", "switch-texture", "photo", "info", "quit"]
41		});
42	});
43}
44
45console.log(`
46  く__,.ヘヽ.        /  ,ー、 〉
47           \ ', !-─‐-i  /  /´
48           /`ー'       L//`ヽ、
49         /   /,   /|   ,   ,       ',
50       イ   / /-‐/  i  L_ ハ ヽ!   i
51        レ ヘ 7イ`ト   レ'ァ-ト、!ハ|   |
52          !,/7 '0'     ´0iソ|    |
53          |.从"    _     ,,,, / |./    |
54          レ'| i>.、,,__  _,.イ /   .i   |
55            レ'| | / k_7_/レ'ヽ,  ハ.  |
56              | |/i 〈|/   i  ,.ヘ |  i  |
57             .|/ /  i:    ヘ!    \  |
58              kヽ>、ハ    _,.ヘ、    /、!
59              !'〈//`T´', \ `'7'ーr'
60              レ'ヽL__|___i,___,ンレ|ノ
61                  ト-,/  |___./
62                  'ï½°'    !_,.:
63`);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.