mirror of
https://github.com/caojiezi2003/live2d-widget.git
synced 2024-11-10 04:49:47 +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() {
|
||||
$("#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