Git Product home page Git Product logo

Comments (2)

linonetwo avatar linonetwo commented on September 24, 2024 1

我后来发现基于 pixijs 更方便,详见 Uni-Gal/Ayaka#345

from live2d_api.

Dragon1573 avatar Dragon1573 commented on September 24, 2024

实测 PHP 后端不是必须的。下面是我在 GitHub Pages 托管 Hexo 站点的方法:

  1. stevenjoezhang/live2d-widget Clone 到 $PROJECT_ROOT/source/live2d-widget
  2. 把本仓 Clone 到 $PROJECT_ROOT/source/live2d_api/
  3. 修改 live2d-widget/autoload.js ,把 cdnPath 改成本地绝对路径即可。
  4. 编译构建 Hexo 站点静态文件得到 $PROJECT_ROOT/public 目录,用任意 Web 服务器发布站点查看效果
// 加载 waifu.css live2d.min.js waifu-tips.js
if (screen.width >= 768) {
	Promise.all([
		loadExternalResource(live2d_path + "waifu.css", "css"),
		loadExternalResource(live2d_path + "live2d.min.js", "js"),
		loadExternalResource(live2d_path + "waifu-tips.js", "js")
	]).then(() => {
		// 配置选项的具体用法见 README.md
		initWidget({
			waifuPath: live2d_path + "waifu-tips.json",
			//apiPath: "https://live2d.fghrsh.net/api/",
-			cdnPath: "https://fastly.jsdelivr.net/gh/fghrsh/live2d_api/",
+			cdnPath: "/live2d_api/",
			// tools: ["hitokoto", "asteroids", "switch-model", "switch-texture", "photo", "info", "quit"]
			tools: ["hitokoto", "switch-model", "switch-texture", "photo", "info", "quit"]
		});
	});
}

from live2d_api.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.