mirror of
https://github.com/caojiezi2003/live2d-widget.git
synced 2024-11-22 23:29:45 +00:00
Optimize the loading of Asteroids
This commit is contained in:
parent
2da4c8661c
commit
aab6246545
@ -24,9 +24,16 @@ function loadWidget(waifuPath, apiPath) {
|
|||||||
function registerEventListener() {
|
function registerEventListener() {
|
||||||
$("#waifu-tool .fa-comment").click(showHitokoto);
|
$("#waifu-tool .fa-comment").click(showHitokoto);
|
||||||
$("#waifu-tool .fa-paper-plane").click(function() {
|
$("#waifu-tool .fa-paper-plane").click(function() {
|
||||||
var s = document.createElement("script");
|
if (window.Asteroids) {
|
||||||
document.body.appendChild(s);
|
if (!window.ASTEROIDSPLAYERS) window.ASTEROIDSPLAYERS = [];
|
||||||
s.src = "https://cdn.jsdelivr.net/gh/GalaxyMimi/CDN/asteroids.js";
|
window.ASTEROIDSPLAYERS.push(new Asteroids());
|
||||||
|
} else {
|
||||||
|
$.ajax({
|
||||||
|
url: "https://cdn.jsdelivr.net/gh/GalaxyMimi/CDN/asteroids.js",
|
||||||
|
dataType: "script",
|
||||||
|
cache: true
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
$("#waifu-tool .fa-user-circle").click(loadOtherModel);
|
$("#waifu-tool .fa-user-circle").click(loadOtherModel);
|
||||||
$("#waifu-tool .fa-street-view").click(loadRandModel);
|
$("#waifu-tool .fa-street-view").click(loadRandModel);
|
||||||
|
Loading…
Reference in New Issue
Block a user