看我老婆好看吗?

1508人浏览 / 0人评论

代码地址:https://github.com/stevenjoezhang/live2d-widget

按照上面说的步骤做就可以。

我做的方式是,先搭建一个nginx

nginx配置文件如下:

server {
    listen 8888;
    server_name 106.12.100.206;
    location / {
    root /opt/live2d-widget;
    index index.html;
}
}
 

然后下载代码:

cd /opt/

git clone https://github.com/stevenjoezhang/live2d-widget.git

[root@baiduyueaaa /usr/local/nginx/conf/vhosts ] # ls /opt/live2d-widget/
assets       demo     live2d.min.js  waifu.css      waifu-tips.json
autoload.js  LICENSE  README.md      waifu-tips.js
 

 

修改代码:

[root@baiduyueaaa /opt/live2d-widget ] # head autoload.js
// 注意:live2d_path 参数应使用绝对路径
const live2d_path = "http://106.12.100.206:8888/";
//const live2d_path = "/live2d-widget/";
 

访问:

[root@baiduyueaaa /opt/live2d-widget ] # curl http://106.12.100.206:8888/autoload.js
// 注意:live2d_path 参数应使用绝对路径
const live2d_path = "http://106.12.100.206:8888/";
//const live2d_path = "/live2d-widget/";
 

能访问到就行!!

 

 

然后在你的网站首页代码文件加入这段代码:

<script src="http://106.12.100.206:8888/autoload.js"></script> 

完成! 

全部评论