mirror of
https://github.com/stevenjoezhang/live2d-widget.git
synced 2024-11-22 04:34:20 +08: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() {
|
||||
$("#waifu-tool .fa-comment").click(showHitokoto);
|
||||
$("#waifu-tool .fa-paper-plane").click(function() {
|
||||
var s = document.createElement("script");
|
||||
document.body.appendChild(s);
|
||||
s.src = "https://cdn.jsdelivr.net/gh/GalaxyMimi/CDN/asteroids.js";
|
||||
if (window.Asteroids) {
|
||||
if (!window.ASTEROIDSPLAYERS) window.ASTEROIDSPLAYERS = [];
|
||||
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-street-view").click(loadRandModel);
|
||||
|
Loading…
Reference in New Issue
Block a user