Closed wu-kan closed 4 years ago
目前想要加载自定义模型要自己搭后端,感觉不太方便。能否修改成通过这个live2d-helper或者类似的方式加载模型?这样既不用自己搭后端,也可以通过jsdelivr之类的cdn加速live2d贴图的访问。
换成html代码大概长下面这个样子。
<script defer="defer" src="https://cdn.jsdelivr.net/npm/live2d-helper@1.0.0/dist/index.min.js" onload='if (screen.width >= 768) { document.body.insertAdjacentHTML("beforeend", ` <div id="waifu"> <canvas id="live2d"></canvas> </div>`); setTimeout(() => { document.getElementById("waifu").style.bottom = 0; document.getElementById("waifu").style.right = 0; document.getElementById("waifu").style.zIndex = 1; document.getElementById("waifu").style.position = "fixed"; }, 0); loadLive2d({ canvas: "live2d", baseUrl: "https:\/\/cdn.jsdelivr.net/gh/fghrsh/live2d_api/model/HyperdimensionNeptunia/nepnep", model: "https:\/\/cdn.jsdelivr.net/gh/fghrsh/live2d_api/model/HyperdimensionNeptunia/nepnep/index.json", width: "300", height: "415" }) }' ></script>
你这不都已经实现了 😂 自己用就好了嘛
所以是建议嘛😂
@wu-kan 我确认了一下后台的源代码,其实就是通过 302 重定向用的 jsDelivr 的 CDN。
现在已改为默认通过 jsDelivr 的 CDN 加载,代替原有的 API。
目前想要加载自定义模型要自己搭后端,感觉不太方便。能否修改成通过这个live2d-helper或者类似的方式加载模型?这样既不用自己搭后端,也可以通过jsdelivr之类的cdn加速live2d贴图的访问。
换成html代码大概长下面这个样子。