在网页中添加一个Live2d,主要是在文件中添加head文件的css引用和body中js脚本的引用;
1、将资源文件解压到网站源码文件夹内;
2、打开当前模板或主页的head部分;添加CSS引用;在<head>...</head>之间随便找一个非注释位置插入都可以;
<link rel="stylesheet" type="text/css" href="https://www.eleraptor.com/zb_users/theme/filmlee/template/live2D/waifu.css"/> <!-- 看板娘--> |
红色位置是live2d的文件夹路径,绝对路径和相对路径都可以;
3、在网页body或footer部分进行js引用,在当前希望出现的页面调用php文件中,插入一下代码;
<div class="waifu"> <div class="waifu-tips"></div> <canvas id="live2d" width="280" height="250" class="live2d"></canvas> <div class="waifu-tool"> <span class="fui-home"></span> <span class="fui-chat"></span> <span class="fui-eye"></span> <span class="fui-user"></span> <span class="fui-photo"></span> <span class="fui-info-circle"></span> <span class="fui-cross"></span> </div> </div> <script src="https://www.eleraptor.com/zb_users/theme/filmlee/template/live2D/waifu-tips.js"></script> <script src="https://www.eleraptor.com/zb_users/theme/filmlee/template/live2D/live2d.js"></script> <script type="text/javascript">initModel("/")</script> |
红色部分对应自己的文件路径;
live2d文件下载 点击下载 1v9i
--资源来自网络,若有侵权请联系删除!