live2d-widget/autoload.js
2019-02-11 14:04:25 +08:00

26 lines
788 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

$("<link>").attr({href: "https://www.example.com/path/to/waifu.css", rel: "stylesheet", type: "text/css"}).appendTo('head');
//waifu.css的绝对路径
$.ajax({
url: 'https://www.example.com/path/to/live2d.min.js',
dataType:"script",
cache: true,
async: false
});
//live2d.min.js的绝对路径
$.ajax({
url: 'https://www.example.com/path/to/waifu-tips.js',
dataType:"script",
cache: true,
async: false
});
//waifu-tips.js的绝对路径
// 初始化看板娘,会自动加载指定目录下的 waifu-tips.json
$(window).on("load", function() {
initWidget("/lib/waifu/", "https://live2d.fghrsh.net/api");
});
//initWidget第一个参数为waifu-tips.json所在的文件夹第二个参数为api地址
//api后端可自行搭建参考https://github.com/fghrsh/live2d_api